mirror of
https://github.com/etlegacy/etlegacy-libs.git
synced 2024-11-14 00:20:49 +00:00
20 lines
646 B
Text
20 lines
646 B
Text
#MSVC patch
|
|
option(LEGACY_MSVC_STATIC "Build with static MSVC runtime" ON)
|
|
if(MSVC AND LEGACY_MSVC_STATIC)
|
|
message(STATUS "Patching MSVC build for static linking")
|
|
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /EHsc /O2")
|
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /EHa /W3")
|
|
|
|
set(CompilerFlags
|
|
CMAKE_CXX_FLAGS
|
|
CMAKE_CXX_FLAGS_DEBUG
|
|
CMAKE_CXX_FLAGS_RELEASE
|
|
CMAKE_C_FLAGS
|
|
CMAKE_C_FLAGS_DEBUG
|
|
CMAKE_C_FLAGS_RELEASE
|
|
)
|
|
|
|
foreach(CompilerFlag ${CompilerFlags})
|
|
string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}")
|
|
endforeach()
|
|
endif()
|