aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/SHA256Hash.ps19
-rw-r--r--scripts/VcpkgPowershellUtils.ps199
-rw-r--r--scripts/buildsystems/vcpkg.cmake37
-rw-r--r--scripts/cmake/vcpkg_build_cmake.cmake28
-rw-r--r--scripts/cmake/vcpkg_configure_cmake.cmake1
-rw-r--r--scripts/cmake/vcpkg_find_acquire_program.cmake13
-rw-r--r--scripts/fetchTool.ps155
-rw-r--r--scripts/toolchains/windows.cmake13
-rw-r--r--scripts/vcpkgTools.xml98
9 files changed, 215 insertions, 138 deletions
diff --git a/scripts/SHA256Hash.ps1 b/scripts/SHA256Hash.ps1
deleted file mode 100644
index 348d461b7..000000000
--- a/scripts/SHA256Hash.ps1
+++ /dev/null
@@ -1,9 +0,0 @@
-[CmdletBinding()]
-Param(
- [Parameter(Mandatory=$True)]
- [String]$Value
-)
-
-$sha256 = New-Object -TypeName System.Security.Cryptography.SHA256CryptoServiceProvider
-$utf8 = New-Object -TypeName System.Text.UTF8Encoding
-[System.BitConverter]::ToString($sha256.ComputeHash($utf8.GetBytes($Value)))
diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1
index 92e0f21d0..fdd89e7b9 100644
--- a/scripts/VcpkgPowershellUtils.ps1
+++ b/scripts/VcpkgPowershellUtils.ps1
@@ -84,22 +84,22 @@ function vcpkgGetCredentials()
}
}
-function vcpkgGetSHA256([Parameter(Mandatory=$true)][string]$filePath)
+function vcpkgGetSHA512([Parameter(Mandatory=$true)][string]$filePath)
{
if (vcpkgHasCommand -commandName 'Microsoft.PowerShell.Utility\Get-FileHash')
{
Write-Verbose("Hashing with Microsoft.PowerShell.Utility\Get-FileHash")
- $hash = (Microsoft.PowerShell.Utility\Get-FileHash -Path $filePath -Algorithm SHA256).Hash
+ $hash = (Microsoft.PowerShell.Utility\Get-FileHash -Path $filePath -Algorithm SHA512).Hash
}
elseif(vcpkgHasCommand -commandName 'Pscx\Get-Hash')
{
Write-Verbose("Hashing with Pscx\Get-Hash")
- $hash = (Pscx\Get-Hash -Path $filePath -Algorithm SHA256).HashString
+ $hash = (Pscx\Get-Hash -Path $filePath -Algorithm SHA512).HashString
}
else
{
Write-Verbose("Hashing with .NET")
- $hashAlgorithm = [Security.Cryptography.HashAlgorithm]::Create("SHA256")
+ $hashAlgorithm = [Security.Cryptography.HashAlgorithm]::Create("SHA512")
$fileAsByteArray = [io.File]::ReadAllBytes($filePath)
$hashByteArray = $hashAlgorithm.ComputeHash($fileAsByteArray)
$hash = -Join ($hashByteArray | ForEach-Object {"{0:x2}" -f $_})
@@ -108,28 +108,26 @@ function vcpkgGetSHA256([Parameter(Mandatory=$true)][string]$filePath)
return $hash.ToLower()
}
-function vcpkgCheckEqualFileHash( [Parameter(Mandatory=$true)][string]$filePath,
- [Parameter(Mandatory=$true)][string]$expectedHash,
- [Parameter(Mandatory=$true)][string]$actualHash)
+function vcpkgCheckEqualFileHash( [Parameter(Mandatory=$true)][string]$url,
+ [Parameter(Mandatory=$true)][string]$filePath,
+ [Parameter(Mandatory=$true)][string]$expectedHash)
{
+ $actualHash = vcpkgGetSHA512 $filePath
if ($expectedHash -ne $actualHash)
{
Write-Host ("`nFile does not have expected hash:`n" +
+ " url: [ $url ]`n" +
" File path: [ $filePath ]`n" +
" Expected hash: [ $expectedHash ]`n" +
" Actual hash: [ $actualHash ]`n")
- throw "Invalid Hash for file $filePath"
+ throw
}
}
function vcpkgDownloadFile( [Parameter(Mandatory=$true)][string]$url,
- [Parameter(Mandatory=$true)][string]$downloadPath)
+ [Parameter(Mandatory=$true)][string]$downloadPath,
+ [Parameter(Mandatory=$true)][string]$sha512)
{
- if (Test-Path $downloadPath)
- {
- return
- }
-
if ($url -match "github")
{
if ([System.Enum]::IsDefined([Net.SecurityProtocolType], "Tls12"))
@@ -157,21 +155,65 @@ function vcpkgDownloadFile( [Parameter(Mandatory=$true)][string]$url,
}
$wc.DownloadFile($url, $downloadPartPath)
+ vcpkgCheckEqualFileHash -url $url -filePath $downloadPartPath -expectedHash $sha512
Move-Item -Path $downloadPartPath -Destination $downloadPath
}
-function vcpkgExtractFile( [Parameter(Mandatory=$true)][string]$archivePath,
- [Parameter(Mandatory=$true)][string]$destinationDir,
- [Parameter(Mandatory=$true)][string]$outFilename)
+function vcpkgDownloadFileWithAria2( [Parameter(Mandatory=$true)][string]$aria2exe,
+ [Parameter(Mandatory=$true)][string]$url,
+ [Parameter(Mandatory=$true)][string]$downloadPath,
+ [Parameter(Mandatory=$true)][string]$sha512)
{
- vcpkgCreateDirectoryIfNotExists $destinationDir
- $output = "$destinationDir\$outFilename"
- vcpkgRemoveItem $output
- $destinationPartial = "$destinationDir\partially-extracted"
+ vcpkgCreateParentDirectoryIfNotExists $downloadPath
+ $downloadPartPath = "$downloadPath.part"
+ vcpkgRemoveItem $downloadPartPath
+ $parentDir = split-path -parent $downloadPath
+ $filename = split-path -leaf $downloadPath
+
+ if ((Test-Path $url) -or ($url.StartsWith("file://"))) # if is local file
+ {
+ vcpkgDownloadFile $url $downloadPath $sha512
+ return
+ }
+
+ $ec = vcpkgInvokeCommand "$aria2exe" "--dir `"$parentDir`" --out `"$filename.part`" $url"
+ if ($ec -ne 0)
+ {
+ Write-Host "Could not download $url"
+ throw
+ }
+
+ vcpkgCheckEqualFileHash -url $url -filePath $downloadPartPath -expectedHash $sha512
+ Move-Item -Path $downloadPartPath -Destination $downloadPath
+}
+
+function vcpkgExtractFileWith7z([Parameter(Mandatory=$true)][string]$sevenZipExe,
+ [Parameter(Mandatory=$true)][string]$archivePath,
+ [Parameter(Mandatory=$true)][string]$destinationDir)
+{
+ vcpkgRemoveItem $destinationDir
+ $destinationPartial = "$destinationDir.partial"
+ vcpkgRemoveItem $destinationPartial
+ vcpkgCreateDirectoryIfNotExists $destinationPartial
+ $ec = vcpkgInvokeCommand "$sevenZipExe" "x `"$archivePath`" -o`"$destinationPartial`" -y"
+ if ($ec -ne 0)
+ {
+ Write-Host "Could not extract $archivePath"
+ throw
+ }
+ Rename-Item -Path "$destinationPartial" -NewName $destinationDir
+}
+
+function vcpkgExtractZipFile( [Parameter(Mandatory=$true)][string]$archivePath,
+ [Parameter(Mandatory=$true)][string]$destinationDir)
+{
+ vcpkgRemoveItem $destinationDir
+ $destinationPartial = "$destinationDir.partial"
vcpkgRemoveItem $destinationPartial
vcpkgCreateDirectoryIfNotExists $destinationPartial
+
if (vcpkgHasCommand -commandName 'Microsoft.PowerShell.Archive\Expand-Archive')
{
Write-Verbose("Extracting with Microsoft.PowerShell.Archive\Expand-Archive")
@@ -194,20 +236,7 @@ function vcpkgExtractFile( [Parameter(Mandatory=$true)][string]$archivePath,
}
}
- $items = @(Get-ChildItem "$destinationPartial")
- $itemCount = $items.Count
-
- if ($itemCount -eq 1)
- {
- $item = $items | Select-Object -first 1
- Write-Host "$item"
- Move-Item -Path "$destinationPartial\$item" -Destination $output
- vcpkgRemoveItem $destinationPartial
- }
- else
- {
- Move-Item -Path "$destinationPartial" -Destination $output
- }
+ Rename-Item -Path "$destinationPartial" -NewName $destinationDir
}
function vcpkgInvokeCommand()
diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake
index 0c32b22fb..a9f8190f7 100644
--- a/scripts/buildsystems/vcpkg.cmake
+++ b/scripts/buildsystems/vcpkg.cmake
@@ -187,7 +187,7 @@ macro(find_package name)
unset(Boost_USE_STATIC_RUNTIME)
set(Boost_COMPILER "-vc140")
_find_package(${ARGV})
- elseif("${name}" STREQUAL "ICU")
+ elseif("${name}" STREQUAL "ICU" AND EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/unicode/utf.h")
function(_vcpkg_find_in_list)
list(FIND ARGV "COMPONENTS" COMPONENTS_IDX)
set(COMPONENTS_IDX ${COMPONENTS_IDX} PARENT_SCOPE)
@@ -198,7 +198,7 @@ macro(find_package name)
else()
_find_package(${ARGV})
endif()
- elseif("${name}" STREQUAL "TIFF")
+ elseif("${name}" STREQUAL "TIFF" AND EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/tiff.h")
_find_package(${ARGV})
find_package(LibLZMA)
if(TARGET TIFF::TIFF)
@@ -207,24 +207,7 @@ macro(find_package name)
if(TIFF_LIBRARIES)
list(APPEND TIFF_LIBRARIES ${LIBLZMA_LIBRARIES})
endif()
- elseif("${name}" STREQUAL "Freetype")
- _find_package(${ARGV})
- find_package(ZLIB)
- find_package(PNG)
- find_package(BZip2)
- if(TARGET Freetype::Freetype)
- set_property(TARGET Freetype::Freetype APPEND PROPERTY INTERFACE_LINK_LIBRARIES BZip2::BZip2 PNG::PNG ZLIB::ZLIB)
- endif()
- if(FREETYPE_LIBRARIES)
- list(APPEND FREETYPE_LIBRARIES ${BZIP2_LIBRARIES} ${PNG_LIBRARIES} ${ZLIB_LIBRARIES})
- endif()
- elseif("${name}" STREQUAL "tinyxml2")
- _find_package(${ARGV})
- if(TARGET tinyxml2_static AND NOT TARGET tinyxml2)
- _add_library(tinyxml2 INTERFACE IMPORTED)
- set_target_properties(tinyxml2 PROPERTIES INTERFACE_LINK_LIBRARIES "tinyxml2_static")
- endif()
- elseif(("${name}" STREQUAL "HDF5" OR "${name}" STREQUAL "hdf5") AND NOT PROJECT_NAME STREQUAL "VTK")
+ elseif(("${name}" STREQUAL "HDF5" OR "${name}" STREQUAL "hdf5") AND NOT PROJECT_NAME STREQUAL "VTK" AND EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/hdf5.h")
# This is a hack to make VTK work. TODO: find another way to suppress the built-in find module.
_find_package(${ARGV} CONFIG)
# Fill in missing static/shared targets
@@ -237,7 +220,7 @@ macro(find_package name)
set_target_properties(hdf5::${HDF5TARGET}-static PROPERTIES INTERFACE_LINK_LIBRARIES "hdf5::${HDF5TARGET}-shared")
endif()
endforeach()
- elseif("${name}" STREQUAL "GSL")
+ elseif("${name}" STREQUAL "GSL" AND EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/gsl")
_find_package(${ARGV})
if(GSL_FOUND AND TARGET GSL::gsl)
set_property( TARGET GSL::gslcblas APPEND PROPERTY IMPORTED_CONFIGURATIONS Release )
@@ -249,7 +232,7 @@ macro(find_package name)
set_target_properties( GSL::gslcblas PROPERTIES IMPORTED_LOCATION_DEBUG "${GSL_CBLAS_LIBRARY_DEBUG}" )
endif()
endif()
- elseif("${name}" STREQUAL "CURL")
+ elseif("${name}" STREQUAL "CURL" AND EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/curl")
_find_package(${ARGV})
if(CURL_FOUND)
if(EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/nghttp2.lib")
@@ -258,16 +241,6 @@ macro(find_package name)
"optimized" "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/nghttp2.lib")
endif()
endif()
- elseif("${name}" STREQUAL "LibXml2")
- _find_package(${ARGV})
- if(LibXml2_FOUND AND (CMAKE_SYSTEM_NAME STREQUAL "Windows" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsStore"))
- list(APPEND LIBXML2_LIBRARIES
- debug ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib/libiconv.lib
- optimized ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/libiconv.lib
- debug ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib/libcharset.lib
- optimized ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/libcharset.lib
- ws2_32)
- endif()
else()
_find_package(${ARGV})
endif()
diff --git a/scripts/cmake/vcpkg_build_cmake.cmake b/scripts/cmake/vcpkg_build_cmake.cmake
index 630662588..41415d9a8 100644
--- a/scripts/cmake/vcpkg_build_cmake.cmake
+++ b/scripts/cmake/vcpkg_build_cmake.cmake
@@ -105,6 +105,7 @@ function(vcpkg_build_cmake)
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.
+ message(STATUS "Restarting Build ${TARGET_TRIPLET}-${SHORT_BUILDTYPE} without parallelism because memory exceeded")
execute_process(
COMMAND ${CMAKE_COMMAND} --build . --config ${CONFIG} ${TARGET_PARAM} -- ${BUILD_ARGS} ${NO_PARALLEL_ARG}
OUTPUT_FILE "${LOGPREFIX}-out-1.log"
@@ -123,6 +124,33 @@ function(vcpkg_build_cmake)
list(APPEND LOGS "${LOGPREFIX}-err-1.log")
endif()
endif()
+ elseif(out_contents MATCHES ": No such file or directory")
+ # WSL workaround - WSL occassionally fails with no such file or directory. Detect if we are running in WSL and restart.
+ execute_process(COMMAND "uname" "-r"
+ OUTPUT_VARIABLE UNAME_R ERROR_VARIABLE UNAME_R
+ OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_STRIP_TRAILING_WHITESPACE)
+
+ if (UNAME_R MATCHES "Microsoft")
+ message(STATUS "Restarting Build ${TARGET_TRIPLET}-${SHORT_BUILDTYPE} because of (potential) wsl subsystem issue.")
+ execute_process(
+ COMMAND ${CMAKE_COMMAND} --build . --config ${CONFIG} ${TARGET_PARAM} -- ${BUILD_ARGS}
+ 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()
endif()
if(error_code)
diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake
index 3a3a88515..3e0922428 100644
--- a/scripts/cmake/vcpkg_configure_cmake.cmake
+++ b/scripts/cmake/vcpkg_configure_cmake.cmake
@@ -165,6 +165,7 @@ function(vcpkg_configure_cmake)
list(APPEND _csc_OPTIONS
"-DVCPKG_TARGET_TRIPLET=${TARGET_TRIPLET}"
+ "-DVCPKG_PLATFORM_TOOLSET=${VCPKG_PLATFORM_TOOLSET}"
"-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON"
"-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON"
"-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON"
diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake
index ef0e1584f..30ecb0573 100644
--- a/scripts/cmake/vcpkg_find_acquire_program.cmake
+++ b/scripts/cmake/vcpkg_find_acquire_program.cmake
@@ -116,7 +116,7 @@ function(vcpkg_find_acquire_program VAR)
if(CMAKE_HOST_WIN32)
set(PATHS "${DOWNLOADS}/tools/ninja/${SUBDIR}")
else()
- set(PATHS "${DOWNLOADS}/tools/${SUBDIR}")
+ set(PATHS "${DOWNLOADS}/tools/${SUBDIR}-linux")
endif()
set(BREW_PACKAGE_NAME "ninja")
set(APT_PACKAGE_NAME "ninja-build")
@@ -218,19 +218,20 @@ function(vcpkg_find_acquire_program VAR)
FILENAME ${ARCHIVE}
)
- file(MAKE_DIRECTORY ${DOWNLOADS}/tools/${PROGNAME}/${SUBDIR})
+ set(PROG_PATH_SUBDIR "${DOWNLOADS}/tools/${PROGNAME}/${SUBDIR}")
+ file(MAKE_DIRECTORY ${PROG_PATH_SUBDIR})
if(DEFINED NOEXTRACT)
if(DEFINED _vfa_RENAME)
- file(INSTALL ${ARCHIVE_PATH} DESTINATION ${DOWNLOADS}/tools/${PROGNAME}/${SUBDIR} RENAME ${_vfa_RENAME})
+ file(INSTALL ${ARCHIVE_PATH} DESTINATION ${PROG_PATH_SUBDIR} RENAME ${_vfa_RENAME})
else()
- file(COPY ${ARCHIVE_PATH} DESTINATION ${DOWNLOADS}/tools/${PROGNAME}/${SUBDIR})
+ file(COPY ${ARCHIVE_PATH} DESTINATION ${PROG_PATH_SUBDIR})
endif()
else()
get_filename_component(ARCHIVE_EXTENSION ${ARCHIVE} EXT)
string(TOLOWER "${ARCHIVE_EXTENSION}" ARCHIVE_EXTENSION)
if(ARCHIVE_EXTENSION STREQUAL ".msi")
file(TO_NATIVE_PATH "${ARCHIVE_PATH}" ARCHIVE_NATIVE_PATH)
- file(TO_NATIVE_PATH "${DOWNLOADS}/tools/${PROGNAME}/${SUBDIR}" DESTINATION_NATIVE_PATH)
+ file(TO_NATIVE_PATH "${PROG_PATH_SUBDIR}" DESTINATION_NATIVE_PATH)
execute_process(
COMMAND msiexec /a ${ARCHIVE_NATIVE_PATH} /qn TARGETDIR=${DESTINATION_NATIVE_PATH}
WORKING_DIRECTORY ${DOWNLOADS}
@@ -238,7 +239,7 @@ function(vcpkg_find_acquire_program VAR)
else()
execute_process(
COMMAND ${CMAKE_COMMAND} -E tar xzf ${ARCHIVE_PATH}
- WORKING_DIRECTORY ${DOWNLOADS}/tools/${PROGNAME}/${SUBDIR}
+ WORKING_DIRECTORY ${PROG_PATH_SUBDIR}
)
endif()
endif()
diff --git a/scripts/fetchTool.ps1 b/scripts/fetchTool.ps1
index 26eedac3b..dd3f0f9f4 100644
--- a/scripts/fetchTool.ps1
+++ b/scripts/fetchTool.ps1
@@ -22,43 +22,74 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool)
if ($toolData -eq $null)
{
- throw "Unkown tool $tool"
+ throw "Unknown tool $tool"
}
- $exePath = "$downloadsDir\$($toolData.exeRelativePath)"
+ $toolPath="$downloadsDir\tools\$tool-$($toolData.version)-windows"
+ $exePath = "$toolPath\$($toolData.exeRelativePath)"
if (Test-Path $exePath)
{
return $exePath
}
- $isArchive = vcpkgHasProperty -object $toolData -propertyName "archiveRelativePath"
+ $isArchive = vcpkgHasProperty -object $toolData -propertyName "archiveName"
if ($isArchive)
{
- $downloadPath = "$downloadsDir\$($toolData.archiveRelativePath)"
+ $downloadPath = "$downloadsDir\$($toolData.archiveName)"
}
else
{
- $downloadPath = "$downloadsDir\$($toolData.exeRelativePath)"
+ $downloadPath = "$toolPath\$($toolData.exeRelativePath)"
}
[String]$url = $toolData.url
if (!(Test-Path $downloadPath))
{
Write-Host "Downloading $tool..."
- vcpkgDownloadFile $url $downloadPath
+
+ # Download aria2 with .NET. aria2 will be used to download everything else.
+ if ($tool -eq "aria2")
+ {
+ vcpkgDownloadFile $url $downloadPath $toolData.sha512
+ }
+ else
+ {
+ $aria2exe = fetchToolInternal "aria2"
+ vcpkgDownloadFileWithAria2 $aria2exe $url $downloadPath $toolData.sha512
+ }
+
Write-Host "Downloading $tool... done."
}
-
- $expectedDownloadedFileHash = $toolData.sha256
- $downloadedFileHash = vcpkgGetSHA256 $downloadPath
- vcpkgCheckEqualFileHash -filePath $downloadPath -expectedHash $expectedDownloadedFileHash -actualHash $downloadedFileHash
+ else
+ {
+ vcpkgCheckEqualFileHash -url $url -filePath $downloadPath -expectedHash $toolData.sha512
+ }
if ($isArchive)
{
- $outFilename = (Get-ChildItem $downloadPath).BaseName
Write-Host "Extracting $tool..."
- vcpkgExtractFile -ArchivePath $downloadPath -DestinationDir $downloadsDir -outFilename $outFilename
+ # Extract 7zip920 with shell because we need it to extract 7zip
+ # Extract aria2 with shell because we need it to download 7zip
+ if ($tool -eq "7zip920" -or $tool -eq "aria2")
+ {
+ vcpkgExtractZipFile -ArchivePath $downloadPath -DestinationDir $toolPath
+ }
+ elseif ($tool -eq "7zip")
+ {
+ $sevenZip920 = fetchToolInternal "7zip920"
+ $ec = vcpkgInvokeCommand "$sevenZip920" "x `"$downloadPath`" -o`"$toolPath`" -y"
+ if ($ec -ne 0)
+ {
+ Write-Host "Could not extract $downloadPath"
+ throw
+ }
+ }
+ else
+ {
+ $sevenZipExe = fetchToolInternal "7zip"
+ vcpkgExtractFileWith7z -sevenZipExe "$sevenZipExe" -ArchivePath $downloadPath -DestinationDir $toolPath
+ }
Write-Host "Extracting $tool... done."
}
diff --git a/scripts/toolchains/windows.cmake b/scripts/toolchains/windows.cmake
index 7bfc2282b..266e023b1 100644
--- a/scripts/toolchains/windows.cmake
+++ b/scripts/toolchains/windows.cmake
@@ -9,8 +9,17 @@ if(NOT _CMAKE_IN_TRY_COMPILE)
message(FATAL_ERROR "Invalid setting for VCPKG_CRT_LINKAGE: \"${VCPKG_CRT_LINKAGE}\". It must be \"static\" or \"dynamic\"")
endif()
- set(CMAKE_CXX_FLAGS " /DWIN32 /D_WINDOWS /W3 /utf-8 /GR /EHsc /MP ${VCPKG_CXX_FLAGS}" CACHE STRING "")
- set(CMAKE_C_FLAGS " /DWIN32 /D_WINDOWS /W3 /utf-8 /MP ${VCPKG_C_FLAGS}" CACHE STRING "")
+ set(CHARSET_FLAG "/utf-8")
+ if(VCPKG_PLATFORM_TOOLSET MATCHES "v120")
+ # VS 2013 does not support /utf-8
+ set(CHARSET_FLAG)
+ endif()
+
+ set(CMAKE_CXX_FLAGS " /DWIN32 /D_WINDOWS /W3 ${CHARSET_FLAG} /GR /EHsc /MP ${VCPKG_CXX_FLAGS}" CACHE STRING "")
+ set(CMAKE_C_FLAGS " /DWIN32 /D_WINDOWS /W3 ${CHARSET_FLAG} /MP ${VCPKG_C_FLAGS}" CACHE STRING "")
+ set(CMAKE_RC_FLAGS "-c65001 /DWIN32" CACHE STRING "")
+
+ unset(CHARSET_FLAG)
set(CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG ${VCPKG_CRT_LINK_FLAG_PREFIX}d /Z7 /Ob0 /Od /RTC1 ${VCPKG_CXX_FLAGS_DEBUG}" CACHE STRING "")
set(CMAKE_C_FLAGS_DEBUG "/D_DEBUG ${VCPKG_CRT_LINK_FLAG_PREFIX}d /Z7 /Ob0 /Od /RTC1 ${VCPKG_C_FLAGS_DEBUG}" CACHE STRING "")
diff --git a/scripts/vcpkgTools.xml b/scripts/vcpkgTools.xml
index 477584c5a..daaf29214 100644
--- a/scripts/vcpkgTools.xml
+++ b/scripts/vcpkgTools.xml
@@ -1,71 +1,85 @@
<?xml version="1.0"?>
-<tools version="1">
- <tool name="cmake">
- <requiredVersion>3.10.2</requiredVersion>
+<tools version="2">
+ <tool name="cmake" os="windows">
+ <version>3.10.2</version>
<exeRelativePath>cmake-3.10.2-win32-x86\bin\cmake.exe</exeRelativePath>
<url>https://cmake.org/files/v3.10/cmake-3.10.2-win32-x86.zip</url>
- <sha256>f5f7e41a21d0e9b655aca58498b08e17ecd27796bf82837e2c84435359169dd6</sha256>
- <archiveRelativePath>cmake-3.10.2-win32-x86.zip</archiveRelativePath>
+ <sha512>9c16861a2ac09c7011b84f38459ecfec2829a9f825b254acbbde46d98f12f8ca0d4db3a6764758cb671507ee7c0327576d87658b81d7ddf1e8280b37569eb16d</sha512>
+ <archiveName>cmake-3.10.2-win32-x86.zip</archiveName>
</tool>
<tool name="cmake" os="osx">
- <requiredVersion>3.10.2</requiredVersion>
+ <version>3.10.2</version>
<exeRelativePath>cmake-3.10.2-Darwin-x86_64/CMake.app/Contents/bin/cmake</exeRelativePath>
<url>https://cmake.org/files/v3.10/cmake-3.10.2-Darwin-x86_64.tar.gz</url>
- <sha256>e748eb7698f8e2783c2eea9ab81eebf66da0238bbf8e8fa722a67a38f2110718</sha256>
- <archiveRelativePath>cmake-3.10.2-Darwin-x86_64.tar.gz</archiveRelativePath>
+ <sha512>cb7d76e11c892eb786da5804282c4141564390c3552e08c506c7abb93015eb5f619c55255459872b219399ce8114ac321fe92df7f82a7e42bbc874eec240571e</sha512>
+ <archiveName>cmake-3.10.2-Darwin-x86_64.tar.gz</archiveName>
</tool>
<tool name="cmake" os="linux">
- <requiredVersion>3.10.2</requiredVersion>
+ <version>3.10.2</version>
<exeRelativePath>cmake-3.10.2-Linux-x86_64/bin/cmake</exeRelativePath>
<url>https://cmake.org/files/v3.10/cmake-3.10.2-Linux-x86_64.tar.gz</url>
- <sha256>7a82b46c35f4e68a0807e8dc04e779dee3f36cd42c6387fd13b5c29fe62a69ea</sha256>
- <archiveRelativePath>cmake-3.10.2-Linux-x86_64.tar.gz</archiveRelativePath>
+ <sha512>54389b5cb3f3cb9d182d35e0b1eaf7b301695899930da0d26e9df1dc25056213a077646d23ea609a93daa81d30687757d9cf0dc263339fa3d73dbeb1284bc1a9</sha512>
+ <archiveName>cmake-3.10.2-Linux-x86_64.tar.gz</archiveName>
</tool>
- <tool name="git">
- <requiredVersion>2.16.2</requiredVersion>
- <exeRelativePath>MinGit-2.16.2-32-bit\cmd\git.exe</exeRelativePath>
+ <tool name="git" os="windows">
+ <version>2.16.2</version>
+ <exeRelativePath>cmd\git.exe</exeRelativePath>
<url>https://github.com/git-for-windows/git/releases/download/v2.16.2.windows.1/MinGit-2.16.2-32-bit.zip</url>
- <sha256>322c727e482aa97522c64a5ac68bdda3780111e8670bcfb532beac8e11ece5da</sha256>
- <archiveRelativePath>MinGit-2.16.2-32-bit.zip</archiveRelativePath>
+ <sha512>004e1dc1904f2e2d5c3534d0a56f58bf030b1146f5b263d6d191e60f72cd35455977c588604708125a1e93268ee8f7a5ab32ed6115adc028257b12d5926f350a</sha512>
+ <archiveName>MinGit-2.16.2-32-bit.zip</archiveName>
</tool>
- <tool name="vswhere">
- <requiredVersion>2.3.2</requiredVersion>
- <exeRelativePath>vswhere-2.3.2\vswhere.exe</exeRelativePath>
- <url>https://github.com/Microsoft/vswhere/releases/download/2.3.2/vswhere.exe</url>
- <sha256>103f2784c4b2c8e70c7c1c03687abbf22bce052aae30639406e4e13ffa29ee04</sha256>
+ <tool name="vswhere" os="windows">
+ <version>2.4.1</version>
+ <exeRelativePath>vswhere.exe</exeRelativePath>
+ <url>https://github.com/Microsoft/vswhere/releases/download/2.4.1/vswhere.exe</url>
+ <sha512>f477842d0cebefcd6bf9c6d536ab8ea20ec5b0aa967ee963ab6a101aeff9df8742ca600d35f39e2e7158d76d8231f1ed2bef6104dce84d2bf8d6b07d17d706a1</sha512>
</tool>
- <tool name="nuget">
- <requiredVersion>4.4.0</requiredVersion>
- <exeRelativePath>nuget-4.4.0\nuget.exe</exeRelativePath>
- <url>https://dist.nuget.org/win-x86-commandline/v4.4.0/nuget.exe</url>
- <sha256>2cf9b118937eef825464e548f0c44f7f64090047746de295d75ac3dcffa3e1f6</sha256>
+ <tool name="nuget" os="windows">
+ <version>4.6.2</version>
+ <exeRelativePath>nuget.exe</exeRelativePath>
+ <url>https://dist.nuget.org/win-x86-commandline/v4.6.2/nuget.exe</url>
+ <sha512>60daea7bec2de23089f7ad73985dd788ac154171d6326c2c456726849b8f97dfc38cbdd9b9bf8d96aced009ccaaed317905b65c108e149cfbbbcdfb95f8f0519</sha512>
</tool>
- <tool name="installerbase">
- <requiredVersion>3.1.81</requiredVersion>
+ <tool name="installerbase" os="windows">
+ <version>3.1.81</version>
<exeRelativePath>QtInstallerFramework-win-x86\bin\installerbase.exe</exeRelativePath>
<url>https://github.com/podsvirov/installer-framework/releases/download/cr203958-9/QtInstallerFramework-win-x86.zip</url>
- <sha256>f2ce23cf5cf9fc7ce409bdca49328e09a070c0026d3c8a04e4dfde7b05b83fe8</sha256>
- <archiveRelativePath>QtInstallerFramework-win-x86.zip</archiveRelativePath>
+ <sha512>1f3e593270d7c2a4e271fdb49c637a2de462351310ef66bba298d30f6ca23365ec6aecf2e57799a00c873267cd3f92060ecac03eb291d42903d0e0869cd17c73</sha512>
+ <archiveName>QtInstallerFramework-win-x86.zip</archiveName>
</tool>
- <tool name="7zip">
- <requiredVersion>18.01.0</requiredVersion>
- <exeRelativePath>7za920\7za.exe</exeRelativePath>
- <url>http://www.7-zip.org/a/7za920.zip</url>
- <sha256>2a3afe19c180f8373fa02ff00254d5394fec0349f5804e0ad2f6067854ff28ac</sha256>
- <archiveRelativePath>7za920.zip</archiveRelativePath>
+ <tool name="7zip" os="windows">
+ <version>18.01.0</version>
+ <exeRelativePath>7za.exe</exeRelativePath>
+ <url>https://www.7-zip.org/a/7z1801-extra.7z</url>
+ <sha512>9133fc551d76515e37fdd4dd8c1e28d464aea493548246b44565a42bba46715764f41f9cfa14d470d298c3a6e9829d200f8be5168cb67cf8f23d8042fca833bc</sha512>
+ <archiveName>7z1801-extra.7z</archiveName>
+ </tool>
+ <tool name="7zip920" os="windows">
+ <version>9.20.0</version>
+ <exeRelativePath>7za.exe</exeRelativePath>
+ <url>https://www.7-zip.org/a/7za920.zip</url>
+ <sha512>84e830c91a0e8ae499cc4814080da6569d8a6acbddc585c8b62abc86c809793aeb669b0a741063a379fd281ade85f120bc27efeb67d63bf961be893eec8bc3b3</sha512>
+ <archiveName>7za920.zip</archiveName>
+ </tool>
+ <tool name="aria2" os="windows">
+ <version>18.01.0</version>
+ <exeRelativePath>aria2-1.33.1-win-32bit-build1\aria2c.exe</exeRelativePath>
+ <url>https://github.com/aria2/aria2/releases/download/release-1.33.1/aria2-1.33.1-win-32bit-build1.zip</url>
+ <sha512>2456176ba3d506a07cf0cc4f61f080e1ff8cb4106426d66f354c5bb67a9a8720b5ddb26904275e61b1f623c932355f7dcde4cd17556cc895f11293c23c3a9bf3</sha512>
+ <archiveName>aria2-1.33.1-win-32bit-build1.zip</archiveName>
</tool>
<tool name="ninja" os="linux">
- <requiredVersion>1.8.2</requiredVersion>
+ <version>1.8.2</version>
<exeRelativePath>ninja</exeRelativePath>
<url>https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-linux.zip</url>
- <sha256>d2fea9ff33b3ef353161ed906f260d565ca55b8ca0568fa07b1d2cab90a84a07</sha256>
- <archiveRelativePath>ninja-linux.zip</archiveRelativePath>
+ <sha512>38fcb68e745c1f15b4b50f20069ffe686b1ef5baf93b74958e132ea5d30d155cf6970d6dc1b095aafd421ebd8bcc63acf4f64e305c496266b5182f99b815cca5</sha512>
+ <archiveName>ninja-linux.zip</archiveName>
</tool>
<tool name="ninja" os="osx">
- <requiredVersion>1.8.2</requiredVersion>
+ <version>1.8.2</version>
<exeRelativePath>ninja</exeRelativePath>
<url>https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-mac.zip</url>
- <sha256>0347d55c66061652b26f48769d566761630ffde3143793b29064a57f356542cc</sha256>
- <archiveRelativePath>ninja-mac.zip</archiveRelativePath>
+ <sha512>acadfb286eb7d93676629701917fa0c3c39f36daa068c169e4a098c29f97380d1ea95abfd42b04798ff118fd9dc93fdb250fcda36086bac20bc5506354214fc3</sha512>
+ <archiveName>ninja-mac.zip</archiveName>
</tool>
</tools>