cmake: make MSVC static build optional

This commit is contained in:
Marc-André Moreau 2012-08-29 16:20:46 -04:00
parent f8f1cddacf
commit 0d5867b95c
2 changed files with 2 additions and 1 deletions

View File

@ -97,7 +97,7 @@ endif()
# This forces the MSVC runtime to be statically linked
if(MSVC)
if(WITH_MSVC_STATIC)
foreach(flag_var CMAKE_C_FLAGS_DEBUG CMAKE_CXX_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELEASE CMAKE_C_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO CMAKE_CXX_FLAGS_RELWITHDEBINFO)
string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
string(REGEX REPLACE "/MDd" "/MTd" ${flag_var} "${${flag_var}}")

View File

@ -12,6 +12,7 @@ endif()
if(MSVC)
option(WITH_NATIVE_SSPI "Use native SSPI modules" ON)
option(WITH_MSVC_STATIC "Use static MSVC runtime" OFF)
endif()
if(${CMAKE_VERSION} VERSION_GREATER 2.8.8)