diff options
| author | Phil Christensen <philc@microsoft.com> | 2019-02-27 11:56:29 -0800 |
|---|---|---|
| committer | Phil Christensen <philc@microsoft.com> | 2019-02-27 11:56:29 -0800 |
| commit | 2cc7fa27e57f1129d1f37ccb009563509ca25720 (patch) | |
| tree | 3c75e423b71e54f6f65ec085c5d3d190d9d0d1a9 /scripts | |
| parent | 3830517ec7519b823f5d8c404710889c6bd00278 (diff) | |
| parent | 2dfa568d186e4f0d199040929f9b3e44f27c8943 (diff) | |
| download | vcpkg-2cc7fa27e57f1129d1f37ccb009563509ca25720.tar.gz vcpkg-2cc7fa27e57f1129d1f37ccb009563509ca25720.zip | |
Merge branch 'master' of https://github.com/microsoft/vcpkg into dev/philc/5254
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/bootstrap.ps1 | 18 | ||||
| -rw-r--r-- | scripts/buildsystems/vcpkg.cmake | 8 | ||||
| -rw-r--r-- | scripts/cmake/vcpkg_configure_cmake.cmake | 3 | ||||
| -rw-r--r-- | scripts/cmake/vcpkg_find_acquire_program.cmake | 16 | ||||
| -rw-r--r-- | scripts/cmake/vcpkg_test_cmake.cmake | 5 | ||||
| -rw-r--r-- | scripts/templates/portfile.in.cmake | 15 |
6 files changed, 42 insertions, 23 deletions
diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index 42eabd01b..07a9fcbaa 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -25,7 +25,7 @@ $withVSPath = $withVSPath -replace "\\$" # Remove potential trailing backslash function vcpkgHasProperty([Parameter(Mandatory=$true)][AllowNull()]$object, [Parameter(Mandatory=$true)]$propertyName) { - if ($object -eq $null) + if ($null -eq $object) { return $false } @@ -36,12 +36,12 @@ function vcpkgHasProperty([Parameter(Mandatory=$true)][AllowNull()]$object, [Par function getProgramFiles32bit() { $out = ${env:PROGRAMFILES(X86)} - if ($out -eq $null) + if ($null -eq $out) { $out = ${env:PROGRAMFILES} } - if ($out -eq $null) + if ($null -eq $out) { throw "Could not find [Program Files 32-bit]" } @@ -138,7 +138,7 @@ function getVisualStudioInstances() function findAnyMSBuildWithCppPlatformToolset([string]$withVSPath) { $VisualStudioInstances = getVisualStudioInstances - if ($VisualStudioInstances -eq $null) + if ($null -eq $VisualStudioInstances) { throw "Could not find Visual Studio. VS2015 or VS2017 (with C++) needs to be installed." } @@ -166,7 +166,7 @@ function findAnyMSBuildWithCppPlatformToolset([string]$withVSPath) if (Test-Path $VCFolder) { Write-Verbose "Picking: $instanceCandidate" - return "$path\MSBuild\Current\Bin\MSBuild.exe", "v141" + return "$path\MSBuild\Current\Bin\MSBuild.exe", "v142" } } @@ -192,7 +192,7 @@ function findAnyMSBuildWithCppPlatformToolset([string]$withVSPath) } } - throw "Could not find MSBuild version with C++ support. VS2015 or VS2017 (with C++) needs to be installed." + throw "Could not find MSBuild version with C++ support. VS2015, VS2017, or VS2019 (with C++) needs to be installed." } function getWindowsSDK( [Parameter(Mandatory=$False)][switch]$DisableWin10SDK = $False, [Parameter(Mandatory=$False)][switch]$DisableWin81SDK = $False, @@ -210,7 +210,7 @@ function getWindowsSDK( [Parameter(Mandatory=$False)][switch]$DisableWin10SDK = # Windows 10 SDK function CheckWindows10SDK($path) { - if ($path -eq $null) + if ($null -eq $path) { return } @@ -262,7 +262,7 @@ function getWindowsSDK( [Parameter(Mandatory=$False)][switch]$DisableWin10SDK = # Windows 8.1 SDK function CheckWindows81SDK($path) { - if ($path -eq $null) + if ($null -eq $path) { return } @@ -396,7 +396,7 @@ if ($ec -ne 0) } Write-Host "`nBuilding vcpkg.exe... done.`n" -Write-Verbose("Placing vcpkg.exe in the correct location") +Write-Verbose "Placing vcpkg.exe in the correct location" Copy-Item "$vcpkgReleaseDir\vcpkg.exe" "$vcpkgRootDir\vcpkg.exe" Copy-Item "$vcpkgReleaseDir\vcpkgmetricsuploader.exe" "$vcpkgRootDir\scripts\vcpkgmetricsuploader.exe" diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 91c196fb9..4ffb123d4 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -50,7 +50,13 @@ else() elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64") set(_VCPKG_TARGET_TRIPLET_ARCH x64) else() - message(FATAL_ERROR "Unable to determine target architecture.") + if( _CMAKE_IN_TRY_COMPILE ) + message(STATUS "Unable to determine target architecture, continuing without vcpkg.") + else() + message(WARNING "Unable to determine target architecture, continuing without vcpkg.") + endif() + set(VCPKG_TOOLCHAIN ON) + return() endif() endif() endif() diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index cf3fc7861..f7b81de93 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -77,9 +77,6 @@ function(vcpkg_configure_cmake) 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) diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index 0c3a9bca2..1f856b69e 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -58,15 +58,12 @@ function(vcpkg_find_acquire_program VAR) set(HASH a6e685ea24376f50db5f06c5b46075f1d3be25168fa1f27fa9b02e2ac017826cee62a2b43562f9b6c989337a231ba914416c110075457764de2d11f99d5e0f26) elseif(VAR MATCHES "NASM") set(PROGNAME nasm) - set(PATHS ${DOWNLOADS}/tools/nasm/nasm-2.12.02) + set(PATHS ${DOWNLOADS}/tools/nasm/nasm-2.14) set(BREW_PACKAGE_NAME "nasm") set(APT_PACKAGE_NAME "nasm") - set(URL - "http://www.nasm.us/pub/nasm/releasebuilds/2.12.02/win32/nasm-2.12.02-win32.zip" - "http://mirrors.kodi.tv/build-deps/win32/nasm-2.12.02-win32.zip" - ) - set(ARCHIVE "nasm-2.12.02-win32.zip") - set(HASH df7aaba094e17832688c88993997612a2e2c96cc3dc14ca3e8347b44c7762115f5a7fc6d7f20be402553aaa4c9e43ddfcf6228f581cfe89289bae550de151b36) + set(URL "http://www.nasm.us/pub/nasm/releasebuilds/2.14/win32/nasm-2.14-win32.zip") + set(ARCHIVE "nasm-2.14-win32.zip") + set(HASH 64481b0346b83de8c9568f04a54f68e0f4c71724afa0b414f12e4080951d8c49e489bfc32117f9a489e3e49477b1cadc583c672311316d27c543af304c4b7f2a) elseif(VAR MATCHES "YASM") set(PROGNAME yasm) set(SUBDIR 1.3.0.6) @@ -155,7 +152,7 @@ function(vcpkg_find_acquire_program VAR) set(URL "https://sourceforge.net/projects/winflexbison/files/winflexbison-2.5.16.zip/download") set(ARCHIVE "win_flex_bison-2.5.16.zip") set(HASH 0a14154bff5d998feb23903c46961528f8ccb4464375d5384db8c4a7d230c0c599da9b68e7a32f3217a0a0735742242eaf3769cb4f03e00931af8640250e9123) - if(NOT EXISTS "${PATHS}/data/m4sugar/m4sugar.m4" AND SUBDIR STREQUAL "win_flex-2.5.16") + if(NOT EXISTS "${PATHS}/data/m4sugar/m4sugar.m4") file(REMOVE_RECURSE "${PATHS}") endif() else() @@ -171,6 +168,9 @@ function(vcpkg_find_acquire_program VAR) set(URL "https://sourceforge.net/projects/winflexbison/files/winflexbison-2.5.16.zip/download") set(ARCHIVE "win_flex_bison-2.5.16.zip") set(HASH 0a14154bff5d998feb23903c46961528f8ccb4464375d5384db8c4a7d230c0c599da9b68e7a32f3217a0a0735742242eaf3769cb4f03e00931af8640250e9123) + if(NOT EXISTS "${PATHS}/data/m4sugar/m4sugar.m4") + file(REMOVE_RECURSE "${PATHS}") + endif() else() set(PROGNAME bison) set(APT_PACKAGE_NAME bison) diff --git a/scripts/cmake/vcpkg_test_cmake.cmake b/scripts/cmake/vcpkg_test_cmake.cmake index 718b2f69c..29654346a 100644 --- a/scripts/cmake/vcpkg_test_cmake.cmake +++ b/scripts/cmake/vcpkg_test_cmake.cmake @@ -27,6 +27,11 @@ function(vcpkg_test_cmake) set(PACKAGE_TYPE CONFIG) endif() + if(VCPKG_PLATFORM_TOOLSET STREQUAL "v142") + message(STATUS "Skipping CMake integration test due to v142 / CMake interaction issues") + return() + endif() + message(STATUS "Performing CMake integration test") file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-test) file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-test) diff --git a/scripts/templates/portfile.in.cmake b/scripts/templates/portfile.in.cmake index e44f53aa8..33f8a4853 100644 --- a/scripts/templates/portfile.in.cmake +++ b/scripts/templates/portfile.in.cmake @@ -11,13 +11,24 @@ # include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/@ROOT_NAME@) + vcpkg_download_distfile(ARCHIVE URLS "@URL@" FILENAME "@FILENAME@" SHA512 @SHA512@ ) -vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE ${ARCHIVE} + # (Optional) A friendly name to use instead of the filename of the archive (e.g.: a version number or tag). + # REF 1.0.0 + # (Optional) Read the docs for how to generate patches at: + # https://github.com/Microsoft/vcpkg/blob/master/docs/examples/patching.md + # PATCHES + # 001_port_fixes.patch + # 002_more_port_fixes.patch +) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} |
