blade-formatter: 1.42.0 -> 1.42.1 (#376873)
[NixPkgs.git] / pkgs / development / compilers / terra / nix-cflags.patch
blob90ba7e63f1d0d74adbc4ea53f051f20da330dbd8
1 diff --git a/src/terralib.lua b/src/terralib.lua
2 index 532ed18..2c265dc 100644
3 --- a/src/terralib.lua
4 +++ b/src/terralib.lua
5 @@ -3426,6 +3426,16 @@ function terra.includecstring(code,cargs,target)
6 args:insert("-internal-isystem")
7 args:insert(path)
8 end
9 + -- NOTE(aseipp): include relevant Nix header files
10 + args:insert("-isystem")
11 + args:insert("@NIX_LIBC_INCLUDE@")
13 + local nix_cflags = os.getenv('NIX_CFLAGS_COMPILE')
14 + if nix_cflags ~= nil then
15 + for w in nix_cflags:gmatch("%S+") do
16 + args:insert(w)
17 + end
18 + end
19 -- Obey the SDKROOT variable on macOS to match Clang behavior.
20 local sdkroot = os.getenv("SDKROOT")
21 if sdkroot then