diff --git a/CMakeLists.txt b/CMakeLists.txt index 4a991b0b6..2c168072e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,24 +36,12 @@ list(APPEND obs-browser_LIBRARIES ${CEF_LIBRARIES}) if(MSVC) - string(REPLACE "/MD" "/MT" - "CMAKE_C_FLAGS" - "${CMAKE_C_FLAGS}") - - string(REPLACE "/MD" "/MT" - "CMAKE_CXX_FLAGS" - "${CMAKE_CXX_FLAGS}") - - string(TOUPPER "${CMAKE_CONFIGURATION_TYPES}" UPPER_CONFIG_TYPES) - foreach(CONFIG_TYPE ${UPPER_CONFIG_TYPES}) - string(REPLACE "/MD" "/MT" - "CMAKE_C_FLAGS_${CONFIG_TYPE}" - "${CMAKE_C_FLAGS_${CONFIG_TYPE}}") - - string(REPLACE "/MD" "/MT" - "CMAKE_CXX_FLAGS_${CONFIG_TYPE}" - "${CMAKE_CXX_FLAGS_${CONFIG_TYPE}}") - endforeach() + option(BROWSER_USE_STATIC_CRT "Use static CRT" ON) + + if(BROWSER_USE_STATIC_CRT) + add_compile_options($,/MTd,/MT>) + endif() + list(APPEND obs-browser_LIBRARIES d3d11 dxgi