mirror of
https://github.com/davisking/dlib.git
synced 2024-11-01 10:14:53 +08:00
Add an option to force static runtime (#1847)
* dos2unix tell_visual_studio_to_use_static_runtime.cmake * Add an option to force static runtime
This commit is contained in:
parent
e89e28b94e
commit
2e5cf2e8e4
@ -8,6 +8,8 @@ if (POLICY CMP0054)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (MSVC OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
if (MSVC OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
||||||
|
option (DLIB_FORCE_MSVC_STATIC_RUNTIME "use static runtime" ON)
|
||||||
|
if (DLIB_FORCE_MSVC_STATIC_RUNTIME)
|
||||||
foreach(flag_var
|
foreach(flag_var
|
||||||
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
|
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
|
||||||
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
|
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
|
||||||
@ -15,5 +17,6 @@ if (MSVC OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
|||||||
string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
|
string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
|
||||||
endif()
|
endif()
|
||||||
endforeach(flag_var)
|
endforeach(flag_var)
|
||||||
|
endif ()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user