mirror of
https://github.com/ziglang/zig.git
synced 2024-11-10 14:13:00 +00:00
Revert all wiki edits by 10aded
Revert "made important section in 1b bold" This reverts commit e09bf3efda8f837bfa0a290f51facbad14aaf2ab. Revert "made main command clearer" This reverts commit 343c892c4ffa115d570a77839a9cad418a2c77b5. Revert "rewrote beginning of Option 1b to make it super clear what to do" This reverts commit 2db5c5033242e5c11c0d0382c3e479136ccdd31d. Revert "explicitily mentioned that VERSION in the provided Dev Kit URL will need to be changed" This reverts commit 85ded8344c0234a08ea23c16f45ed879d82e2d2f. Revert "made the instructions as to how to determine the url of the Windows Zig Compiler dev kit clearer" This reverts commit bcac039ceda6dc137145b08ee5025d92fe198ca4.
parent
beeb3a0ed3
commit
b376c1aba7
@ -6,14 +6,12 @@
|
||||
|
||||
This one has the benefit that LLVM, LLD, and Clang are built in Release mode, while your Zig build has the option to be a Debug build. It also works completely independently from MSVC so you don't need it to be installed.
|
||||
|
||||
The Dev Kit can be downloaded from a url that has the following form,
|
||||
Determine the URL by [looking at the CI script](https://github.com/ziglang/zig/blob/master/ci/x86_64-windows-debug.ps1#L1-L4). It will look something like this (replace `$VERSION` with the one you see by following the above link):
|
||||
|
||||
```
|
||||
https://ziglang.org/deps/zig+llvm+lld+clang-x86_64-windows-gnu-$VERSION.zip
|
||||
```
|
||||
|
||||
where you will need to replace `$VERSION`. To do this, determine the precise URL by looking at the [CI script](https://github.com/ziglang/zig/blob/master/ci/x86_64-windows-debug.ps1#L1-L4), specifically the variables `$ZIG_LLVM_CLANG_LLD_NAME` and `$ZIG_LLVM_CLANG_LLD_URL` (currently lines 2 and 4).
|
||||
|
||||
This zip file contains:
|
||||
|
||||
* An older Zig installation.
|
||||
@ -58,21 +56,17 @@ This can take a long time. For tips & tricks on using the test suite, see [Contr
|
||||
|
||||
### Option 1b: Zig build
|
||||
|
||||
The Dev Kit contains a Zig compiler that can be used to build Zig from source.
|
||||
Unzip the dev kit and then in cmd.exe in your Zig source checkout:
|
||||
|
||||
First unzip the Dev Kit. Let `$DEVKIT` denote the path to the unzipped Dev Kit. The Zig compiler in the Dev Kit is located at: `$DEVKIT\bin\zig.exe`.
|
||||
|
||||
Now navigate to the source of the compiler you wish to build. Then, using the Dev Kit compiler, attempt to build the compiler from source:
|
||||
|
||||
```
|
||||
```bat
|
||||
$DEVKIT\bin\zig.exe build -p stage3 --search-prefix $DEVKIT --zig-lib-dir lib -Dstatic-llvm -Duse-zig-libcxx -Dtarget=x86_64-windows-gnu
|
||||
```
|
||||
|
||||
NOTE: In the command above, both instances of `$DEVKIT` will need to be substituted with the path to the unzipped Dev Kit.
|
||||
Replace `$DEVKIT` with the path to the folder that you unzipped after downloading it from the link above.
|
||||
|
||||
Append `-Doptimize=ReleaseSafe` for a Release build.
|
||||
|
||||
**You may get a build error during this step.** In such a case, it is most likely that the Zig installation inside the dev kit is too old, and the dev kit needs to be updated. In this case one more step is required:
|
||||
**If you get an error building at this step**, it is most likely that the Zig installation inside the dev kit is too old, and the dev kit needs to be updated. In this case one more step is required:
|
||||
|
||||
1. [Download the latest master branch zip file](https://ziglang.org/download/#release-master).
|
||||
2. Unzip, and try the above command again, replacing the path to zig.exe with the path to the zig.exe you just extracted, and also replace the lib\zig folder with the new contents.
|
||||
|
Loading…
Reference in New Issue
Block a user