File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed
Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,20 @@ if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/.git")
2525 endif ()
2626endif ()
2727
28+ if (VCPKG_TARGET_TRIPLET)
29+ message (STATUS "Using ${VCPKG_TARGET_TRIPLET} triplet with vcpkg" )
30+ if (MSVC )
31+ # Match the MSVC runtime if we're using VCPKG with static libraries.
32+ cmake_policy (SET CMP0091 NEW)
33+ if (VCPKG_TARGET_TRIPLET MATCHES [[^.+-static$]])
34+ set (CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>" )
35+ else ()
36+ set (CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL" )
37+ endif ()
38+ message (STATUS "Using ${CMAKE_MSVC_RUNTIME_LIBRARY} to match ${VCPKG_TARGET_TRIPLET} " )
39+ endif ()
40+ endif ()
41+
2842project (cppgraphqlgen VERSION ${LATEST_VERSION} )
2943
3044set (CMAKE_CXX_STANDARD 17)
@@ -36,11 +50,6 @@ set(GRAPHQL_INSTALL_CONFIGURATIONS ${CMAKE_CONFIGURATION_TYPES} CACHE STRING "Co
3650
3751option (BUILD_SHARED_LIBS "Build shared libraries instead of static libs" OFF )
3852
39- # Match the MSVC runtime if we're using VCPKG with static libraries.
40- if (MSVC AND VCPKG_TARGET_TRIPLET MATCHES ".*-static$" )
41- set (CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>" )
42- endif ()
43-
4453function (add_bigobj_flag target )
4554 if (MSVC )
4655 # MSVC requires the /bigobj flag if the number of sections gets too big.
You can’t perform that action at this time.
0 commit comments