aboutsummaryrefslogtreecommitdiff
path: root/scripts/buildsystems
diff options
context:
space:
mode:
authorJackBoosY <yuzaiyang@beyondsoft.com>2020-01-13 23:55:59 -0800
committerJackBoosY <yuzaiyang@beyondsoft.com>2020-01-13 23:55:59 -0800
commit2514481b42ebdeec28649582fc666955cf206c84 (patch)
tree60c9809a5c3c8adbad240a40b1088a6f8e42c019 /scripts/buildsystems
parentb751326c91c9a307aaf5e340b61ab9f2d1ad45a4 (diff)
parent28eee51adb36f2165be846e77ef7b3ee5b3f8789 (diff)
downloadvcpkg-2514481b42ebdeec28649582fc666955cf206c84.tar.gz
vcpkg-2514481b42ebdeec28649582fc666955cf206c84.zip
Merge branch 'master' of https://github.com/Microsoft/vcpkg into dev/jack/upgrade_libi
Diffstat (limited to 'scripts/buildsystems')
-rw-r--r--scripts/buildsystems/vcpkg.cmake24
1 files changed, 23 insertions, 1 deletions
diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake
index ed9bcbc69..e549f3fa1 100644
--- a/scripts/buildsystems/vcpkg.cmake
+++ b/scripts/buildsystems/vcpkg.cmake
@@ -1,6 +1,10 @@
# Mark variables as used so cmake doesn't complain about them
mark_as_advanced(CMAKE_TOOLCHAIN_FILE)
+# VCPKG toolchain options.
+option(VCPKG_VERBOSE "Enables messages from the VCPKG toolchain for debugging purposes." OFF)
+mark_as_advanced(VCPKG_VERBOSE)
+
# Determine whether the toolchain is loaded during a try-compile configuration
get_property(_CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE)
@@ -22,6 +26,24 @@ if(VCPKG_TOOLCHAIN)
return()
endif()
+if(DEFINED CMAKE_CONFIGURATION_TYPES) #Generating with a multi config generator
+ #If CMake does not have a mapping for MinSizeRel and RelWithDebInfo in imported targets
+ #it will map those configuration to the first valid configuration in CMAKE_CONFIGURATION_TYPES.
+ #By default this is the debug configuration which is wrong.
+ if(NOT DEFINED CMAKE_MAP_IMPORTED_CONFIG_MINSIZEREL)
+ set(CMAKE_MAP_IMPORTED_CONFIG_MINSIZEREL "MinSizeRel;Release;")
+ if(VCPKG_VERBOSE)
+ message(STATUS "VCPKG-Info: CMAKE_MAP_IMPORTED_CONFIG_MINSIZEREL set to MinSizeRel;Release;")
+ endif()
+ endif()
+ if(NOT DEFINED CMAKE_MAP_IMPORTED_CONFIG_RELWITHDEBINFO)
+ set(CMAKE_MAP_IMPORTED_CONFIG_RELWITHDEBINFO "RelWithDebInfo;Release;")
+ if(VCPKG_VERBOSE)
+ message(STATUS "VCPKG-Info: CMAKE_MAP_IMPORTED_CONFIG_RELWITHDEBINFO set to RelWithDebInfo;Release;")
+ endif()
+ endif()
+endif()
+
if(VCPKG_TARGET_TRIPLET)
elseif(CMAKE_GENERATOR_PLATFORM MATCHES "^[Ww][Ii][Nn]32$")
set(_VCPKG_TARGET_TRIPLET_ARCH x86)
@@ -283,7 +305,7 @@ if(NOT _CMAKE_IN_TRY_COMPILE)
"set(_VCPKG_ROOT_DIR \"${_root_dir}\" CACHE STRING \"\")\n"
)
else()
- set(CMAKE_TRY_COMPILE_PLATFORM_VARIABLES
+ list(APPEND CMAKE_TRY_COMPILE_PLATFORM_VARIABLES
VCPKG_TARGET_TRIPLET
VCPKG_APPLOCAL_DEPS
VCPKG_CHAINLOAD_TOOLCHAIN_FILE