mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-07-08 13:29:42 +01:00
Fix: [CMake] Use the right run-time library depending on vcpkg triplet (#8964)
This commit is contained in:
parent
5cbbb0d17b
commit
5c6b43832c
@ -4,6 +4,7 @@
|
||||
#
|
||||
macro(compile_flags)
|
||||
if(MSVC)
|
||||
if(VCPKG_TARGET_TRIPLET MATCHES "-static" AND NOT VCPKG_TARGET_TRIPLET MATCHES "-md")
|
||||
# Switch to MT (static) instead of MD (dynamic) binary
|
||||
|
||||
# For MSVC two generators are available
|
||||
@ -18,6 +19,7 @@ macro(compile_flags)
|
||||
string(TOUPPER "CMAKE_CXX_FLAGS_${MSVC_CONFIG}" MSVC_FLAGS)
|
||||
string(REPLACE "/MD" "/MT" ${MSVC_FLAGS} "${${MSVC_FLAGS}}")
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
# "If /Zc:rvalueCast is specified, the compiler follows section 5.4 of the
|
||||
# C++11 standard". We need C++11 for the way we use threads.
|
||||
|
Loading…
Reference in New Issue
Block a user