diff --git a/CMakeLists.txt b/CMakeLists.txt index cf7a3b0..3514f34 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,19 +29,24 @@ endif() add_subdirectory(softfloat) -# library files -FILE(GLOB GEN_SOURCES - ${CMAKE_CURRENT_SOURCE_DIR}/src-gen/iss/arch/*.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src-gen/vm/interp/vm_*.cpp -) - set(LIB_SOURCES src/iss/plugin/instruction_count.cpp src/iss/arch/tgc_c.cpp src/vm/interp/vm_tgc_c.cpp src/vm/fp_functions.cpp - ${GEN_SOURCES} ) + +# library files +if(TARGET ${CORE_NAME}_cpp) + list(APPEND LIB_SOURCES ${${CORE_NAME}_OUTPUT_FILES}) +else() + FILE(GLOB GEN_SOURCES + ${CMAKE_CURRENT_SOURCE_DIR}/src-gen/iss/arch/*.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src-gen/vm/interp/vm_*.cpp + ) + list(APPEND LIB_SOURCES ${GEN_SOURCES}) +endif() + if(TARGET RapidJSON OR TARGET RapidJSON::RapidJSON) list(APPEND LIB_SOURCES src/iss/plugin/cycle_estimate.cpp src/iss/plugin/pctrace.cpp) endif()