mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
ci: add self-hosted x86_64 windows
This commit is contained in:
parent
425e38b6e0
commit
71ccdb5a66
10 changed files with 48 additions and 62 deletions
4
.github/workflows/ci.yaml
vendored
4
.github/workflows/ci.yaml
vendored
|
|
@ -69,7 +69,7 @@ jobs:
|
||||||
- name: Build and Test
|
- name: Build and Test
|
||||||
run: ci/aarch64-macos-release.sh
|
run: ci/aarch64-macos-release.sh
|
||||||
x86_64-windows-debug:
|
x86_64-windows-debug:
|
||||||
runs-on: windows-latest
|
runs-on: [self-hosted, Windows, x86_64]
|
||||||
env:
|
env:
|
||||||
ARCH: "x86_64"
|
ARCH: "x86_64"
|
||||||
steps:
|
steps:
|
||||||
|
|
@ -78,7 +78,7 @@ jobs:
|
||||||
- name: Build and Test
|
- name: Build and Test
|
||||||
run: ci/x86_64-windows-debug.ps1
|
run: ci/x86_64-windows-debug.ps1
|
||||||
x86_64-windows-release:
|
x86_64-windows-release:
|
||||||
runs-on: windows-latest
|
runs-on: [self-hosted, Windows, x86_64]
|
||||||
env:
|
env:
|
||||||
ARCH: "x86_64"
|
ARCH: "x86_64"
|
||||||
steps:
|
steps:
|
||||||
|
|
|
||||||
|
|
@ -29,8 +29,8 @@ cd build-debug
|
||||||
# Override the cache directories because they won't actually help other CI runs
|
# Override the cache directories because they won't actually help other CI runs
|
||||||
# which will be testing alternate versions of zig, and ultimately would just
|
# which will be testing alternate versions of zig, and ultimately would just
|
||||||
# fill up space on the hard drive for no reason.
|
# fill up space on the hard drive for no reason.
|
||||||
export ZIG_GLOBAL_CACHE_DIR="$(pwd)/zig-global-cache"
|
export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"
|
||||||
export ZIG_LOCAL_CACHE_DIR="$(pwd)/zig-local-cache"
|
export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache"
|
||||||
|
|
||||||
cmake .. \
|
cmake .. \
|
||||||
-DCMAKE_INSTALL_PREFIX="stage3-debug" \
|
-DCMAKE_INSTALL_PREFIX="stage3-debug" \
|
||||||
|
|
@ -67,7 +67,7 @@ stage3-debug/bin/zig build test docs \
|
||||||
-Dstatic-llvm \
|
-Dstatic-llvm \
|
||||||
-Dtarget=native-native-musl \
|
-Dtarget=native-native-musl \
|
||||||
--search-prefix "$PREFIX" \
|
--search-prefix "$PREFIX" \
|
||||||
--zig-lib-dir "$(pwd)/../lib"
|
--zig-lib-dir "$PWD/../lib"
|
||||||
|
|
||||||
# Look for HTML errors.
|
# Look for HTML errors.
|
||||||
# TODO: move this to a build.zig flag (-Denable-tidy)
|
# TODO: move this to a build.zig flag (-Denable-tidy)
|
||||||
|
|
@ -80,8 +80,8 @@ rm -rf ../build-new
|
||||||
mkdir ../build-new
|
mkdir ../build-new
|
||||||
cd ../build-new
|
cd ../build-new
|
||||||
|
|
||||||
export ZIG_GLOBAL_CACHE_DIR="$(pwd)/zig-global-cache"
|
export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"
|
||||||
export ZIG_LOCAL_CACHE_DIR="$(pwd)/zig-local-cache"
|
export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache"
|
||||||
export CC="$ZIG cc -target $TARGET -mcpu=$MCPU"
|
export CC="$ZIG cc -target $TARGET -mcpu=$MCPU"
|
||||||
export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU"
|
export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU"
|
||||||
|
|
||||||
|
|
@ -105,5 +105,5 @@ stage3/bin/zig build -p stage4 \
|
||||||
-Dtarget=native-native-musl \
|
-Dtarget=native-native-musl \
|
||||||
-Dno-lib \
|
-Dno-lib \
|
||||||
--search-prefix "$PREFIX" \
|
--search-prefix "$PREFIX" \
|
||||||
--zig-lib-dir "$(pwd)/../lib"
|
--zig-lib-dir "$PWD/../lib"
|
||||||
stage4/bin/zig test ../test/behavior.zig
|
stage4/bin/zig test ../test/behavior.zig
|
||||||
|
|
|
||||||
|
|
@ -29,8 +29,8 @@ cd build-release
|
||||||
# Override the cache directories because they won't actually help other CI runs
|
# Override the cache directories because they won't actually help other CI runs
|
||||||
# which will be testing alternate versions of zig, and ultimately would just
|
# which will be testing alternate versions of zig, and ultimately would just
|
||||||
# fill up space on the hard drive for no reason.
|
# fill up space on the hard drive for no reason.
|
||||||
export ZIG_GLOBAL_CACHE_DIR="$(pwd)/zig-global-cache"
|
export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"
|
||||||
export ZIG_LOCAL_CACHE_DIR="$(pwd)/zig-local-cache"
|
export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache"
|
||||||
|
|
||||||
cmake .. \
|
cmake .. \
|
||||||
-DCMAKE_INSTALL_PREFIX="stage3-release" \
|
-DCMAKE_INSTALL_PREFIX="stage3-release" \
|
||||||
|
|
@ -67,7 +67,7 @@ stage3-release/bin/zig build test docs \
|
||||||
-Dstatic-llvm \
|
-Dstatic-llvm \
|
||||||
-Dtarget=native-native-musl \
|
-Dtarget=native-native-musl \
|
||||||
--search-prefix "$PREFIX" \
|
--search-prefix "$PREFIX" \
|
||||||
--zig-lib-dir "$(pwd)/../lib"
|
--zig-lib-dir "$PWD/../lib"
|
||||||
|
|
||||||
# Look for HTML errors.
|
# Look for HTML errors.
|
||||||
# TODO: move this to a build.zig flag (-Denable-tidy)
|
# TODO: move this to a build.zig flag (-Denable-tidy)
|
||||||
|
|
@ -80,8 +80,8 @@ rm -rf ../build-new
|
||||||
mkdir ../build-new
|
mkdir ../build-new
|
||||||
cd ../build-new
|
cd ../build-new
|
||||||
|
|
||||||
export ZIG_GLOBAL_CACHE_DIR="$(pwd)/zig-global-cache"
|
export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"
|
||||||
export ZIG_LOCAL_CACHE_DIR="$(pwd)/zig-local-cache"
|
export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache"
|
||||||
export CC="$ZIG cc -target $TARGET -mcpu=$MCPU"
|
export CC="$ZIG cc -target $TARGET -mcpu=$MCPU"
|
||||||
export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU"
|
export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU"
|
||||||
|
|
||||||
|
|
@ -105,5 +105,5 @@ stage3/bin/zig build -p stage4 \
|
||||||
-Dtarget=native-native-musl \
|
-Dtarget=native-native-musl \
|
||||||
-Dno-lib \
|
-Dno-lib \
|
||||||
--search-prefix "$PREFIX" \
|
--search-prefix "$PREFIX" \
|
||||||
--zig-lib-dir "$(pwd)/../lib"
|
--zig-lib-dir "$PWD/../lib"
|
||||||
stage4/bin/zig test ../test/behavior.zig
|
stage4/bin/zig test ../test/behavior.zig
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ set -e
|
||||||
# Script assumes the presence of the following:
|
# Script assumes the presence of the following:
|
||||||
# s3cmd
|
# s3cmd
|
||||||
|
|
||||||
ZIGDIR="$(pwd)"
|
ZIGDIR="$PWD"
|
||||||
TARGET="$ARCH-macos-none"
|
TARGET="$ARCH-macos-none"
|
||||||
MCPU="baseline"
|
MCPU="baseline"
|
||||||
CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.12.0-dev.467+0345d7866"
|
CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.12.0-dev.467+0345d7866"
|
||||||
|
|
@ -26,8 +26,8 @@ cd build
|
||||||
# Override the cache directories because they won't actually help other CI runs
|
# Override the cache directories because they won't actually help other CI runs
|
||||||
# which will be testing alternate versions of zig, and ultimately would just
|
# which will be testing alternate versions of zig, and ultimately would just
|
||||||
# fill up space on the hard drive for no reason.
|
# fill up space on the hard drive for no reason.
|
||||||
export ZIG_GLOBAL_CACHE_DIR="$(pwd)/zig-global-cache"
|
export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"
|
||||||
export ZIG_LOCAL_CACHE_DIR="$(pwd)/zig-local-cache"
|
export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache"
|
||||||
|
|
||||||
PATH="$HOME/local/bin:$PATH" cmake .. \
|
PATH="$HOME/local/bin:$PATH" cmake .. \
|
||||||
-DCMAKE_INSTALL_PREFIX="stage3-debug" \
|
-DCMAKE_INSTALL_PREFIX="stage3-debug" \
|
||||||
|
|
@ -44,7 +44,7 @@ PATH="$HOME/local/bin:$PATH" cmake .. \
|
||||||
$HOME/local/bin/ninja install
|
$HOME/local/bin/ninja install
|
||||||
|
|
||||||
stage3-debug/bin/zig build test docs \
|
stage3-debug/bin/zig build test docs \
|
||||||
--zig-lib-dir "$(pwd)/../lib" \
|
--zig-lib-dir "$PWD/../lib" \
|
||||||
-Denable-macos-sdk \
|
-Denable-macos-sdk \
|
||||||
-Dstatic-llvm \
|
-Dstatic-llvm \
|
||||||
-Dskip-non-native \
|
-Dskip-non-native \
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ set -e
|
||||||
# Script assumes the presence of the following:
|
# Script assumes the presence of the following:
|
||||||
# s3cmd
|
# s3cmd
|
||||||
|
|
||||||
ZIGDIR="$(pwd)"
|
ZIGDIR="$PWD"
|
||||||
TARGET="$ARCH-macos-none"
|
TARGET="$ARCH-macos-none"
|
||||||
MCPU="baseline"
|
MCPU="baseline"
|
||||||
CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.12.0-dev.467+0345d7866"
|
CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.12.0-dev.467+0345d7866"
|
||||||
|
|
@ -26,8 +26,8 @@ cd build
|
||||||
# Override the cache directories because they won't actually help other CI runs
|
# Override the cache directories because they won't actually help other CI runs
|
||||||
# which will be testing alternate versions of zig, and ultimately would just
|
# which will be testing alternate versions of zig, and ultimately would just
|
||||||
# fill up space on the hard drive for no reason.
|
# fill up space on the hard drive for no reason.
|
||||||
export ZIG_GLOBAL_CACHE_DIR="$(pwd)/zig-global-cache"
|
export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"
|
||||||
export ZIG_LOCAL_CACHE_DIR="$(pwd)/zig-local-cache"
|
export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache"
|
||||||
|
|
||||||
PATH="$HOME/local/bin:$PATH" cmake .. \
|
PATH="$HOME/local/bin:$PATH" cmake .. \
|
||||||
-DCMAKE_INSTALL_PREFIX="stage3-release" \
|
-DCMAKE_INSTALL_PREFIX="stage3-release" \
|
||||||
|
|
@ -44,7 +44,7 @@ PATH="$HOME/local/bin:$PATH" cmake .. \
|
||||||
$HOME/local/bin/ninja install
|
$HOME/local/bin/ninja install
|
||||||
|
|
||||||
stage3-release/bin/zig build test docs \
|
stage3-release/bin/zig build test docs \
|
||||||
--zig-lib-dir "$(pwd)/../lib" \
|
--zig-lib-dir "$PWD/../lib" \
|
||||||
-Denable-macos-sdk \
|
-Denable-macos-sdk \
|
||||||
-Dstatic-llvm \
|
-Dstatic-llvm \
|
||||||
-Dskip-non-native \
|
-Dskip-non-native \
|
||||||
|
|
|
||||||
|
|
@ -37,8 +37,8 @@ cd build-debug
|
||||||
# Override the cache directories because they won't actually help other CI runs
|
# Override the cache directories because they won't actually help other CI runs
|
||||||
# which will be testing alternate versions of zig, and ultimately would just
|
# which will be testing alternate versions of zig, and ultimately would just
|
||||||
# fill up space on the hard drive for no reason.
|
# fill up space on the hard drive for no reason.
|
||||||
export ZIG_GLOBAL_CACHE_DIR="$(pwd)/zig-global-cache"
|
export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"
|
||||||
export ZIG_LOCAL_CACHE_DIR="$(pwd)/zig-local-cache"
|
export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache"
|
||||||
|
|
||||||
cmake .. \
|
cmake .. \
|
||||||
-DCMAKE_INSTALL_PREFIX="stage3-debug" \
|
-DCMAKE_INSTALL_PREFIX="stage3-debug" \
|
||||||
|
|
@ -75,7 +75,7 @@ stage3-debug/bin/zig build test docs \
|
||||||
-Dstatic-llvm \
|
-Dstatic-llvm \
|
||||||
-Dtarget=native-native-musl \
|
-Dtarget=native-native-musl \
|
||||||
--search-prefix "$PREFIX" \
|
--search-prefix "$PREFIX" \
|
||||||
--zig-lib-dir "$(pwd)/../lib"
|
--zig-lib-dir "$PWD/../lib"
|
||||||
|
|
||||||
# Look for HTML errors.
|
# Look for HTML errors.
|
||||||
# TODO: move this to a build.zig flag (-Denable-tidy)
|
# TODO: move this to a build.zig flag (-Denable-tidy)
|
||||||
|
|
@ -88,8 +88,8 @@ rm -rf ../build-new
|
||||||
mkdir ../build-new
|
mkdir ../build-new
|
||||||
cd ../build-new
|
cd ../build-new
|
||||||
|
|
||||||
export ZIG_GLOBAL_CACHE_DIR="$(pwd)/zig-global-cache"
|
export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"
|
||||||
export ZIG_LOCAL_CACHE_DIR="$(pwd)/zig-local-cache"
|
export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache"
|
||||||
export CC="$ZIG cc -target $TARGET -mcpu=$MCPU"
|
export CC="$ZIG cc -target $TARGET -mcpu=$MCPU"
|
||||||
export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU"
|
export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU"
|
||||||
|
|
||||||
|
|
@ -113,5 +113,5 @@ stage3/bin/zig build -p stage4 \
|
||||||
-Dtarget=native-native-musl \
|
-Dtarget=native-native-musl \
|
||||||
-Dno-lib \
|
-Dno-lib \
|
||||||
--search-prefix "$PREFIX" \
|
--search-prefix "$PREFIX" \
|
||||||
--zig-lib-dir "$(pwd)/../lib"
|
--zig-lib-dir "$PWD/../lib"
|
||||||
stage4/bin/zig test ../test/behavior.zig
|
stage4/bin/zig test ../test/behavior.zig
|
||||||
|
|
|
||||||
|
|
@ -37,8 +37,8 @@ cd build-release
|
||||||
# Override the cache directories because they won't actually help other CI runs
|
# Override the cache directories because they won't actually help other CI runs
|
||||||
# which will be testing alternate versions of zig, and ultimately would just
|
# which will be testing alternate versions of zig, and ultimately would just
|
||||||
# fill up space on the hard drive for no reason.
|
# fill up space on the hard drive for no reason.
|
||||||
export ZIG_GLOBAL_CACHE_DIR="$(pwd)/zig-global-cache"
|
export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"
|
||||||
export ZIG_LOCAL_CACHE_DIR="$(pwd)/zig-local-cache"
|
export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache"
|
||||||
|
|
||||||
cmake .. \
|
cmake .. \
|
||||||
-DCMAKE_INSTALL_PREFIX="stage3-release" \
|
-DCMAKE_INSTALL_PREFIX="stage3-release" \
|
||||||
|
|
@ -76,7 +76,7 @@ stage3-release/bin/zig build test docs \
|
||||||
-Dstatic-llvm \
|
-Dstatic-llvm \
|
||||||
-Dtarget=native-native-musl \
|
-Dtarget=native-native-musl \
|
||||||
--search-prefix "$PREFIX" \
|
--search-prefix "$PREFIX" \
|
||||||
--zig-lib-dir "$(pwd)/../lib"
|
--zig-lib-dir "$PWD/../lib"
|
||||||
|
|
||||||
# Look for HTML errors.
|
# Look for HTML errors.
|
||||||
# TODO: move this to a build.zig flag (-Denable-tidy)
|
# TODO: move this to a build.zig flag (-Denable-tidy)
|
||||||
|
|
@ -105,8 +105,8 @@ rm -rf ../build-new
|
||||||
mkdir ../build-new
|
mkdir ../build-new
|
||||||
cd ../build-new
|
cd ../build-new
|
||||||
|
|
||||||
export ZIG_GLOBAL_CACHE_DIR="$(pwd)/zig-global-cache"
|
export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"
|
||||||
export ZIG_LOCAL_CACHE_DIR="$(pwd)/zig-local-cache"
|
export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache"
|
||||||
export CC="$ZIG cc -target $TARGET -mcpu=$MCPU"
|
export CC="$ZIG cc -target $TARGET -mcpu=$MCPU"
|
||||||
export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU"
|
export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU"
|
||||||
|
|
||||||
|
|
@ -130,5 +130,5 @@ stage3/bin/zig build -p stage4 \
|
||||||
-Dtarget=native-native-musl \
|
-Dtarget=native-native-musl \
|
||||||
-Dno-lib \
|
-Dno-lib \
|
||||||
--search-prefix "$PREFIX" \
|
--search-prefix "$PREFIX" \
|
||||||
--zig-lib-dir "$(pwd)/../lib"
|
--zig-lib-dir "$PWD/../lib"
|
||||||
stage4/bin/zig test ../test/behavior.zig
|
stage4/bin/zig test ../test/behavior.zig
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
set -x
|
set -x
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
ZIGDIR="$(pwd)"
|
ZIGDIR="$PWD"
|
||||||
TARGET="$ARCH-macos-none"
|
TARGET="$ARCH-macos-none"
|
||||||
MCPU="baseline"
|
MCPU="baseline"
|
||||||
CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.12.0-dev.467+0345d7866"
|
CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.12.0-dev.467+0345d7866"
|
||||||
|
|
@ -40,8 +40,8 @@ cd build
|
||||||
# Override the cache directories because they won't actually help other CI runs
|
# Override the cache directories because they won't actually help other CI runs
|
||||||
# which will be testing alternate versions of zig, and ultimately would just
|
# which will be testing alternate versions of zig, and ultimately would just
|
||||||
# fill up space on the hard drive for no reason.
|
# fill up space on the hard drive for no reason.
|
||||||
export ZIG_GLOBAL_CACHE_DIR="$(pwd)/zig-global-cache"
|
export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"
|
||||||
export ZIG_LOCAL_CACHE_DIR="$(pwd)/zig-local-cache"
|
export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache"
|
||||||
|
|
||||||
cmake .. \
|
cmake .. \
|
||||||
-DCMAKE_PREFIX_PATH="$PREFIX" \
|
-DCMAKE_PREFIX_PATH="$PREFIX" \
|
||||||
|
|
@ -56,7 +56,7 @@ cmake .. \
|
||||||
make $JOBS install
|
make $JOBS install
|
||||||
|
|
||||||
stage3/bin/zig build test docs \
|
stage3/bin/zig build test docs \
|
||||||
--zig-lib-dir "$(pwd)/../lib" \
|
--zig-lib-dir "$PWD/../lib" \
|
||||||
-Denable-macos-sdk \
|
-Denable-macos-sdk \
|
||||||
-Dstatic-llvm \
|
-Dstatic-llvm \
|
||||||
-Dskip-non-native \
|
-Dskip-non-native \
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,10 @@
|
||||||
$TARGET = "$($Env:ARCH)-windows-gnu"
|
$TARGET = "$($Env:ARCH)-windows-gnu"
|
||||||
$ZIG_LLVM_CLANG_LLD_NAME = "zig+llvm+lld+clang-$TARGET-0.12.0-dev.2073+402fe565a"
|
$ZIG_LLVM_CLANG_LLD_NAME = "zig+llvm+lld+clang-$TARGET-0.12.0-dev.2073+402fe565a"
|
||||||
$MCPU = "baseline"
|
$MCPU = "baseline"
|
||||||
$ZIG_LLVM_CLANG_LLD_URL = "https://ziglang.org/deps/$ZIG_LLVM_CLANG_LLD_NAME.zip"
|
$PREFIX_PATH = "$($Env:USERPROFILE)\$ZIG_LLVM_CLANG_LLD_NAME"
|
||||||
$PREFIX_PATH = "$(Get-Location)\$ZIG_LLVM_CLANG_LLD_NAME"
|
|
||||||
$ZIG = "$PREFIX_PATH\bin\zig.exe"
|
$ZIG = "$PREFIX_PATH\bin\zig.exe"
|
||||||
$ZIG_LIB_DIR = "$(Get-Location)\lib"
|
$ZIG_LIB_DIR = "$(Get-Location)\lib"
|
||||||
|
|
||||||
choco install ninja
|
|
||||||
Write-Output "Downloading $ZIG_LLVM_CLANG_LLD_URL"
|
|
||||||
Invoke-WebRequest -Uri "$ZIG_LLVM_CLANG_LLD_URL" -OutFile "$ZIG_LLVM_CLANG_LLD_NAME.zip"
|
|
||||||
|
|
||||||
Write-Output "Extracting..."
|
|
||||||
Add-Type -AssemblyName System.IO.Compression.FileSystem ;
|
|
||||||
[System.IO.Compression.ZipFile]::ExtractToDirectory("$PWD/$ZIG_LLVM_CLANG_LLD_NAME.zip", "$PWD")
|
|
||||||
|
|
||||||
function CheckLastExitCode {
|
function CheckLastExitCode {
|
||||||
if (!$?) {
|
if (!$?) {
|
||||||
exit 1
|
exit 1
|
||||||
|
|
@ -43,6 +34,8 @@ Set-Location -Path 'build-debug'
|
||||||
-DCMAKE_BUILD_TYPE=Debug `
|
-DCMAKE_BUILD_TYPE=Debug `
|
||||||
-DCMAKE_C_COMPILER="$($ZIG -Replace "\\", "/");cc;-target;$TARGET;-mcpu=$MCPU" `
|
-DCMAKE_C_COMPILER="$($ZIG -Replace "\\", "/");cc;-target;$TARGET;-mcpu=$MCPU" `
|
||||||
-DCMAKE_CXX_COMPILER="$($ZIG -Replace "\\", "/");c++;-target;$TARGET;-mcpu=$MCPU" `
|
-DCMAKE_CXX_COMPILER="$($ZIG -Replace "\\", "/");c++;-target;$TARGET;-mcpu=$MCPU" `
|
||||||
|
-DCMAKE_AR="$($ZIG -Replace "\\", "/")" `
|
||||||
|
-DZIG_AR_WORKAROUND=ON `
|
||||||
-DZIG_TARGET_TRIPLE="$TARGET" `
|
-DZIG_TARGET_TRIPLE="$TARGET" `
|
||||||
-DZIG_TARGET_MCPU="$MCPU" `
|
-DZIG_TARGET_MCPU="$MCPU" `
|
||||||
-DZIG_STATIC=ON `
|
-DZIG_STATIC=ON `
|
||||||
|
|
@ -85,10 +78,10 @@ CheckLastExitCode
|
||||||
--mod build_options config.zig
|
--mod build_options config.zig
|
||||||
CheckLastExitCode
|
CheckLastExitCode
|
||||||
|
|
||||||
Import-Module "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"
|
Import-Module "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"
|
||||||
CheckLastExitCode
|
CheckLastExitCode
|
||||||
|
|
||||||
Enter-VsDevShell -VsInstallPath "C:\Program Files\Microsoft Visual Studio\2022\Enterprise" `
|
Enter-VsDevShell -VsInstallPath "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools" `
|
||||||
-DevCmdArguments '-arch=x64 -no_logo' `
|
-DevCmdArguments '-arch=x64 -no_logo' `
|
||||||
-StartInPath $(Get-Location)
|
-StartInPath $(Get-Location)
|
||||||
CheckLastExitCode
|
CheckLastExitCode
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,10 @@
|
||||||
$TARGET = "$($Env:ARCH)-windows-gnu"
|
$TARGET = "$($Env:ARCH)-windows-gnu"
|
||||||
$ZIG_LLVM_CLANG_LLD_NAME = "zig+llvm+lld+clang-$TARGET-0.12.0-dev.2073+402fe565a"
|
$ZIG_LLVM_CLANG_LLD_NAME = "zig+llvm+lld+clang-$TARGET-0.12.0-dev.2073+402fe565a"
|
||||||
$MCPU = "baseline"
|
$MCPU = "baseline"
|
||||||
$ZIG_LLVM_CLANG_LLD_URL = "https://ziglang.org/deps/$ZIG_LLVM_CLANG_LLD_NAME.zip"
|
$PREFIX_PATH = "$($Env:USERPROFILE)\$ZIG_LLVM_CLANG_LLD_NAME"
|
||||||
$PREFIX_PATH = "$(Get-Location)\$ZIG_LLVM_CLANG_LLD_NAME"
|
|
||||||
$ZIG = "$PREFIX_PATH\bin\zig.exe"
|
$ZIG = "$PREFIX_PATH\bin\zig.exe"
|
||||||
$ZIG_LIB_DIR = "$(Get-Location)\lib"
|
$ZIG_LIB_DIR = "$(Get-Location)\lib"
|
||||||
|
|
||||||
choco install ninja
|
|
||||||
Write-Output "Downloading $ZIG_LLVM_CLANG_LLD_URL"
|
|
||||||
Invoke-WebRequest -Uri "$ZIG_LLVM_CLANG_LLD_URL" -OutFile "$ZIG_LLVM_CLANG_LLD_NAME.zip"
|
|
||||||
|
|
||||||
Write-Output "Extracting..."
|
|
||||||
Add-Type -AssemblyName System.IO.Compression.FileSystem ;
|
|
||||||
[System.IO.Compression.ZipFile]::ExtractToDirectory("$PWD/$ZIG_LLVM_CLANG_LLD_NAME.zip", "$PWD")
|
|
||||||
|
|
||||||
function CheckLastExitCode {
|
function CheckLastExitCode {
|
||||||
if (!$?) {
|
if (!$?) {
|
||||||
exit 1
|
exit 1
|
||||||
|
|
@ -43,6 +34,8 @@ Set-Location -Path 'build-release'
|
||||||
-DCMAKE_BUILD_TYPE=Release `
|
-DCMAKE_BUILD_TYPE=Release `
|
||||||
-DCMAKE_C_COMPILER="$($ZIG -Replace "\\", "/");cc;-target;$TARGET;-mcpu=$MCPU" `
|
-DCMAKE_C_COMPILER="$($ZIG -Replace "\\", "/");cc;-target;$TARGET;-mcpu=$MCPU" `
|
||||||
-DCMAKE_CXX_COMPILER="$($ZIG -Replace "\\", "/");c++;-target;$TARGET;-mcpu=$MCPU" `
|
-DCMAKE_CXX_COMPILER="$($ZIG -Replace "\\", "/");c++;-target;$TARGET;-mcpu=$MCPU" `
|
||||||
|
-DCMAKE_AR="$($ZIG -Replace "\\", "/")" `
|
||||||
|
-DZIG_AR_WORKAROUND=ON `
|
||||||
-DZIG_TARGET_TRIPLE="$TARGET" `
|
-DZIG_TARGET_TRIPLE="$TARGET" `
|
||||||
-DZIG_TARGET_MCPU="$MCPU" `
|
-DZIG_TARGET_MCPU="$MCPU" `
|
||||||
-DZIG_STATIC=ON `
|
-DZIG_STATIC=ON `
|
||||||
|
|
@ -84,10 +77,10 @@ CheckLastExitCode
|
||||||
--mod build_options config.zig
|
--mod build_options config.zig
|
||||||
CheckLastExitCode
|
CheckLastExitCode
|
||||||
|
|
||||||
Import-Module "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"
|
Import-Module "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"
|
||||||
CheckLastExitCode
|
CheckLastExitCode
|
||||||
|
|
||||||
Enter-VsDevShell -VsInstallPath "C:\Program Files\Microsoft Visual Studio\2022\Enterprise" `
|
Enter-VsDevShell -VsInstallPath "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools" `
|
||||||
-DevCmdArguments '-arch=x64 -no_logo' `
|
-DevCmdArguments '-arch=x64 -no_logo' `
|
||||||
-StartInPath $(Get-Location)
|
-StartInPath $(Get-Location)
|
||||||
CheckLastExitCode
|
CheckLastExitCode
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue