|
1 | 1 | $TARGET = "$($Env:ARCH)-windows-gnu" |
2 | 2 | $ZIG_LLVM_CLANG_LLD_NAME = "zig+llvm+lld+clang-$TARGET-0.12.0-dev.2073+402fe565a" |
3 | 3 | $MCPU = "baseline" |
4 | | -$ZIG_LLVM_CLANG_LLD_URL = "https://ziglang.org/deps/$ZIG_LLVM_CLANG_LLD_NAME.zip" |
5 | | -$PREFIX_PATH = "$(Get-Location)\$ZIG_LLVM_CLANG_LLD_NAME" |
| 4 | +$PREFIX_PATH = "$($Env:USERPROFILE)\$ZIG_LLVM_CLANG_LLD_NAME" |
6 | 5 | $ZIG = "$PREFIX_PATH\bin\zig.exe" |
7 | 6 | $ZIG_LIB_DIR = "$(Get-Location)\lib" |
8 | 7 |
|
9 | | -choco install ninja |
10 | | -Write-Output "Downloading $ZIG_LLVM_CLANG_LLD_URL" |
11 | | -Invoke-WebRequest -Uri "$ZIG_LLVM_CLANG_LLD_URL" -OutFile "$ZIG_LLVM_CLANG_LLD_NAME.zip" |
12 | | - |
13 | | -Write-Output "Extracting..." |
14 | | -Add-Type -AssemblyName System.IO.Compression.FileSystem ; |
15 | | -[System.IO.Compression.ZipFile]::ExtractToDirectory("$PWD/$ZIG_LLVM_CLANG_LLD_NAME.zip", "$PWD") |
16 | | - |
17 | 8 | function CheckLastExitCode { |
18 | 9 | if (!$?) { |
19 | 10 | exit 1 |
@@ -43,6 +34,8 @@ Set-Location -Path 'build-release' |
43 | 34 | -DCMAKE_BUILD_TYPE=Release ` |
44 | 35 | -DCMAKE_C_COMPILER="$($ZIG -Replace "\\", "/");cc;-target;$TARGET;-mcpu=$MCPU" ` |
45 | 36 | -DCMAKE_CXX_COMPILER="$($ZIG -Replace "\\", "/");c++;-target;$TARGET;-mcpu=$MCPU" ` |
| 37 | + -DCMAKE_AR="$($ZIG -Replace "\\", "/")" ` |
| 38 | + -DZIG_AR_WORKAROUND=ON ` |
46 | 39 | -DZIG_TARGET_TRIPLE="$TARGET" ` |
47 | 40 | -DZIG_TARGET_MCPU="$MCPU" ` |
48 | 41 | -DZIG_STATIC=ON ` |
@@ -84,10 +77,10 @@ CheckLastExitCode |
84 | 77 | --mod build_options config.zig |
85 | 78 | CheckLastExitCode |
86 | 79 |
|
87 | | -Import-Module "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\Microsoft.VisualStudio.DevShell.dll" |
| 80 | +Import-Module "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\Tools\Microsoft.VisualStudio.DevShell.dll" |
88 | 81 | CheckLastExitCode |
89 | 82 |
|
90 | | -Enter-VsDevShell -VsInstallPath "C:\Program Files\Microsoft Visual Studio\2022\Enterprise" ` |
| 83 | +Enter-VsDevShell -VsInstallPath "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools" ` |
91 | 84 | -DevCmdArguments '-arch=x64 -no_logo' ` |
92 | 85 | -StartInPath $(Get-Location) |
93 | 86 | CheckLastExitCode |
|
0 commit comments