Last active
May 12, 2024 17:34
-
-
Save roz3x/5088b370b1288e13fc6b61a75f21da4c to your computer and use it in GitHub Desktop.
zig compile on Mac M1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# make sure you have homebrew already installed | |
brew installed llvm | |
git clone https://github.com/ziglang/zig.git | |
cd zig | |
mkdir -p build | |
cd build | |
# for fast build | |
cmake .. -DCMAKE_PREFIX_PATH="$(brew --prefix llvm);$(brew --prefix zstd)"; make -j12; make install | |
# for optimized build | |
cmake .. -DCMAKE_PREFIX_PATH="$(brew --prefix llvm);$(brew --prefix zstd)" -DZIG_STATIC_LLVM=on -DZIG_NO_LIB=ON -DCMAKE_BUILD_TYPE=Release; make -j12; make install |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment