Statically link MSVC runtime

This commit is contained in:
Martin Natano
2022-06-03 19:47:45 +02:00
parent 4de9bd7c7f
commit 7b9a799cdb
7 changed files with 6 additions and 40 deletions
-32
View File
@@ -66,35 +66,3 @@ macro(check_compile_features
endif()
endif()
endmacro()
# Borrowed from http://stackoverflow.com/q/10113017
macro(configure_msvc_runtime)
if(MSVC)
# Get the compiler options generally used.
list(APPEND COMPILER_VARIABLES
CMAKE_C_FLAGS_DEBUG
CMAKE_C_FLAGS_MINSIZEREL
CMAKE_C_FLAGS_RELEASE
CMAKE_C_FLAGS_RELWITHDEBINFO
CMAKE_CXX_FLAGS_DEBUG
CMAKE_CXX_FLAGS_MINSIZEREL
CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_RELWITHDEBINFO)
if(WITH_STATIC_LINKING)
set(TO_REPLACE "/MD")
set(REPLACE_WITH "/MT")
else()
set(TO_REPLACE "/MT")
set(REPLACE_WITH "/MD")
endif()
foreach(COMPILER_VARIABLE ${COMPILER_VARIABLES})
if(${COMPILER_VARIABLE} MATCHES "${TO_REPLACE}")
string(REGEX
REPLACE "${TO_REPLACE}"
"${REPLACE_WITH}"
${COMPILER_VARIABLE}
"${${COMPILER_VARIABLE}}")
endif()
endforeach()
endif()
endmacro()
-2
View File
@@ -41,8 +41,6 @@ else()
WITH_TEXTURE_GENERATOR
"Build with the Texture Font Generator. Ensure the MFC library is installed."
OFF)
# Turn this option off to use dynamic linking instead of static linking.
option(WITH_STATIC_LINKING "Build StepMania with static linking." ON)
endif()
if(WIN32)