From 37068c4f3658af67dcfa8d0b469824f9e5ed2b3a Mon Sep 17 00:00:00 2001 From: Yang Liu Date: Fri, 23 May 2025 15:26:52 +0800 Subject: [CMAKE] Removed the hard dependency between dynarec and main executable to speed up build --- CMakeLists.txt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e49adfc9..73fbfcae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1140,7 +1140,7 @@ if(DYNAREC) add_custom_command( OUTPUT "${BOX64_ROOT}/src/git_head.h" COMMAND sh -c "echo \\\#define GITREV \\\"$(git rev-parse --short HEAD)\\\">\"${BOX64_ROOT}/src/git_head.h\"" - DEPENDS dynarec ${ELFLOADER_SRC} ${INTERPRETER} ${WRAPPEDS} ${WRAPPEDS32} + DEPENDS ${DYNAREC_SRC} ${DYNAREC_ASM} ${DYNAREC_PASS} ${ELFLOADER_SRC} ${INTERPRETER} ${WRAPPEDS} ${WRAPPEDS32} VERBATIM) else() add_custom_command( @@ -1150,9 +1150,17 @@ else() VERBATIM) endif() +add_custom_target(generate_git_head_target + DEPENDS "${BOX64_ROOT}/src/git_head.h" +) + add_library(interpreter OBJECT ${INTERPRETER}) -add_executable(${BOX64} ${OS_LINUX_SRC} ${ELFLOADER_SRC} ${WRAPPEDS} ${WRAPPEDS32} "${BOX64_ROOT}/src/git_head.h") +add_library(mainobj OBJECT ${OS_LINUX_SRC} ${ELFLOADER_SRC} ${WRAPPEDS} ${WRAPPEDS32}) +add_dependencies(mainobj generate_git_head_target) + +add_executable(${BOX64}) +target_link_libraries(${BOX64} mainobj) set_target_properties(${BOX64} PROPERTIES ENABLE_EXPORTS ON) add_dependencies(${BOX64} WRAPPERS) if(BOX32) -- cgit 1.4.1