change macOS notes to use self-compiled llvm and clang

devins2518 2022-06-06 22:20:16 -05:00
parent c8ba6f6039
commit b9107ef58a

@ -68,11 +68,14 @@ Alternatively, you can use this sample `flake.nix`:
## Notes for macOS users ## 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 ```nix
shellHook = with pkgs.llvmPackages_13; '' with import <nixpkgs> { };
export CPATH="${clang}" # Use clang's stdlib
export LDFLAGS="-stdlib=libc++ -lc++abi" # Link against the stdlib pkgs.mkShellNoCC {
''; nativeBuildInputs = with pkgs; [ cmake gdb ninja qemu wasmtime ];
hardeningDisable = [ "all" ];
}
``` ```