From e2ff466f65a82dd31584468ddf67955092c79c11 Mon Sep 17 00:00:00 2001 From: Long Nguyen Date: Thu, 26 Nov 2020 02:26:33 +0700 Subject: [boost-locale] Replace VCPKG_TARGET_IS_WINDOWS in b2-options (#14502) * [boost-locale] Use CMAKE_SYSTEM_NAME as a fallback where VCPKG_TARGET_IS_WINDOWS is not available * fix this issue in a different way * Remove comments in b2-options.cmake.in Co-authored-by: nicole mazzuca * fix generate-ports.ps1 Co-authored-by: Nicole Mazzuca --- scripts/boost/generate-ports.ps1 | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/boost/generate-ports.ps1 b/scripts/boost/generate-ports.ps1 index d92ab8adf..29ab213da 100644 --- a/scripts/boost/generate-ports.ps1 +++ b/scripts/boost/generate-ports.ps1 @@ -5,15 +5,27 @@ param ( $portsDir = $null ) +$ErrorActionPreference = 'Stop' + $scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition if ($null -eq $portsDir) { $portsDir = "$scriptsDir/../../ports" } +if ($IsWindows) +{ + $vcpkg = "$scriptsDir/../../vcpkg.exe" +} +else +{ + $vcpkg = "$scriptsDir/../../vcpkg" +} + # Optionally clear this array when moving to a new boost version $port_versions = @{ #e.g. "asio" = 1; + "locale" = 1; } $per_port_data = @{ @@ -82,7 +94,7 @@ function Generate() mkdir "$portsDir/boost-$PortName" -erroraction SilentlyContinue | out-null $controlLines = @( - "# Automatically generated by boost-vcpkg-helpers/generate-ports.ps1" + "# Automatically generated by scripts/boost/generate-ports.ps1" "Source: boost-$PortName" "Version: $version" ) @@ -106,7 +118,7 @@ function Generate() $controlLines | out-file -enc ascii "$portsDir/boost-$PortName/CONTROL" $portfileLines = @( - "# Automatically generated by boost-vcpkg-helpers/generate-ports.ps1" + "# Automatically generated by scripts/boost/generate-ports.ps1" "" ) @@ -167,6 +179,20 @@ function Generate() ")" ) } + elseif (Test-Path "$portsDir/boost-$PortName/b2-options.cmake.in") + { + $portfileLines += @( + 'configure_file(' + ' "${CMAKE_CURRENT_LIST_DIR}/b2-options.cmake.in"' + ' "${CURRENT_BUILDTREES_DIR}/vcpkg-b2-options.cmake"' + ' @ONLY' + ')' + 'boost_modular_build(' + ' SOURCE_PATH ${SOURCE_PATH}' + ' BOOST_CMAKE_FRAGMENT "${CURRENT_BUILDTREES_DIR}/vcpkg-b2-options.cmake"' + ')' + ) + } else { $portfileLines += @( @@ -249,9 +275,9 @@ foreach ($library in $libraries) if (!(Test-Path $archive)) { "Downloading boost/$library..." - & @(vcpkg fetch aria2)[-1] "https://github.com/boostorg/$library/archive/boost-$version.tar.gz" -d "$scriptsDir/downloads" -o "$library-boost-$version.tar.gz" + & @(& $vcpkg fetch aria2)[-1] "https://github.com/boostorg/$library/archive/boost-$version.tar.gz" -d "$scriptsDir/downloads" -o "$library-boost-$version.tar.gz" } - $hash = vcpkg hash $archive + $hash = & $vcpkg hash $archive $unpacked = "$scriptsDir/libs/$library-boost-$version" if (!(Test-Path $unpacked)) { @@ -408,7 +434,7 @@ if ($libraries_in_boost_port.length -gt 1) { $boostDependsList = @($libraries_in_boost_port | % { "boost-$_" } | ? { $_ -notmatch "boost-mpi" }) -join ", " @( - "# Automatically generated by boost-vcpkg-helpers/generate-ports.ps1" + "# Automatically generated by scripts/boost/generate-ports.ps1" "Source: boost" "Version: $version" "Port-Version: $($port_versions.boost)" -- cgit v1.2.3