From c66737ec3fff4d1da9185095c4df1bea43704d9d Mon Sep 17 00:00:00 2001 From: Zopolis4 Date: Wed, 7 Sep 2022 14:30:36 +1000 Subject: [PATCH] Replace MSVC_RUNTIME_LIBRARY generator expression with a compile option --- CMakeLists.txt | 6 +++++- src/CMakeLists.txt | 2 -- src/Cafe/CMakeLists.txt | 2 -- src/Cemu/CMakeLists.txt | 2 -- src/Common/CMakeLists.txt | 2 -- src/asm/CMakeLists.txt | 2 -- src/audio/CMakeLists.txt | 2 -- src/config/CMakeLists.txt | 2 -- src/gui/CMakeLists.txt | 2 -- src/imgui/CMakeLists.txt | 2 -- src/input/CMakeLists.txt | 2 -- src/resource/CMakeLists.txt | 2 -- src/util/CMakeLists.txt | 2 -- 13 files changed, 5 insertions(+), 25 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e9f7458e..f29ceb45 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,6 +40,11 @@ if (MSVC) set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT CemuBin) # floating point model: precise, fiber safe optimizations add_compile_options(/EHsc /fp:precise) + if (CMAKE_BUILD_TYPE STREQUAL "Debug") + add_compile_options(/MTd) + else() + add_compile_options(/MT) + endif() if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") # Speeds up static linking (especially helpful in incremental compilation) if((CMAKE_LINKER MATCHES ".*lld-link.*") AND (CMAKE_AR MATCHES ".*llvm-lib.*")) @@ -127,7 +132,6 @@ if (ENABLE_CUBEB) option(BUNDLE_SPEEX "" OFF) set(USE_WINMM OFF CACHE BOOL "") add_subdirectory("dependencies/cubeb" EXCLUDE_FROM_ALL) - set_property(TARGET cubeb PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") add_library(cubeb::cubeb ALIAS cubeb) endif() add_compile_definitions("HAS_CUBEB=1") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d3bf8aec..3e5e6105 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -72,8 +72,6 @@ if(WIN32) ) endif() -set_property(TARGET CemuBin PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") - set_target_properties(CemuBin PROPERTIES # multi-configuration generators will add a config subdirectory to RUNTIME_OUTPUT_DIRECTORY if no generator expression is used # to get the same behavior everywhere we append an empty generator expression diff --git a/src/Cafe/CMakeLists.txt b/src/Cafe/CMakeLists.txt index c012f18a..643d54d3 100644 --- a/src/Cafe/CMakeLists.txt +++ b/src/Cafe/CMakeLists.txt @@ -10,8 +10,6 @@ else() add_library(CemuCafe ${CPP_FILES} ${H_FILES}) endif() -set_property(TARGET CemuCafe PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") - target_include_directories(CemuCafe PUBLIC "../") target_link_libraries(CemuCafe PRIVATE diff --git a/src/Cemu/CMakeLists.txt b/src/Cemu/CMakeLists.txt index df0ff1d1..4ffc2c03 100644 --- a/src/Cemu/CMakeLists.txt +++ b/src/Cemu/CMakeLists.txt @@ -4,8 +4,6 @@ file(GLOB_RECURSE CPP_FILES *.cpp) file(GLOB_RECURSE H_FILES *.h) add_library(CemuComponents ${CPP_FILES} ${H_FILES}) -set_property(TARGET CemuComponents PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") - target_include_directories(CemuComponents PUBLIC "../") target_link_libraries(CemuComponents PRIVATE diff --git a/src/Common/CMakeLists.txt b/src/Common/CMakeLists.txt index 3634527d..992f4f0f 100644 --- a/src/Common/CMakeLists.txt +++ b/src/Common/CMakeLists.txt @@ -4,8 +4,6 @@ file(GLOB CPP_FILES *.cpp) file(GLOB H_FILES *.h) add_library(CemuCommon ${CPP_FILES} ${H_FILES}) -set_property(TARGET CemuCommon PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") - if(WIN32) target_sources(CemuCommon PRIVATE windows/platform.cpp diff --git a/src/asm/CMakeLists.txt b/src/asm/CMakeLists.txt index ff7f2ab4..86125df7 100644 --- a/src/asm/CMakeLists.txt +++ b/src/asm/CMakeLists.txt @@ -35,5 +35,3 @@ else() set_target_properties(CemuAsm PROPERTIES LINKER_LANGUAGE C) endif() - -set_property(TARGET CemuAsm PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") diff --git a/src/audio/CMakeLists.txt b/src/audio/CMakeLists.txt index d27273e6..b705bda6 100644 --- a/src/audio/CMakeLists.txt +++ b/src/audio/CMakeLists.txt @@ -5,8 +5,6 @@ add_library(CemuAudio IAudioAPI.h ) -set_property(TARGET CemuAudio PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") - # move these to UI folder target_sources(CemuAudio PRIVATE audioDebuggerWindow.cpp diff --git a/src/config/CMakeLists.txt b/src/config/CMakeLists.txt index 58008e46..38a62c36 100644 --- a/src/config/CMakeLists.txt +++ b/src/config/CMakeLists.txt @@ -4,8 +4,6 @@ file(GLOB CPP_FILES *.cpp) file(GLOB H_FILES *.h) add_library(CemuConfig ${CPP_FILES} ${H_FILES}) -set_property(TARGET CemuConfig PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") - target_include_directories(CemuConfig PUBLIC "../") target_link_libraries(CemuConfig PRIVATE diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index b63135f9..9061aa7c 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -4,8 +4,6 @@ file(GLOB_RECURSE CPP_FILES *.cpp) file(GLOB_RECURSE H_FILES *.h) add_library(CemuGui ${CPP_FILES} ${H_FILES}) -set_property(TARGET CemuGui PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") - target_sources(CemuGui PRIVATE wxcomponents/checkedlistctrl.cpp wxcomponents/checkedlistctrl.h diff --git a/src/imgui/CMakeLists.txt b/src/imgui/CMakeLists.txt index 412330ec..dce97442 100644 --- a/src/imgui/CMakeLists.txt +++ b/src/imgui/CMakeLists.txt @@ -2,8 +2,6 @@ project(imguiImpl) add_library(imguiImpl) -set_property(TARGET imguiImpl PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") - target_sources(imguiImpl PRIVATE imgui_impl_opengl3.cpp imgui_impl_opengl3.h diff --git a/src/input/CMakeLists.txt b/src/input/CMakeLists.txt index 47609385..bd5b8342 100644 --- a/src/input/CMakeLists.txt +++ b/src/input/CMakeLists.txt @@ -25,8 +25,6 @@ add_library(CemuInput emulated/ClassicController.h ) -set_property(TARGET CemuInput PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") - # SDL target_sources(CemuInput PRIVATE api/SDL/SDLController.cpp diff --git a/src/resource/CMakeLists.txt b/src/resource/CMakeLists.txt index 24eb7f4e..6159d50e 100644 --- a/src/resource/CMakeLists.txt +++ b/src/resource/CMakeLists.txt @@ -1,7 +1,5 @@ add_library(CemuResource) -set_property(TARGET CemuResource PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") - # icon resources if(UNIX) target_sources(CemuResource PRIVATE diff --git a/src/util/CMakeLists.txt b/src/util/CMakeLists.txt index 090b2bd1..e75b9f00 100644 --- a/src/util/CMakeLists.txt +++ b/src/util/CMakeLists.txt @@ -5,8 +5,6 @@ file(GLOB_RECURSE H_FILES *.h) add_library(CemuUtil ${CPP_FILES} ${H_FILES}) -set_property(TARGET CemuUtil PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") - target_include_directories(CemuUtil PUBLIC "../") target_link_libraries(CemuUtil PRIVATE