Changeset View
Changeset View
Standalone View
Standalone View
build/premake/premake5.lua
Context not available. | |||||
end | end | ||||
end | end | ||||
--[[ | |||||
This test determines whether we need to link libexecinfo In, | |||||
This is mostly true on musl systems, aswell as on BSD systems | |||||
sing only glibc provides the backtrace symbols we require in the libc | |||||
for other libcs we therefore need to use a different library, | |||||
in this case libexecinfo | |||||
]]-- | |||||
local link_execinfo = false | |||||
if os.istarget("bsd") then | |||||
link_execinfo = true | |||||
elseif os.istarget("linux") then | |||||
local _, link_errorCode = os.outputof(cc .. " ./tests/execinfo.c") | |||||
if link_errorCode ~= 0 then | |||||
link_execinfo = true | |||||
end | |||||
end | |||||
-- Set up the Workspace | -- Set up the Workspace | ||||
workspace "pyrogenesis" | workspace "pyrogenesis" | ||||
targetdir(rootdir.."/binaries/system") | targetdir(rootdir.."/binaries/system") | ||||
Context not available. | |||||
links { "log" } | links { "log" } | ||||
end | end | ||||
if link_execinfo then | |||||
links { | |||||
"execinfo" | |||||
} | |||||
end | |||||
if os.istarget("linux") or os.getversion().description == "GNU/kFreeBSD" then | if os.istarget("linux") or os.getversion().description == "GNU/kFreeBSD" then | ||||
links { | links { | ||||
-- Dynamic libraries (needed for linking for gold) | -- Dynamic libraries (needed for linking for gold) | ||||
"dl", | "dl", | ||||
} | } | ||||
elseif os.istarget("bsd") then | |||||
links { | |||||
-- Needed for backtrace* on BSDs | |||||
"execinfo", | |||||
} | |||||
end | end | ||||
-- Threading support | -- Threading support | ||||
Context not available. | |||||
elseif os.istarget("linux") or os.istarget("bsd") then | elseif os.istarget("linux") or os.istarget("bsd") then | ||||
if link_execinfo then | |||||
links { | |||||
"execinfo" | |||||
} | |||||
end | |||||
if not _OPTIONS["android"] and not (os.getversion().description == "OpenBSD") then | if not _OPTIONS["android"] and not (os.getversion().description == "OpenBSD") then | ||||
links { "rt" } | links { "rt" } | ||||
end | end | ||||
Context not available. | |||||
-- Dynamic libraries (needed for linking for gold) | -- Dynamic libraries (needed for linking for gold) | ||||
"dl", | "dl", | ||||
} | } | ||||
elseif os.istarget("bsd") then | |||||
links { | |||||
-- Needed for backtrace* on BSDs | |||||
"execinfo", | |||||
} | |||||
end | end | ||||
-- Threading support | -- Threading support | ||||
Context not available. |
Wildfire Games · Phabricator