New upstream version 3.1.1

This commit is contained in:
billchenchina 2022-11-15 08:50:35 +08:00
parent 4e9934e5ec
commit e7b41df57b
229 changed files with 57000 additions and 12055 deletions

45
.ci/build-project.ps1 Normal file
View file

@ -0,0 +1,45 @@
# Build project.
#
# The script assumes that it will be called from inside the project directory.
#
# Usage: .ci\build-project.ps1 [vcpkg-directory [build-directory-name]]
# - vcpkg-directory: Optional full path to Vcpkg directory. Default: $HOME\vcpkg
# - build-directory-name: Optional name of build directory. Default: build.
# Can only be set of vcpkg-directory is set as well.
#
# Example 1: .ci\build-project.ps1
# Example 2: .ci\build-project.ps1 $HOME\vcpkg-clang
# Example 3: .ci\build-project.ps1 $HOME\vcpkg-clang build-clang
$ErrorActionPreference="Stop"
$VCPKG_DIR=$args[0]
$BUILD_DIR=$args[1]
if ($null -eq $VCPKG_DIR) { $VCPKG_DIR="$HOME\vcpkg" }
if ($null -eq $BUILD_DIR) { $BUILD_DIR="build" }
# only pass toolchain file to CMake if Vcpkg is installed
if (Test-Path "$VCPKG_DIR" -PathType Container) {
$TOOLCHAIN="$VCPKG_DIR\scripts\buildsystems\vcpkg.cmake"
} else {
$TOOLCHAIN="False"
}
Write-Host "---- build-project.ps1 ----"
Write-Host "VCPKG_DIR: $VCPKG_DIR"
Write-Host "BUILD_DIR: $BUILD_DIR"
Write-Host "CMAKE_TOOLCHAIN_FILE: $TOOLCHAIN"
Write-Host "---------------------------"
if (-not (Get-Command cmake -ErrorAction SilentlyContinue)) {
New-Alias -Name cmake -Value "$Env:ProgramFiles\CMake\bin\cmake.exe"
}
New-Item -Name $BUILD_DIR -ItemType Directory
Push-Location $BUILD_DIR
$ErrorActionPreference = "Stop";
cmake -DCMAKE_BUILD_TYPE=Release -DVCPKG_TARGET_TRIPLET=x64-windows -DCMAKE_TOOLCHAIN_FILE="$TOOLCHAIN" ..
cmake --build . --config Release
if ($LASTEXITCODE) { Throw "BUILD FAILED!" }
Pop-Location

38
.ci/install-vcpkg.ps1 Normal file
View file

@ -0,0 +1,38 @@
# Build Vcpkg and install dependency packages.
#
# Usage: .ci\install-vcpkg.ps1 <project directory> [vcpkg directory name]
# - project directory: Path to the project sources where the .vcpkg file is located.
# - vcpkg directory name: optional name of directory where Vcpkg will be clone'd into
#
# Example 1: .ci\install-vcpkg.ps1 $Env:GITHUB_WORKSPACE
# Example 2: .ci\install-vcpkg.ps1 $Env:APPVEYOR_BUILD_FOLDER vcpkg-msvc
$ErrorActionPreference="Stop"
if ($args.Count -lt 1) { Exit 1 }
$PROJECT_DIR=$args[0]
$VCPKG_DIR=$args[1]
if ($null -eq $VCPKG_DIR) { $VCPKG_DIR="vcpkg" }
# do nothing if .vcpkg file doesn't exist
if (-not (Test-Path "$PROJECT_DIR\.vcpkg" -PathType Leaf)) { Write-Host ".vcpkg file does not exist, skipping Vcpkg installation."; Exit 0 }
Write-Host "---- install-vcpkg.ps1 ----"
Write-Host "PROJECT_DIR: $PROJECT_DIR"
Write-Host "VCPKG_DIR: $VCPKG_DIR"
Write-Host "---------------------------"
if (-not (Get-Command git -ErrorAction SilentlyContinue)) {
New-Alias -Name git -Value "$Env:ProgramFiles\Git\bin\git.exe"
}
Push-Location "$HOME"
git clone --quiet --depth 1 https://github.com/Microsoft/vcpkg.git $VCPKG_DIR
Set-Location $VCPKG_DIR
.\bootstrap-vcpkg.bat -disableMetrics
$packages = Get-Content "$PROJECT_DIR\.vcpkg"
.\vcpkg.exe install --triplet x64-windows $packages
Pop-Location