Skip to content

Commit

Permalink
vcpkg bugfix /MT vs /MD
Browse files Browse the repository at this point in the history
  • Loading branch information
silverqx committed Jul 5, 2024
1 parent 8c0ea8d commit 3ab6c8e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ when the build type is equal" OFF
feature_option_dependent(MSVC_RUNTIME_DYNAMIC
"Use MSVC dynamic runtime library (-MD) instead of static (-MT), also considers \
a Debug configuration (-MTd, -MDd)" ON
"MSVC AND (NOT TINY_VCPKG OR NOT DEFINED CMAKE_MSVC_RUNTIME_LIBRARY)"
"MSVC AND NOT TINY_VCPKG AND NOT DEFINED VCPKG_CRT_LINKAGE AND \
NOT DEFINED CMAKE_MSVC_RUNTIME_LIBRARY"
MSVC_RUNTIME_DYNAMIC-NOTFOUND
)

Expand Down
5 changes: 4 additions & 1 deletion cmake/Modules/TinyInitDefaultVariables.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ DESTINATION is encountered.")
# strictly needed as on vcpkg the MSVC_RUNTIME_DYNAMIC isn't defined/used but with
# the TINY_VCPKG is clearly visible whats up.
# Also see the comment for the MSVC_RUNTIME_DYNAMIC option.
if(MSVC AND (NOT TINY_VCPKG OR DEFINED MSVC_RUNTIME_DYNAMIC))
if(MSVC AND NOT TINY_VCPKG AND NOT DEFINED VCPKG_CRT_LINKAGE AND
DEFINED MSVC_RUNTIME_DYNAMIC AND
NOT MSVC_RUNTIME_DYNAMIC STREQUAL "MSVC_RUNTIME_DYNAMIC-NOTFOUND"
)
if(MSVC_RUNTIME_DYNAMIC)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
else()
Expand Down

0 comments on commit 3ab6c8e

Please sign in to comment.