2019-09-19 02:44:55 +00:00
|
|
|
diff --git a/src/terralib.lua b/src/terralib.lua
|
2021-05-16 06:02:00 +00:00
|
|
|
index 532ed18..2c265dc 100644
|
2019-09-19 02:44:55 +00:00
|
|
|
--- a/src/terralib.lua
|
|
|
|
+++ b/src/terralib.lua
|
2021-05-16 06:02:00 +00:00
|
|
|
@@ -3426,6 +3426,16 @@ function terra.includecstring(code,cargs,target)
|
2019-09-19 02:44:55 +00:00
|
|
|
args:insert("-internal-isystem")
|
|
|
|
args:insert(path)
|
|
|
|
end
|
|
|
|
+ -- NOTE(aseipp): include relevant Nix header files
|
2019-09-19 05:26:48 +00:00
|
|
|
+ args:insert("-isystem")
|
|
|
|
+ args:insert("@NIX_LIBC_INCLUDE@")
|
|
|
|
+
|
2019-09-19 02:44:55 +00: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
|
2021-05-16 06:02:00 +00:00
|
|
|
-- Obey the SDKROOT variable on macOS to match Clang behavior.
|
|
|
|
local sdkroot = os.getenv("SDKROOT")
|
|
|
|
if sdkroot then
|