cmake: fix isle runtime library + parallel building with ninja (#599)

This commit is contained in:
Anonymous Maarten 2024-02-27 10:21:06 +01:00 committed by GitHub
parent 60161c43b5
commit 9d65812c13
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -514,12 +514,12 @@ if (MSVC_FOR_DECOMP)
# game was originally built with) and tweaked slightly to produce more debugging info for reccmp. # 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. # They ensure a recompilation that can be byte/instruction accurate to the original binaries.
if (ISLE_BUILD_APP) if (ISLE_BUILD_APP)
target_compile_options(isle PRIVATE "/MT$<$<CONFIG:Debug>:d>")
target_link_options(isle PRIVATE "/OPT:REF") target_link_options(isle PRIVATE "/OPT:REF")
set_property(TARGET isle ${lego1_targets} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif() endif()
# Equivalent to target_compile_options(... PRIVATE "/MT$<$<CONFIG:Debug>:d>") # Equivalent to target_compile_options(... PRIVATE "/MT$<$<CONFIG:Debug>:d>")
set_property(TARGET lego1 ${lego1_targets} PROPERTY MSVC_RUNTIME_LIBRARY MultiThreaded$<$<CONFIG:Debug>:Debug>) set_property(TARGET lego1 ${lego1_targets} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
set(CMAKE_CXX_FLAGS "/W3 /GX /D \"WIN32\" /D \"_WINDOWS\"") set(CMAKE_CXX_FLAGS "/W3 /GX /D \"WIN32\" /D \"_WINDOWS\"")
set(CMAKE_CXX_FLAGS_DEBUG "/Gm /Zi /Od /D \"_DEBUG\"") 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. # 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) if (CMAKE_CXX_COMPILER_ID VERSION_LESS 12)
foreach(tgt IN LISTS lego1_targets) foreach(tgt IN LISTS lego1_targets)
set_property(GLOBAL APPEND PROPERTY JOB_POOLS "msvc_${tgt}=1;msvc_lego1=1") 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_COMPILE "msvc_${tgt}")
set_property(TARGET ${tgt} PROPERTY JOB_POOL_LINK msvc_${tgt}) set_property(TARGET ${tgt} PROPERTY JOB_POOL_LINK "msvc_${tgt}")
endforeach() endforeach()
if (TARGET isle) if (TARGET isle)
set_property(GLOBAL APPEND PROPERTY JOB_POOLS "msvc_isle=1") 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_COMPILE "msvc_isle")
set_property(TARGET isle PROPERTY JOB_POOL_LINK 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() endif()
endif() endif()