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:
xinyangli 2024-04-05 02:12:30 +08:00
parent 849f2bb5f3
commit f02d5eb2f1
Signed by: xin
SSH key fingerprint: SHA256:qZ/tzd8lYRtUFSrfBDBMcUqV4GHKxqeqRA3huItgvbk
6 changed files with 110 additions and 97 deletions

1
npc/csrc/CMakeLists.txt Normal file
View file

@ -0,0 +1 @@
add_subdirectory(${TOPMODULE})

View file

@ -0,0 +1,11 @@
include(ChiselBuild)
add_executable(V${TOPMODULE} config.cpp main.cpp)
verilate(V${TOPMODULE} TRACE COVERAGE THREADS
TOP_MODULE ${TOPMODULE}
PREFIX V${TOPMODULE}
SOURCES ${CHISEL_OUTPUT_TOPMODULE} ${CHISEL_OUTPUT_VERILATOR_CONF}
INCLUDE_DIRS ${CHISEL_OUTPUT_DIR}
VERILATOR_ARGS
"--vpi" # Enable VPI
)