mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 14:23:09 +00:00
Revert "CI: revert windows script to master branch version"
This reverts commit 106e9678937a662fec220367d5d57d04eb09b6b7.
This commit is contained in:
parent
53a9ee699a
commit
eb4337fe83
@ -1,20 +1,17 @@
|
|||||||
$TARGET = "$($Env:ARCH)-windows-gnu"
|
$TARGET = "$($Env:ARCH)-windows-gnu"
|
||||||
$ZIG_LLVM_CLANG_LLD_NAME = "zig+llvm+lld+clang-$TARGET-0.11.0-dev.448+e6e459e9e"
|
$ZIG_LLVM_CLANG_LLD_NAME = "zig+llvm+lld+clang-$TARGET-0.11.0-dev.448+e6e459e9e"
|
||||||
|
$MCPU = "baseline"
|
||||||
$ZIG_LLVM_CLANG_LLD_URL = "https://ziglang.org/deps/$ZIG_LLVM_CLANG_LLD_NAME.zip"
|
$ZIG_LLVM_CLANG_LLD_URL = "https://ziglang.org/deps/$ZIG_LLVM_CLANG_LLD_NAME.zip"
|
||||||
|
$PREFIX_PATH = "$(Get-Location)\$ZIG_LLVM_CLANG_LLD_NAME"
|
||||||
|
$ZIG = "$PREFIX_PATH\bin\zig.exe"
|
||||||
|
|
||||||
Write-Output "Downloading $ZIG_LLVM_CLANG_LLD_URL"
|
Write-Output "Downloading $ZIG_LLVM_CLANG_LLD_URL"
|
||||||
|
|
||||||
Invoke-WebRequest -Uri "$ZIG_LLVM_CLANG_LLD_URL" -OutFile "$ZIG_LLVM_CLANG_LLD_NAME.zip"
|
Invoke-WebRequest -Uri "$ZIG_LLVM_CLANG_LLD_URL" -OutFile "$ZIG_LLVM_CLANG_LLD_NAME.zip"
|
||||||
|
|
||||||
Write-Output "Extracting..."
|
Write-Output "Extracting..."
|
||||||
|
|
||||||
Add-Type -AssemblyName System.IO.Compression.FileSystem ;
|
Add-Type -AssemblyName System.IO.Compression.FileSystem ;
|
||||||
[System.IO.Compression.ZipFile]::ExtractToDirectory("$PWD/$ZIG_LLVM_CLANG_LLD_NAME.zip", "$PWD")
|
[System.IO.Compression.ZipFile]::ExtractToDirectory("$PWD/$ZIG_LLVM_CLANG_LLD_NAME.zip", "$PWD")
|
||||||
|
|
||||||
Set-Variable -Name ZIGLIBDIR -Value "$(Get-Location)\lib"
|
|
||||||
Set-Variable -Name ZIGINSTALLDIR -Value "$(Get-Location)\stage3-release"
|
|
||||||
Set-Variable -Name ZIGPREFIXPATH -Value "$(Get-Location)\$ZIG_LLVM_CLANG_LLD_NAME"
|
|
||||||
|
|
||||||
function CheckLastExitCode {
|
function CheckLastExitCode {
|
||||||
if (!$?) {
|
if (!$?) {
|
||||||
exit 1
|
exit 1
|
||||||
@ -31,32 +28,41 @@ if ((git rev-parse --is-shallow-repository) -eq "true") {
|
|||||||
git fetch --unshallow # `git describe` won't work on a shallow repo
|
git fetch --unshallow # `git describe` won't work on a shallow repo
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Output "Building Zig..."
|
Write-Output "Building from source..."
|
||||||
|
Remove-Item -Path 'build-release' -Recurse -Force -ErrorAction Ignore
|
||||||
|
New-Item -Path 'build-release' -ItemType Directory
|
||||||
|
Set-Location -Path 'build-release'
|
||||||
|
|
||||||
& "$ZIGPREFIXPATH\bin\zig.exe" build `
|
# CMake gives a syntax error when file paths with backward slashes are used.
|
||||||
--prefix "$ZIGINSTALLDIR" `
|
# Here, we use forward slashes only to work around this.
|
||||||
--search-prefix "$ZIGPREFIXPATH" `
|
& cmake .. `
|
||||||
--zig-lib-dir "$ZIGLIBDIR" `
|
-GNinja `
|
||||||
-Dstatic-llvm `
|
-DCMAKE_INSTALL_PREFIX="stage3-release" `
|
||||||
-Drelease `
|
-DCMAKE_PREFIX_PATH="$($PREFIX_PATH -Replace "\\", "/")" `
|
||||||
-Duse-zig-libcxx `
|
-DCMAKE_BUILD_TYPE=Release `
|
||||||
-Dtarget="$TARGET"
|
-DCMAKE_C_COMPILER="$($ZIG -Replace "\\", "/");cc;-target;$TARGET;-mcpu=$MCPU" `
|
||||||
|
-DCMAKE_CXX_COMPILER="$($ZIG -Replace "\\", "/");c++;-target;$TARGET;-mcpu=$MCPU" `
|
||||||
|
-DZIG_TARGET_TRIPLE="$TARGET" `
|
||||||
|
-DZIG_TARGET_MCPU="$MCPU" `
|
||||||
|
-DZIG_STATIC=ON
|
||||||
CheckLastExitCode
|
CheckLastExitCode
|
||||||
|
|
||||||
Write-Output " zig build test docs..."
|
ninja install
|
||||||
|
CheckLastExitCode
|
||||||
|
|
||||||
& "$ZIGINSTALLDIR\bin\zig.exe" build test docs `
|
Write-Output "Main test suite..."
|
||||||
--search-prefix "$ZIGPREFIXPATH" `
|
& "stage3-release\bin\zig.exe" build test docs `
|
||||||
|
--zig-lib-dir "..\lib" `
|
||||||
|
--search-prefix "../$ZIG_LLVM_CLANG_LLD_NAME" `
|
||||||
-Dstatic-llvm `
|
-Dstatic-llvm `
|
||||||
-Dskip-non-native `
|
-Dskip-non-native `
|
||||||
-Denable-symlinks-windows
|
-Denable-symlinks-windows
|
||||||
CheckLastExitCode
|
CheckLastExitCode
|
||||||
|
|
||||||
# Produce the experimental std lib documentation.
|
Write-Output "Testing Autodocs..."
|
||||||
Write-Output "zig test std/std.zig..."
|
& "stage3-release\bin\zig.exe" test "..\lib\std\std.zig" `
|
||||||
|
--zig-lib-dir "..\lib" `
|
||||||
& "$ZIGINSTALLDIR\bin\zig.exe" test "$ZIGLIBDIR\std\std.zig" `
|
|
||||||
--zig-lib-dir "$ZIGLIBDIR" `
|
|
||||||
-femit-docs `
|
-femit-docs `
|
||||||
-fno-emit-bin
|
-fno-emit-bin
|
||||||
CheckLastExitCode
|
CheckLastExitCode
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user