From 7792ecfe9e5fb70de0f1edb304ad3d0aba06446b Mon Sep 17 00:00:00 2001 From: Stepanov Igor Date: Wed, 25 Dec 2024 03:03:01 +0300 Subject: [PATCH] Fix msvc build --- CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9c543a0b..e73ed66c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,12 @@ set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) if (CMAKE_SYSTEM_NAME STREQUAL "Windows") - set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") + # We use two types linking: for clang build is static (vcpkg triplet x64-windows-static) + # and for msvc build is dynamic linking (vcpkg triplet x64-windows) + # By default CMAKE_MSVC_RUNTIME_LIBRARY set by MultiThreaded$<$:Debug>DLL + if (VCPKG_TARGET_TRIPLET MATCHES "static") + set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") + endif() endif() add_subdirectory(src)