build: split CMakeLists
- Put add_custom_command into seperate ChiselBuild module. Otherwise final target cannot correctly depends on scala sources.
This commit is contained in:
parent
849f2bb5f3
commit
f02d5eb2f1
6 changed files with 110 additions and 97 deletions
23
npc/csrc_nvboard/Flow/CMakeLists.txt
Normal file
23
npc/csrc_nvboard/Flow/CMakeLists.txt
Normal file
|
@ -0,0 +1,23 @@
|
|||
include(ChiselBuild)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${TOPMODULE}/auto_bind.cpp
|
||||
COMMAND auto_pin_bind ${CMAKE_SOURCE_DIR}/constr/${TOPMODULE}.nxdc ${CMAKE_CURRENT_BINARY_DIR}/${TOPMODULE}/auto_bind.cpp
|
||||
DEPENDS ${CMAKE_SOURCE_DIR}/constr/${TOPMODULE}.nxdc
|
||||
)
|
||||
|
||||
add_executable(V${TOPMODULE}_nvboard
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${TOPMODULE}/auto_bind.cpp
|
||||
main.cpp
|
||||
)
|
||||
|
||||
verilate(V${TOPMODULE}_nvboard TRACE THREADS
|
||||
TOP_MODULE ${TOPMODULE}
|
||||
PREFIX V${TOPMODULE}
|
||||
SOURCES ${CHISEL_OUTPUT_TOPMODULE}
|
||||
INCLUDE_DIRS ${CHISEL_OUTPUT_DIR})
|
||||
|
||||
target_include_directories(V${TOPMODULE}_nvboard PRIVATE ${NVBOARD_INCLUDE_DIR} ${SDL2_INCLUDE_DIRS})
|
||||
target_link_libraries(V${TOPMODULE}_nvboard PRIVATE ${NVBOARD_LIBRARY} SDL2::SDL2 SDL2_image::SDL2_image)
|
||||
|
||||
install(TARGETS V${TOPMODULE}_nvboard)
|
Loading…
Add table
Add a link
Reference in a new issue