2019-09-19 03:44:55 +01:00
|
|
|
diff --git a/src/terralib.lua b/src/terralib.lua
|
2019-09-19 06:26:48 +01:00
|
|
|
index 351238d..e638c90 100644
|
2019-09-19 03:44:55 +01:00
|
|
|
--- a/src/terralib.lua
|
|
|
|
+++ b/src/terralib.lua
|
2019-09-19 06:26:48 +01:00
|
|
|
@@ -3395,6 +3395,17 @@ function terra.includecstring(code,cargs,target)
|
2019-09-19 03:44:55 +01:00
|
|
|
args:insert("-internal-isystem")
|
|
|
|
args:insert(path)
|
|
|
|
end
|
|
|
|
+
|
|
|
|
+ -- NOTE(aseipp): include relevant Nix header files
|
2019-09-19 06:26:48 +01:00
|
|
|
+ args:insert("-isystem")
|
|
|
|
+ args:insert("@NIX_LIBC_INCLUDE@")
|
|
|
|
+
|
2019-09-19 03:44:55 +01:00
|
|
|
+ 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)
|