Fix race condition and optimise the build
This commit is contained in:
parent
763fd56c26
commit
e6302bbe73
1
ice40/.gitignore
vendored
1
ice40/.gitignore
vendored
@ -2,3 +2,4 @@
|
|||||||
/chipdb-384.cc
|
/chipdb-384.cc
|
||||||
/chipdb-5k.cc
|
/chipdb-5k.cc
|
||||||
/chipdb-8k.cc
|
/chipdb-8k.cc
|
||||||
|
chipdbs/
|
||||||
|
@ -1,14 +1,18 @@
|
|||||||
set(devices 384 1k 5k 8k)
|
set(devices 384 1k 5k 8k)
|
||||||
set(DB_PY ${CMAKE_CURRENT_SOURCE_DIR}/ice40/chipdb.py)
|
set(DB_PY ${CMAKE_CURRENT_SOURCE_DIR}/ice40/chipdb.py)
|
||||||
|
file(MAKE_DIRECTORY ice40/chipdbs/)
|
||||||
|
add_library(ice40_chipdb OBJECT ice40/chipdbs/)
|
||||||
|
target_include_directories(ice40_chipdb PRIVATE ${family}/)
|
||||||
foreach (dev ${devices})
|
foreach (dev ${devices})
|
||||||
set(DEV_TXT_DB /usr/local/share/icebox/chipdb-${dev}.txt)
|
set(DEV_TXT_DB /usr/local/share/icebox/chipdb-${dev}.txt)
|
||||||
set(DEV_CC_DB ${CMAKE_CURRENT_SOURCE_DIR}/ice40/chipdb-${dev}.cc)
|
set(DEV_CC_DB ${CMAKE_CURRENT_SOURCE_DIR}/ice40/chipdbs/chipdb-${dev}.cc)
|
||||||
add_custom_command(OUTPUT ${DEV_CC_DB}
|
add_custom_command(OUTPUT ${DEV_CC_DB}
|
||||||
COMMAND python3 ${DB_PY} ${DEV_TXT_DB} > ${DEV_CC_DB}.new
|
COMMAND python3 ${DB_PY} ${DEV_TXT_DB} > ${DEV_CC_DB}.new
|
||||||
COMMAND mv ${DEV_CC_DB}.new ${DEV_CC_DB}
|
COMMAND mv ${DEV_CC_DB}.new ${DEV_CC_DB}
|
||||||
DEPENDS ${DEV_TXT_DB} ${DB_PY}
|
DEPENDS ${DEV_TXT_DB} ${DB_PY}
|
||||||
)
|
)
|
||||||
|
target_sources(ice40_chipdb PRIVATE ${DEV_CC_DB})
|
||||||
foreach (target ${family_targets})
|
foreach (target ${family_targets})
|
||||||
target_sources(${target} PRIVATE ${DEV_CC_DB})
|
target_sources(${target} PRIVATE $<TARGET_OBJECTS:ice40_chipdb>)
|
||||||
endforeach (target)
|
endforeach (target)
|
||||||
endforeach (dev)
|
endforeach (dev)
|
||||||
|
Loading…
Reference in New Issue
Block a user