From d504c22284d55a8cfd7323973f302dfa2bf93565 Mon Sep 17 00:00:00 2001 From: OpenSauce04 Date: Tue, 19 Nov 2024 16:41:20 +0000 Subject: [PATCH] Added `USE_STATIC_MSVC_RUNTIME` cmake option --- CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dd03d04..cdb65d1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,8 +13,10 @@ option(BUILD_TOOLS "Build tools" ON) option(BUNDLE_SPEEX "Bundle the speex library" OFF) option(LAZY_LOAD_LIBS "Lazily load shared libraries" ON) option(USE_SANITIZERS "Use sanitizers" ON) -# Set debugging for runtime libraries if requested. -set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") +option(USE_STATIC_MSVC_RUNTIME "Use /MT instead of /MD in MSVC" OFF) +if(USE_STATIC_MSVC_RUNTIME) + set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") +endif() if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING