From 2f305cb550f3384b14a234ca6b0f46ef99a4072e Mon Sep 17 00:00:00 2001 From: jp9000 Date: Wed, 23 Nov 2016 05:55:25 -0800 Subject: [PATCH] win-capture: Use static runtimes for hooks/helpers (Note: This commit also modifies the ipc-util/seg-service modules) When compiling the final project, always compile ipc-util/get-graphics-offsets/graphics-hook/inject-helper/seg-service with static MSVC runtimes to prevent the need of requiring the MSVC runtimes for both architectures. --- deps/ipc-util/CMakeLists.txt | 4 ++++ plugins/win-capture/get-graphics-offsets/CMakeLists.txt | 4 ++++ plugins/win-capture/graphics-hook/CMakeLists.txt | 4 ++++ plugins/win-capture/inject-helper/CMakeLists.txt | 4 ++++ plugins/win-ivcam/seg_service/CMakeLists.txt | 4 ++++ 5 files changed, 20 insertions(+) diff --git a/deps/ipc-util/CMakeLists.txt b/deps/ipc-util/CMakeLists.txt index 917311d11..8b2e672a3 100644 --- a/deps/ipc-util/CMakeLists.txt +++ b/deps/ipc-util/CMakeLists.txt @@ -22,6 +22,10 @@ else() ipc-util/pipe-posix.c) endif() +if(MSVC) + add_compile_options("$<$:/MT>") +endif() + add_library(ipc-util STATIC ${ipc-util_SOURCES} ${ipc-util_HEADERS}) diff --git a/plugins/win-capture/get-graphics-offsets/CMakeLists.txt b/plugins/win-capture/get-graphics-offsets/CMakeLists.txt index 277f501fe..3092b6dd8 100644 --- a/plugins/win-capture/get-graphics-offsets/CMakeLists.txt +++ b/plugins/win-capture/get-graphics-offsets/CMakeLists.txt @@ -11,6 +11,10 @@ set(get-graphics-offsets_SOURCES d3d8-offsets.cpp d3d9-offsets.cpp) +if(MSVC) + add_compile_options("$<$:/MT>") +endif() + add_executable(get-graphics-offsets ${get-graphics-offsets_SOURCES} ${get-graphics-offsets_HEADERS}) diff --git a/plugins/win-capture/graphics-hook/CMakeLists.txt b/plugins/win-capture/graphics-hook/CMakeLists.txt index a302149ef..750f87d90 100644 --- a/plugins/win-capture/graphics-hook/CMakeLists.txt +++ b/plugins/win-capture/graphics-hook/CMakeLists.txt @@ -29,6 +29,10 @@ set(graphics-hook_SOURCES d3d11-capture.cpp d3d12-capture.cpp) +if(MSVC) + add_compile_options("$<$:/MT>") +endif() + add_library(graphics-hook MODULE ${graphics-hook_SOURCES} ${graphics-hook_HEADERS}) diff --git a/plugins/win-capture/inject-helper/CMakeLists.txt b/plugins/win-capture/inject-helper/CMakeLists.txt index 8c08c5e0a..775415fac 100644 --- a/plugins/win-capture/inject-helper/CMakeLists.txt +++ b/plugins/win-capture/inject-helper/CMakeLists.txt @@ -9,6 +9,10 @@ set(inject-helper_SOURCES ../obfuscate.c inject-helper.c) +if(MSVC) + add_compile_options("$<$:/MT>") +endif() + add_executable(inject-helper ${inject-helper_SOURCES}) diff --git a/plugins/win-ivcam/seg_service/CMakeLists.txt b/plugins/win-ivcam/seg_service/CMakeLists.txt index 0573efc8b..49f10c447 100644 --- a/plugins/win-ivcam/seg_service/CMakeLists.txt +++ b/plugins/win-ivcam/seg_service/CMakeLists.txt @@ -33,6 +33,10 @@ set(seg_service_SOURCES ${seg_service_GENERATED_FILES} ) +if(MSVC) + add_compile_options("$<$:/MT>") +endif() + add_executable(seg_service WIN32 ${seg_service_SOURCES} ${seg_service_HEADERS})