Skip to content

Commit

Permalink
- newer cmake treat runtime flags differently
Browse files Browse the repository at this point in the history
  • Loading branch information
fbergmann committed Feb 5, 2024
1 parent 8d7165b commit 4e56a3f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/raptor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ if(MSVC OR USING_INTEL)
set(BUILD_DEFINITIONS "${BUILD_DEFINITIONS} -D_CRT_SECURE_NO_WARNINGS")
option(WITH_STATIC_RUNTIME "Compile using the static MSVC Runtime." OFF)
if(WITH_STATIC_RUNTIME)
if(CMAKE_VERSION VERSION_LESS 3.15.0)
foreach(flag_var
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO
Expand All @@ -66,7 +67,12 @@ if(MSVC OR USING_INTEL)
string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
endif(${flag_var} MATCHES "/MD")
endforeach(flag_var)
add_definitions( -D_MT)
else()
# Set MSVC runtime to MultiThreaded (/MT)
cmake_policy(SET CMP0091 NEW)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif()
add_definitions( -D_MT)
endif(WITH_STATIC_RUNTIME)
endif(MSVC OR USING_INTEL)

Expand Down

0 comments on commit 4e56a3f

Please sign in to comment.