Change CMakeLists to honor option "MSVC shared Runtimes" (#867)

This commit is contained in:
Hans-Peter Gygax
2020-05-24 19:55:52 +02:00
committed by GitHub
parent f05b2577ad
commit cb7bb9821d

View File

@@ -34,10 +34,11 @@ endif()
set(build-shared $<BOOL:${YAML_BUILD_SHARED_LIBS}>) set(build-shared $<BOOL:${YAML_BUILD_SHARED_LIBS}>)
set(build-windows-dll $<AND:$<BOOL:${CMAKE_HOST_WIN32}>,${build-shared}>) set(build-windows-dll $<AND:$<BOOL:${CMAKE_HOST_WIN32}>,${build-shared}>)
set(not-msvc $<NOT:$<CXX_COMPILER_ID:MSVC>>) set(not-msvc $<NOT:$<CXX_COMPILER_ID:MSVC>>)
set(msvc-shared_rt $<BOOL:${YAML_MSVC_SHARED_RT}>)
if (NOT DEFINED CMAKE_MSVC_RUNTIME_LIBRARY) if (NOT DEFINED CMAKE_MSVC_RUNTIME_LIBRARY)
set(CMAKE_MSVC_RUNTIME_LIBRARY set(CMAKE_MSVC_RUNTIME_LIBRARY
MultiThreaded$<$<CONFIG:Debug>:Debug>$<${build-shared}:DLL>) MultiThreaded$<$<CONFIG:Debug>:Debug>$<${msvc-shared_rt}:DLL>)
endif() endif()
set(contrib-pattern "src/contrib/*.cpp") set(contrib-pattern "src/contrib/*.cpp")
@@ -108,7 +109,7 @@ target_sources(yaml-cpp
PRIVATE PRIVATE
$<$<BOOL:${YAML_CPP_BUILD_CONTRIB}>:${yaml-cpp-contrib-sources}> $<$<BOOL:${YAML_CPP_BUILD_CONTRIB}>:${yaml-cpp-contrib-sources}>
${yaml-cpp-sources}) ${yaml-cpp-sources})
if (NOT DEFINED CMAKE_DEBUG_POSTFIX) if (NOT DEFINED CMAKE_DEBUG_POSTFIX)
set(CMAKE_DEBUG_POSTFIX "d") set(CMAKE_DEBUG_POSTFIX "d")
endif() endif()