aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorBarath Kannan <barathsotd@gmail.com>2018-01-17 19:00:43 +1100
committerBarath Kannan <barathsotd@gmail.com>2018-01-17 19:00:43 +1100
commitc30363d07b3f64b5f38531442ea92d9c1cf81d13 (patch)
tree8a169a2a0aadf40dad50e73d226c3eca1e949327 /scripts
parent47189e90d59459be69d4f6a0b039849913031c8e (diff)
parent28c5c6ae4601c323cbd57a13da03b9047dc282ad (diff)
downloadvcpkg-c30363d07b3f64b5f38531442ea92d9c1cf81d13.tar.gz
vcpkg-c30363d07b3f64b5f38531442ea92d9c1cf81d13.zip
Merge branch 'master' into qt5_modular
Diffstat (limited to 'scripts')
-rw-r--r--scripts/buildsystems/msbuild/vcpkg.targets15
-rw-r--r--scripts/buildsystems/vcpkg.cmake16
-rw-r--r--scripts/cmake/vcpkg_build_cmake.cmake105
-rw-r--r--scripts/cmake/vcpkg_configure_cmake.cmake37
-rw-r--r--scripts/cmake/vcpkg_download_distfile.cmake35
-rw-r--r--scripts/cmake/vcpkg_execute_required_process.cmake28
-rw-r--r--scripts/cmake/vcpkg_fixup_cmake_targets.cmake14
-rw-r--r--scripts/cmake/vcpkg_from_github.cmake9
-rw-r--r--scripts/fetchDependency.ps112
9 files changed, 189 insertions, 82 deletions
diff --git a/scripts/buildsystems/msbuild/vcpkg.targets b/scripts/buildsystems/msbuild/vcpkg.targets
index 092e013b5..499052e4d 100644
--- a/scripts/buildsystems/msbuild/vcpkg.targets
+++ b/scripts/buildsystems/msbuild/vcpkg.targets
@@ -24,6 +24,16 @@
<VcpkgTriplet Condition="'$(VcpkgTriplet)' == ''">x64-windows</VcpkgTriplet>
</PropertyGroup>
+ <PropertyGroup Condition="'$(Platform)|$(ApplicationType)|$(ApplicationTypeRevision)' == 'arm||'">
+ <VcpkgEnabled Condition="'$(VcpkgEnabled)' == ''">true</VcpkgEnabled>
+ <VcpkgTriplet Condition="'$(VcpkgTriplet)' == ''">arm-windows</VcpkgTriplet>
+ </PropertyGroup>
+
+ <PropertyGroup Condition="'$(Platform)|$(ApplicationType)|$(ApplicationTypeRevision)' == 'arm64||'">
+ <VcpkgEnabled Condition="'$(VcpkgEnabled)' == ''">true</VcpkgEnabled>
+ <VcpkgTriplet Condition="'$(VcpkgTriplet)' == ''">arm64-windows</VcpkgTriplet>
+ </PropertyGroup>
+
<PropertyGroup Condition="'$(Platform)|$(ApplicationType)|$(ApplicationTypeRevision)' == 'x64|Windows Store|10.0'">
<VcpkgEnabled Condition="'$(VcpkgEnabled)' == ''">true</VcpkgEnabled>
<VcpkgTriplet Condition="'$(VcpkgTriplet)' == ''">x64-uwp</VcpkgTriplet>
@@ -34,6 +44,11 @@
<VcpkgTriplet Condition="'$(VcpkgTriplet)' == ''">arm-uwp</VcpkgTriplet>
</PropertyGroup>
+ <PropertyGroup Condition="'$(Platform)|$(ApplicationType)|$(ApplicationTypeRevision)' == 'arm64|Windows Store|10.0'">
+ <VcpkgEnabled Condition="'$(VcpkgEnabled)' == ''">true</VcpkgEnabled>
+ <VcpkgTriplet Condition="'$(VcpkgTriplet)' == ''">arm64-uwp</VcpkgTriplet>
+ </PropertyGroup>
+
<PropertyGroup Condition="'$(VcpkgEnabled)' == 'true'">
<VcpkgConfiguration Condition="'$(VcpkgConfiguration)' == ''">$(Configuration)</VcpkgConfiguration>
<VcpkgNormalizedConfiguration Condition="$(VcpkgConfiguration.StartsWith('Debug'))">Debug</VcpkgNormalizedConfiguration>
diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake
index b8d3fbdbb..f157d3236 100644
--- a/scripts/buildsystems/vcpkg.cmake
+++ b/scripts/buildsystems/vcpkg.cmake
@@ -22,6 +22,8 @@ elseif(CMAKE_GENERATOR_PLATFORM MATCHES "^[Xx]64$")
set(_VCPKG_TARGET_TRIPLET_ARCH x64)
elseif(CMAKE_GENERATOR_PLATFORM MATCHES "^[Aa][Rr][Mm]$")
set(_VCPKG_TARGET_TRIPLET_ARCH arm)
+elseif(CMAKE_GENERATOR_PLATFORM MATCHES "^[Aa][Rr][Mm]64$")
+ set(_VCPKG_TARGET_TRIPLET_ARCH arm64)
else()
if(CMAKE_GENERATOR MATCHES "^Visual Studio 14 2015 Win64$")
set(_VCPKG_TARGET_TRIPLET_ARCH x64)
@@ -41,6 +43,8 @@ else()
set(_VCPKG_TARGET_TRIPLET_ARCH x64)
elseif(_VCPKG_CL MATCHES "arm/cl.exe$")
set(_VCPKG_TARGET_TRIPLET_ARCH arm)
+ elseif(_VCPKG_CL MATCHES "arm64/cl.exe$")
+ set(_VCPKG_TARGET_TRIPLET_ARCH arm64)
elseif(_VCPKG_CL MATCHES "bin/cl.exe$" OR _VCPKG_CL MATCHES "x86/cl.exe$")
set(_VCPKG_TARGET_TRIPLET_ARCH x86)
elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64")
@@ -105,6 +109,7 @@ if (NOT DEFINED CMAKE_SYSTEM_VERSION AND _VCPKG_TARGET_TRIPLET_PLAT MATCHES "win
vcpkg_get_windows_sdk(WINDOWS_SDK_VERSION)
unset(VCPKG_ROOT_DIR)
set(CMAKE_SYSTEM_VERSION ${WINDOWS_SDK_VERSION} CACHE STRING "Windows SDK version")
+ message(STATUS "Found Windows SDK ${WINDOWS_SDK_VERSION}")
endif()
file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _programfiles)
@@ -207,17 +212,6 @@ macro(find_package name)
add_library(tinyxml2 INTERFACE IMPORTED)
set_target_properties(tinyxml2 PROPERTIES INTERFACE_LINK_LIBRARIES "tinyxml2_static")
endif()
- elseif("${name}" STREQUAL "MPI")
- if(MPI_C_LIB_NAMES)
- set(MPI_C_WORKS TRUE)
- set(MPI_C_WRAPPER_FOUND TRUE)
- endif()
- if(MPI_CXX_LIB_NAMES)
- set(MPI_CXX_WORKS TRUE)
- set(MPI_CXX_WRAPPER_FOUND TRUE)
- set(MPI_CXX_VALIDATE_SKIP_MPICXX TRUE)
- endif()
- _find_package(${ARGV})
else()
_find_package(${ARGV})
endif()
diff --git a/scripts/cmake/vcpkg_build_cmake.cmake b/scripts/cmake/vcpkg_build_cmake.cmake
index 0b4bbd211..8bafee4d4 100644
--- a/scripts/cmake/vcpkg_build_cmake.cmake
+++ b/scripts/cmake/vcpkg_build_cmake.cmake
@@ -33,19 +33,18 @@ function(vcpkg_build_cmake)
set(_bc_LOGFILE_ROOT "build")
endif()
+ set(PARALLEL_ARG)
+ set(NO_PARALLEL_ARG)
+
if(_VCPKG_CMAKE_GENERATOR MATCHES "Ninja")
set(BUILD_ARGS "-v") # verbose output
- if (_bc_DISABLE_PARALLEL)
- list(APPEND BUILD_ARGS "-j1")
- endif()
+ set(NO_PARALLEL_ARG "-j1")
elseif(_VCPKG_CMAKE_GENERATOR MATCHES "Visual Studio")
set(BUILD_ARGS
"/p:VCPkgLocalAppDataDisabled=true"
"/p:UseIntelMKL=No"
)
- if (NOT _bc_DISABLE_PARALLEL)
- list(APPEND BUILD_ARGS "/m")
- endif()
+ set(PARALLEL_ARG "/m")
elseif(_VCPKG_CMAKE_GENERATOR MATCHES "NMake")
# No options are currently added for nmake builds
else()
@@ -58,23 +57,83 @@ function(vcpkg_build_cmake)
set(TARGET_PARAM)
endif()
- if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
- message(STATUS "Build ${TARGET_TRIPLET}-rel")
- vcpkg_execute_required_process(
- COMMAND ${CMAKE_COMMAND} --build . --config Release ${TARGET_PARAM} -- ${BUILD_ARGS}
- WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel
- LOGNAME ${_bc_LOGFILE_ROOT}-${TARGET_TRIPLET}-rel
- )
- message(STATUS "Build ${TARGET_TRIPLET}-rel done")
+ if(_bc_DISABLE_PARALLEL)
+ set(PARALLEL_ARG ${NO_PARALLEL_ARG})
endif()
- if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
- message(STATUS "Build ${TARGET_TRIPLET}-dbg")
- vcpkg_execute_required_process(
- COMMAND ${CMAKE_COMMAND} --build . --config Debug ${TARGET_PARAM} -- ${BUILD_ARGS}
- WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg
- LOGNAME ${_bc_LOGFILE_ROOT}-${TARGET_TRIPLET}-dbg
- )
- message(STATUS "Build ${TARGET_TRIPLET}-dbg done")
- endif()
+ foreach(BUILDTYPE "release" "debug")
+ if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL BUILDTYPE)
+ if(BUILDTYPE STREQUAL "debug")
+ set(SHORT_BUILDTYPE "dbg")
+ else()
+ set(SHORT_BUILDTYPE "rel")
+ endif()
+
+ message(STATUS "Build ${TARGET_TRIPLET}-${SHORT_BUILDTYPE}")
+ set(LOGPREFIX "${CURRENT_BUILDTREES_DIR}/${_bc_LOGFILE_ROOT}-${TARGET_TRIPLET}-${SHORT_BUILDTYPE}")
+ set(LOGS)
+
+ if(BUILDTYPE STREQUAL "release")
+ set(CONFIG "Release")
+ else()
+ set(CONFIG "Debug")
+ endif()
+
+ execute_process(
+ COMMAND ${CMAKE_COMMAND} --build . --config ${CONFIG} ${TARGET_PARAM} -- ${BUILD_ARGS} ${PARALLEL_ARG}
+ OUTPUT_FILE "${LOGPREFIX}-out.log"
+ ERROR_FILE "${LOGPREFIX}-err.log"
+ RESULT_VARIABLE error_code
+ WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${SHORT_BUILDTYPE})
+ if(error_code)
+ file(READ "${LOGPREFIX}-out.log" out_contents)
+ file(READ "${LOGPREFIX}-err.log" err_contents)
+
+ if(out_contents)
+ list(APPEND LOGS "${LOGPREFIX}-out.log")
+ endif()
+ if(err_contents)
+ list(APPEND LOGS "${LOGPREFIX}-err.log")
+ endif()
+
+ if(out_contents MATCHES "LINK : fatal error LNK1102:" OR out_contents MATCHES " fatal error C1060: ")
+ # The linker ran out of memory during execution. We will try continuing once more, with parallelism disabled.
+ execute_process(
+ COMMAND ${CMAKE_COMMAND} --build . --config ${CONFIG} ${TARGET_PARAM} -- ${BUILD_ARGS} ${NO_PARALLEL_ARG}
+ OUTPUT_FILE "${LOGPREFIX}-out-1.log"
+ ERROR_FILE "${LOGPREFIX}-err-1.log"
+ RESULT_VARIABLE error_code
+ WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${SHORT_BUILDTYPE})
+
+ if(error_code)
+ file(READ "${LOGPREFIX}-out-1.log" out_contents)
+ file(READ "${LOGPREFIX}-err-1.log" err_contents)
+
+ if(out_contents)
+ list(APPEND LOGS "${LOGPREFIX}-out-1.log")
+ endif()
+ if(err_contents)
+ list(APPEND LOGS "${LOGPREFIX}-err-1.log")
+ endif()
+ endif()
+ endif()
+
+ if(error_code)
+ set(STRINGIFIED_LOGS)
+ foreach(LOG ${LOGS})
+ file(TO_NATIVE_PATH "${LOG}" NATIVE_LOG)
+ list(APPEND STRINGIFIED_LOGS " ${NATIVE_LOG}\n")
+ endforeach()
+ set(_eb_COMMAND ${CMAKE_COMMAND} --build . --config ${CONFIG} ${TARGET_PARAM} -- ${BUILD_ARGS} ${NO_PARALLEL_ARG})
+ set(_eb_WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${SHORT_BUILDTYPE})
+ message(FATAL_ERROR
+ " Command failed: ${_eb_COMMAND}\n"
+ " Working Directory: ${_eb_WORKING_DIRECTORY}\n"
+ " See logs for more information:\n"
+ ${STRINGIFIED_LOGS})
+ endif()
+ endif()
+ message(STATUS "Build ${TARGET_TRIPLET}-${SHORT_BUILDTYPE} done")
+ endif()
+ endforeach()
endfunction()
diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake
index 4bcf3d2c9..6e2ec4ef5 100644
--- a/scripts/cmake/vcpkg_configure_cmake.cmake
+++ b/scripts/cmake/vcpkg_configure_cmake.cmake
@@ -57,40 +57,39 @@ function(vcpkg_configure_cmake)
set(_csc_HOST_ARCHITECTURE $ENV{PROCESSOR_ARCHITECTURE})
endif()
+ set(NINJA_CAN_BE_USED ON)
+ if(_csc_HOST_ARCHITECTURE STREQUAL "x86")
+ # Prebuilt ninja binaries are only provided for x64 hosts
+ set(NINJA_CAN_BE_USED OFF)
+ elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
+ # Ninja and MSBuild have many differences when targetting UWP, so use MSBuild to maximize existing compatibility
+ set(NINJA_CAN_BE_USED OFF)
+ elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm")
+ # Arm64 usage should be allowed once github issue #2375 is resolved
+ set(NINJA_CAN_BE_USED OFF)
+ endif()
+
if(_csc_GENERATOR)
set(GENERATOR ${_csc_GENERATOR})
- elseif(_csc_PREFER_NINJA AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND NOT _csc_HOST_ARCHITECTURE STREQUAL "x86")
+ elseif(_csc_PREFER_NINJA AND NINJA_CAN_BE_USED)
+ set(GENERATOR "Ninja")
+ elseif(VCPKG_CHAINLOAD_TOOLCHAIN_FILE)
set(GENERATOR "Ninja")
+
elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "x86" AND VCPKG_PLATFORM_TOOLSET MATCHES "v120")
set(GENERATOR "Visual Studio 12 2013")
elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "x64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v120")
set(GENERATOR "Visual Studio 12 2013 Win64")
elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "arm" AND VCPKG_PLATFORM_TOOLSET MATCHES "v120")
set(GENERATOR "Visual Studio 12 2013 ARM")
- elseif(VCPKG_CHAINLOAD_TOOLCHAIN_FILE)
- set(GENERATOR "Ninja")
- elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND VCPKG_TARGET_ARCHITECTURE MATCHES "x86" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140")
- set(GENERATOR "Visual Studio 14 2015")
- elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND VCPKG_TARGET_ARCHITECTURE MATCHES "x64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140")
- set(GENERATOR "Visual Studio 14 2015 Win64")
- elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND VCPKG_TARGET_ARCHITECTURE MATCHES "arm" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140")
- set(GENERATOR "Visual Studio 14 2015 ARM")
+
elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "x86" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140")
set(GENERATOR "Visual Studio 14 2015")
elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "x64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140")
set(GENERATOR "Visual Studio 14 2015 Win64")
- elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "arm" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140")
+ elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140")
set(GENERATOR "Visual Studio 14 2015 ARM")
- elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND VCPKG_TARGET_ARCHITECTURE MATCHES "x86" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141")
- set(GENERATOR "Visual Studio 15 2017")
- elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND VCPKG_TARGET_ARCHITECTURE MATCHES "x64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141")
- set(GENERATOR "Visual Studio 15 2017 Win64")
- elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141")
- set(GENERATOR "Visual Studio 15 2017 ARM")
- elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141")
- set(GENERATOR "Visual Studio 15 2017")
- set(ARCH "ARM64")
elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "x86" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141")
set(GENERATOR "Visual Studio 15 2017")
elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "x64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141")
diff --git a/scripts/cmake/vcpkg_download_distfile.cmake b/scripts/cmake/vcpkg_download_distfile.cmake
index 24503338a..28276f47c 100644
--- a/scripts/cmake/vcpkg_download_distfile.cmake
+++ b/scripts/cmake/vcpkg_download_distfile.cmake
@@ -2,6 +2,8 @@
##
## Download and cache a file needed for this port.
##
+## This helper should always be used instead of CMake's built-in `file(DOWNLOAD)` command.
+##
## ## Usage
## ```cmake
## vcpkg_download_distfile(
@@ -26,18 +28,24 @@
##
## If this doesn't match the downloaded version, the build will be terminated with a message describing the mismatch.
##
+## ### SKIP_SHA512
+## Skip SHA512 hash check for file.
+##
+## This switch is only valid when building with the `--head` command line flag.
+##
## ## Notes
-## The command [`vcpkg_from_github`](vcpkg_from_github.md) should be used instead of this for downloading the main archive for GitHub projects.
+## The helper [`vcpkg_from_github`](vcpkg_from_github.md) should be used for downloading from GitHub projects.
##
## ## Examples
##
-## * [boost](https://github.com/Microsoft/vcpkg/blob/master/ports/boost/portfile.cmake)
+## * [apr](https://github.com/Microsoft/vcpkg/blob/master/ports/apr/portfile.cmake)
## * [fontconfig](https://github.com/Microsoft/vcpkg/blob/master/ports/fontconfig/portfile.cmake)
## * [openssl](https://github.com/Microsoft/vcpkg/blob/master/ports/openssl/portfile.cmake)
function(vcpkg_download_distfile VAR)
+ set(options SKIP_SHA512)
set(oneValueArgs FILENAME SHA512)
set(multipleValuesArgs URLS)
- cmake_parse_arguments(vcpkg_download_distfile "" "${oneValueArgs}" "${multipleValuesArgs}" ${ARGN})
+ cmake_parse_arguments(vcpkg_download_distfile "${options}" "${oneValueArgs}" "${multipleValuesArgs}" ${ARGN})
if(NOT DEFINED vcpkg_download_distfile_URLS)
message(FATAL_ERROR "vcpkg_download_distfile requires a URLS argument.")
@@ -45,8 +53,16 @@ function(vcpkg_download_distfile VAR)
if(NOT DEFINED vcpkg_download_distfile_FILENAME)
message(FATAL_ERROR "vcpkg_download_distfile requires a FILENAME argument.")
endif()
- if(NOT DEFINED vcpkg_download_distfile_SHA512)
- message(FATAL_ERROR "vcpkg_download_distfile requires a SHA512 argument.")
+ if(NOT _VCPKG_INTERNAL_NO_HASH_CHECK)
+ if(vcpkg_download_distfile_SKIP_SHA512 AND NOT VCPKG_USE_HEAD_VERSION)
+ message(FATAL_ERROR "vcpkg_download_distfile only allows SKIP_SHA512 when building with --head")
+ endif()
+ if(NOT vcpkg_download_distfile_SKIP_SHA512 AND NOT DEFINED vcpkg_download_distfile_SHA512)
+ message(FATAL_ERROR "vcpkg_download_distfile requires a SHA512 argument. If you do not know the SHA512, add it as 'SHA512 0' and re-run this command.")
+ endif()
+ if(vcpkg_download_distfile_SKIP_SHA512 AND DEFINED vcpkg_download_distfile_SHA512)
+ message(FATAL_ERROR "vcpkg_download_distfile must not be passed both SHA512 and SKIP_SHA512.")
+ endif()
endif()
set(downloaded_file_path ${DOWNLOADS}/${vcpkg_download_distfile_FILENAME})
@@ -56,7 +72,12 @@ function(vcpkg_download_distfile VAR)
file(MAKE_DIRECTORY "${DOWNLOADS}/temp")
function(test_hash FILE_KIND CUSTOM_ERROR_ADVICE)
- if (_VCPKG_INTERNAL_NO_HASH_CHECK)
+ if(_VCPKG_INTERNAL_NO_HASH_CHECK)
+ # When using the internal hash skip, do not output an explicit message.
+ return()
+ endif()
+ if(vcpkg_download_distfile_SKIP_SHA512)
+ message(STATUS "Skipping hash check for ${downloaded_file_path}.")
return()
endif()
@@ -103,7 +124,7 @@ function(vcpkg_download_distfile VAR)
" Failed to download file.\n"
" Add mirrors or submit an issue at https://github.com/Microsoft/vcpkg/issues\n")
else()
- test_hash("downloaded file" "The file may be corrupted.")
+ test_hash("downloaded file" "The file may have been corrupted in transit.")
endif()
endif()
set(${VAR} ${downloaded_file_path} PARENT_SCOPE)
diff --git a/scripts/cmake/vcpkg_execute_required_process.cmake b/scripts/cmake/vcpkg_execute_required_process.cmake
index 7c4907016..5b8922c14 100644
--- a/scripts/cmake/vcpkg_execute_required_process.cmake
+++ b/scripts/cmake/vcpkg_execute_required_process.cmake
@@ -30,22 +30,34 @@
## * [qt5](https://github.com/Microsoft/vcpkg/blob/master/ports/qt5/portfile.cmake)
function(vcpkg_execute_required_process)
cmake_parse_arguments(vcpkg_execute_required_process "" "WORKING_DIRECTORY;LOGNAME" "COMMAND" ${ARGN})
- #debug_message("vcpkg_execute_required_process(${vcpkg_execute_required_process_COMMAND})")
+ set(LOG_OUT "${CURRENT_BUILDTREES_DIR}/${vcpkg_execute_required_process_LOGNAME}-out.log")
+ set(LOG_ERR "${CURRENT_BUILDTREES_DIR}/${vcpkg_execute_required_process_LOGNAME}-err.log")
execute_process(
COMMAND ${vcpkg_execute_required_process_COMMAND}
- OUTPUT_FILE ${CURRENT_BUILDTREES_DIR}/${vcpkg_execute_required_process_LOGNAME}-out.log
- ERROR_FILE ${CURRENT_BUILDTREES_DIR}/${vcpkg_execute_required_process_LOGNAME}-err.log
+ OUTPUT_FILE ${LOG_OUT}
+ ERROR_FILE ${LOG_ERR}
RESULT_VARIABLE error_code
WORKING_DIRECTORY ${vcpkg_execute_required_process_WORKING_DIRECTORY})
- #debug_message("error_code=${error_code}")
if(error_code)
- file(TO_NATIVE_PATH "${CURRENT_BUILDTREES_DIR}/${vcpkg_execute_required_process_LOGNAME}-out.log" NATIVE_LOG_OUT)
- file(TO_NATIVE_PATH "${CURRENT_BUILDTREES_DIR}/${vcpkg_execute_required_process_LOGNAME}-err.log" NATIVE_LOG_ERR)
+ set(LOGS)
+ file(READ "${LOG_OUT}" out_contents)
+ file(READ "${LOG_ERR}" err_contents)
+ if(out_contents)
+ list(APPEND LOGS "${LOG_OUT}")
+ endif()
+ if(err_contents)
+ list(APPEND LOGS "${LOG_ERR}")
+ endif()
+ set(STRINGIFIED_LOGS)
+ foreach(LOG ${LOGS})
+ file(TO_NATIVE_PATH "${LOG}" NATIVE_LOG)
+ list(APPEND STRINGIFIED_LOGS " ${NATIVE_LOG}\n")
+ endforeach()
message(FATAL_ERROR
" Command failed: ${vcpkg_execute_required_process_COMMAND}\n"
" Working Directory: ${vcpkg_execute_required_process_WORKING_DIRECTORY}\n"
" See logs for more information:\n"
- " ${NATIVE_LOG_OUT}\n"
- " ${NATIVE_LOG_ERR}\n")
+ ${STRINGIFIED_LOGS}
+ )
endif()
endfunction()
diff --git a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake
index f86ad0661..fead64d15 100644
--- a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake
+++ b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake
@@ -14,14 +14,18 @@
#
function(vcpkg_fixup_cmake_targets)
- cmake_parse_arguments(_vfct "" "CONFIG_PATH" "" ${ARGN})
+ cmake_parse_arguments(_vfct "" "CONFIG_PATH;TARGET_PATH" "" ${ARGN})
if(_vfct_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "vcpkg_fixup_cmake_targets was passed extra arguments: ${_vfct_UNPARSED_ARGUMENTS}")
endif()
- set(DEBUG_SHARE ${CURRENT_PACKAGES_DIR}/debug/share/${PORT})
- set(RELEASE_SHARE ${CURRENT_PACKAGES_DIR}/share/${PORT})
+ if(NOT _vfct_TARGET_PATH)
+ set(_vfct_TARGET_PATH share/${PORT})
+ endif()
+
+ set(DEBUG_SHARE ${CURRENT_PACKAGES_DIR}/debug/${_vfct_TARGET_PATH})
+ set(RELEASE_SHARE ${CURRENT_PACKAGES_DIR}/${_vfct_TARGET_PATH})
if(_vfct_CONFIG_PATH AND NOT RELEASE_SHARE STREQUAL "${CURRENT_PACKAGES_DIR}/${_vfct_CONFIG_PATH}")
set(DEBUG_CONFIG ${CURRENT_PACKAGES_DIR}/debug/${_vfct_CONFIG_PATH})
@@ -114,7 +118,7 @@ function(vcpkg_fixup_cmake_targets)
string(REGEX REPLACE "\\\${_IMPORT_PREFIX}/bin/([^ \"]+\\.exe)" "\${_IMPORT_PREFIX}/tools/${PORT}/\\1" _contents "${_contents}")
string(REPLACE "\${_IMPORT_PREFIX}/lib" "\${_IMPORT_PREFIX}/debug/lib" _contents "${_contents}")
string(REPLACE "\${_IMPORT_PREFIX}/bin" "\${_IMPORT_PREFIX}/debug/bin" _contents "${_contents}")
- file(WRITE ${CURRENT_PACKAGES_DIR}/share/${PORT}/${DEBUG_TARGET_NAME} "${_contents}")
+ file(WRITE ${CURRENT_PACKAGES_DIR}/${_vfct_TARGET_PATH}/${DEBUG_TARGET_NAME} "${_contents}")
file(REMOVE ${DEBUG_TARGET})
endforeach()
@@ -148,7 +152,7 @@ function(vcpkg_fixup_cmake_targets)
file(WRITE ${MAIN_CONFIG} "${_contents}")
endforeach()
- # Remove /debug/share/<port>/ if it's empty.
+ # Remove /debug/<target_path>/ if it's empty.
file(GLOB_RECURSE REMAINING_FILES "${DEBUG_SHARE}/*")
if(NOT REMAINING_FILES)
file(REMOVE_RECURSE ${DEBUG_SHARE})
diff --git a/scripts/cmake/vcpkg_from_github.cmake b/scripts/cmake/vcpkg_from_github.cmake
index b71ab3838..c6a23cff6 100644
--- a/scripts/cmake/vcpkg_from_github.cmake
+++ b/scripts/cmake/vcpkg_from_github.cmake
@@ -137,17 +137,17 @@ function(vcpkg_from_github)
endif()
# Try to download the file and version information from github.
- set(_VCPKG_INTERNAL_NO_HASH_CHECK "TRUE")
vcpkg_download_distfile(ARCHIVE_VERSION
URLS "https://api.github.com/repos/${ORG_NAME}/${REPO_NAME}/git/refs/heads/${_vdud_HEAD_REF}"
FILENAME ${downloaded_file_name}.version
+ SKIP_SHA512
)
vcpkg_download_distfile(ARCHIVE
URLS ${URL}
FILENAME ${downloaded_file_name}
+ SKIP_SHA512
)
- set(_VCPKG_INTERNAL_NO_HASH_CHECK "FALSE")
endif()
vcpkg_extract_source_archive_ex(
@@ -162,7 +162,10 @@ function(vcpkg_from_github)
string(REGEX REPLACE "\"sha\": \"([a-f0-9]+)\"" "\\1" _version ${x})
# exports VCPKG_HEAD_VERSION to the caller. This will get picked up by ports.cmake after the build.
- set(VCPKG_HEAD_VERSION ${_version} PARENT_SCOPE)
+ # When multiple vcpkg_from_github's are used after each other, only use the version from the first (hopefully the primary one).
+ if(NOT DEFINED VCPKG_HEAD_VERSION)
+ set(VCPKG_HEAD_VERSION ${_version} PARENT_SCOPE)
+ endif()
set_SOURCE_PATH(${CURRENT_BUILDTREES_DIR}/src/head ${SANITIZED_HEAD_REF})
endfunction()
diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1
index f62fe450c..168c2359e 100644
--- a/scripts/fetchDependency.ps1
+++ b/scripts/fetchDependency.ps1
@@ -20,12 +20,12 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency)
if($Dependency -eq "cmake")
{
- $requiredVersion = "3.10.0"
- $downloadVersion = "3.10.0"
- $url = "https://cmake.org/files/v3.10/cmake-3.10.0-win32-x86.zip"
- $downloadPath = "$downloadsDir\cmake-3.10.0-win32-x86.zip"
- $expectedDownloadedFileHash = "dce666e897f95a88d3eed6cddd1faa3f44179d519b33ca6065b385bbc7072419"
- $executableFromDownload = "$downloadsDir\cmake-3.10.0-win32-x86\bin\cmake.exe"
+ $requiredVersion = "3.10.1"
+ $downloadVersion = "3.10.1"
+ $url = "https://cmake.org/files/v3.10/cmake-3.10.1-win32-x86.zip"
+ $downloadPath = "$downloadsDir\cmake-3.10.1-win32-x86.zip"
+ $expectedDownloadedFileHash = "6fe010cce1201d884cd7a9535db8a1f16d98b8965341251fde8f1c5069ee58c0"
+ $executableFromDownload = "$downloadsDir\cmake-3.10.1-win32-x86\bin\cmake.exe"
$extractionType = $ExtractionType_ZIP
}
elseif($Dependency -eq "nuget")