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