8ac5e011d6
GitOrigin-RevId: 2c3273caa153ee8eb5786bc8141b85b859e7efd7
22 lines
634 B
Diff
22 lines
634 B
Diff
diff --git a/src/terralib.lua b/src/terralib.lua
|
|
index 351238d..e638c90 100644
|
|
--- a/src/terralib.lua
|
|
+++ b/src/terralib.lua
|
|
@@ -3395,6 +3395,17 @@ function terra.includecstring(code,cargs,target)
|
|
args:insert("-internal-isystem")
|
|
args:insert(path)
|
|
end
|
|
+
|
|
+ -- NOTE(aseipp): include relevant Nix header files
|
|
+ args:insert("-isystem")
|
|
+ args:insert("@NIX_LIBC_INCLUDE@")
|
|
+
|
|
+ local nix_cflags = os.getenv('NIX_CFLAGS_COMPILE')
|
|
+ if nix_cflags ~= nil then
|
|
+ for w in nix_cflags:gmatch("%S+") do
|
|
+ args:insert(w)
|
|
+ end
|
|
+ end
|
|
|
|
if cargs then
|
|
args:insertall(cargs)
|