terralang / terra

Terra is a low-level system programming language that is embedded in and meta-programmed by the Lua programming language.
terralang.org
Other
2.71k stars 197 forks source link

Cannot find system headers on macos apple silicon #657

Open renehiemstra opened 3 months ago

renehiemstra commented 3 months ago

I get an error that the system headers are not found when including them using terralib.includec(...).

I am running on macos Sonoma 14.4.1 using an M3. My C++ compiler is AppleClang 15.0.0.15000309. I can reproduce the issue for different versions of llvm, ranging from 13-17.

commenting out the following lines in terralib.lua solves the issue for me

-- Obey the SDKROOT variable on macOS to match Clang behavior.
local sdkroot = os.getenv("SDKROOT")
if sdkroot then
    args:insert("-isysroot")
    args:insert(sdkroot)
end