mirror of
https://github.com/ziglang/zig.git
synced 2024-11-21 19:42:56 +00:00
change macOS notes to use self-compiled llvm and clang
parent
c8ba6f6039
commit
b9107ef58a
@ -68,11 +68,14 @@ Alternatively, you can use this sample `flake.nix`:
|
||||
|
||||
## Notes for macOS users
|
||||
|
||||
If using macOS, you may need to include the following to properly use nix's clang.
|
||||
If using macOS, you will need to [build llvm yourself](https://github.com/ziglang/zig/wiki/How-to-build-LLVM,-libclang,-and-liblld-from-source) and use the system's clang to build zig. This is possible using the sample `shell.nix` below.
|
||||
|
||||
```nix
|
||||
shellHook = with pkgs.llvmPackages_13; ''
|
||||
export CPATH="${clang}" # Use clang's stdlib
|
||||
export LDFLAGS="-stdlib=libc++ -lc++abi" # Link against the stdlib
|
||||
'';
|
||||
with import <nixpkgs> { };
|
||||
|
||||
pkgs.mkShellNoCC {
|
||||
nativeBuildInputs = with pkgs; [ cmake gdb ninja qemu wasmtime ];
|
||||
|
||||
hardeningDisable = [ "all" ];
|
||||
}
|
||||
```
|
Loading…
Reference in New Issue
Block a user