From 9d65812c1303e3f69aa8b97f62ed4b0a36d76b2e Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Tue, 27 Feb 2024 10:21:06 +0100 Subject: [PATCH] cmake: fix isle runtime library + parallel building with ninja (#599) --- CMakeLists.txt | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 87e23acb..293c86bd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -514,12 +514,12 @@ if (MSVC_FOR_DECOMP) # game was originally built with) and tweaked slightly to produce more debugging info for reccmp. # They ensure a recompilation that can be byte/instruction accurate to the original binaries. if (ISLE_BUILD_APP) - target_compile_options(isle PRIVATE "/MT$<$:d>") target_link_options(isle PRIVATE "/OPT:REF") + set_property(TARGET isle ${lego1_targets} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") endif() # Equivalent to target_compile_options(... PRIVATE "/MT$<$:d>") - set_property(TARGET lego1 ${lego1_targets} PROPERTY MSVC_RUNTIME_LIBRARY MultiThreaded$<$:Debug>) + set_property(TARGET lego1 ${lego1_targets} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") set(CMAKE_CXX_FLAGS "/W3 /GX /D \"WIN32\" /D \"_WINDOWS\"") set(CMAKE_CXX_FLAGS_DEBUG "/Gm /Zi /Od /D \"_DEBUG\"") @@ -545,14 +545,19 @@ if (MSVC_FOR_DECOMP) # Force non-parallel builds of isle and lego1 by putting them in a pool with 1 available job. if (CMAKE_CXX_COMPILER_ID VERSION_LESS 12) foreach(tgt IN LISTS lego1_targets) - set_property(GLOBAL APPEND PROPERTY JOB_POOLS "msvc_${tgt}=1;msvc_lego1=1") - set_property(TARGET ${tgt} PROPERTY JOB_POOL_COMPILE msvc_${tgt}) - set_property(TARGET ${tgt} PROPERTY JOB_POOL_LINK msvc_${tgt}) + set_property(GLOBAL APPEND PROPERTY JOB_POOLS "msvc_${tgt}=1") + set_property(TARGET ${tgt} PROPERTY JOB_POOL_COMPILE "msvc_${tgt}") + set_property(TARGET ${tgt} PROPERTY JOB_POOL_LINK "msvc_${tgt}") endforeach() if (TARGET isle) set_property(GLOBAL APPEND PROPERTY JOB_POOLS "msvc_isle=1") - set_property(TARGET isle PROPERTY JOB_POOL_COMPILE msvc_isle) - set_property(TARGET isle PROPERTY JOB_POOL_LINK msvc_isle) + set_property(TARGET isle PROPERTY JOB_POOL_COMPILE "msvc_isle") + set_property(TARGET isle PROPERTY JOB_POOL_LINK "msvc_isle") + endif() + if (TARGET config) + set_property(GLOBAL APPEND PROPERTY JOB_POOLS "msvc_config=1") + set_property(TARGET config PROPERTY JOB_POOL_COMPILE "msvc_config") + set_property(TARGET config PROPERTY JOB_POOL_LINK "msvc_config") endif() endif() endif()