From b3ef46d986b0fad8a6c883b5314075dd91d711b0 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Wed, 12 Sep 2018 07:49:13 -0700 Subject: [PATCH] cmake: Make static VC runtime libraries consistent Makes Visual C runtime libraries consistent across Debug/MinSizeRel/Release/RelWithDebInfo, rather than just changing those flags for RelWithDebInfo. Also adds /Zl for statically linked libraries. Closes obsproject/obs-studio#1421 --- UI/win-update/updater/CMakeLists.txt | 2 +- deps/blake2/CMakeLists.txt | 2 +- deps/ipc-util/CMakeLists.txt | 2 +- deps/lzma/CMakeLists.txt | 2 +- plugins/win-capture/get-graphics-offsets/CMakeLists.txt | 2 +- plugins/win-capture/graphics-hook/CMakeLists.txt | 2 +- plugins/win-capture/inject-helper/CMakeLists.txt | 2 +- plugins/win-ivcam/seg_service/CMakeLists.txt | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/UI/win-update/updater/CMakeLists.txt b/UI/win-update/updater/CMakeLists.txt index 65b8a1c80..917144d1d 100644 --- a/UI/win-update/updater/CMakeLists.txt +++ b/UI/win-update/updater/CMakeLists.txt @@ -32,7 +32,7 @@ set(updater_SOURCES add_definitions(-DNOMINMAX -DUNICODE -D_UNICODE) if(MSVC) - add_compile_options("$<$:/MT>") + add_compile_options($,/MTd,/MT>) endif() add_executable(updater WIN32 diff --git a/deps/blake2/CMakeLists.txt b/deps/blake2/CMakeLists.txt index 43092d744..f73ead78c 100644 --- a/deps/blake2/CMakeLists.txt +++ b/deps/blake2/CMakeLists.txt @@ -13,7 +13,7 @@ include_directories( if(WIN32) if(MSVC) - add_compile_options("$<$:/MT>") + add_compile_options($,/MTd,/MT> /Zl) endif() add_definitions( -Dinline=_inline diff --git a/deps/ipc-util/CMakeLists.txt b/deps/ipc-util/CMakeLists.txt index 8b2e672a3..ac6103957 100644 --- a/deps/ipc-util/CMakeLists.txt +++ b/deps/ipc-util/CMakeLists.txt @@ -23,7 +23,7 @@ else() endif() if(MSVC) - add_compile_options("$<$:/MT>") + add_compile_options($,/MTd,/MT> /Zl) endif() add_library(ipc-util STATIC diff --git a/deps/lzma/CMakeLists.txt b/deps/lzma/CMakeLists.txt index cb84fe7f9..6908cd23e 100644 --- a/deps/lzma/CMakeLists.txt +++ b/deps/lzma/CMakeLists.txt @@ -30,7 +30,7 @@ add_definitions( if(WIN32) if(MSVC) - add_compile_options("$<$:/MT>") + add_compile_options($,/MTd,/MT> /Zl) add_compile_options("/wd4244") add_compile_options("/wd4267") endif() diff --git a/plugins/win-capture/get-graphics-offsets/CMakeLists.txt b/plugins/win-capture/get-graphics-offsets/CMakeLists.txt index 3092b6dd8..558940711 100644 --- a/plugins/win-capture/get-graphics-offsets/CMakeLists.txt +++ b/plugins/win-capture/get-graphics-offsets/CMakeLists.txt @@ -12,7 +12,7 @@ set(get-graphics-offsets_SOURCES d3d9-offsets.cpp) if(MSVC) - add_compile_options("$<$:/MT>") + add_compile_options($,/MTd,/MT>) endif() add_executable(get-graphics-offsets diff --git a/plugins/win-capture/graphics-hook/CMakeLists.txt b/plugins/win-capture/graphics-hook/CMakeLists.txt index 750f87d90..f8bf6309f 100644 --- a/plugins/win-capture/graphics-hook/CMakeLists.txt +++ b/plugins/win-capture/graphics-hook/CMakeLists.txt @@ -30,7 +30,7 @@ set(graphics-hook_SOURCES d3d12-capture.cpp) if(MSVC) - add_compile_options("$<$:/MT>") + add_compile_options("$,/MTd,/MT>") endif() add_library(graphics-hook MODULE diff --git a/plugins/win-capture/inject-helper/CMakeLists.txt b/plugins/win-capture/inject-helper/CMakeLists.txt index 775415fac..5213e177a 100644 --- a/plugins/win-capture/inject-helper/CMakeLists.txt +++ b/plugins/win-capture/inject-helper/CMakeLists.txt @@ -10,7 +10,7 @@ set(inject-helper_SOURCES inject-helper.c) if(MSVC) - add_compile_options("$<$:/MT>") + add_compile_options($,/MTd,/MT>) endif() add_executable(inject-helper diff --git a/plugins/win-ivcam/seg_service/CMakeLists.txt b/plugins/win-ivcam/seg_service/CMakeLists.txt index f7d89e8b1..f74763983 100644 --- a/plugins/win-ivcam/seg_service/CMakeLists.txt +++ b/plugins/win-ivcam/seg_service/CMakeLists.txt @@ -33,7 +33,7 @@ set(seg_service_SOURCES ) if(MSVC) - add_compile_options("$<$:/MT>") + add_compile_options($,/MTd,/MT>) endif() add_executable(seg_service WIN32