fix system comparison macOS and iOS
This commit is contained in:
parent
d269416923
commit
7e498376ac
@ -48,7 +48,7 @@
|
||||
local bundlename = ""
|
||||
local bundlepath = ""
|
||||
|
||||
if (cfg.system == p.MACOSX or cfg.system == p.IOS) and (kind == p.WINDOWEDAPP or (kind == p.SHAREDLIB and cfg.sharedlibtype)) then
|
||||
if table.contains(os.getSystemTags(cfg.system), "darwin") and (kind == p.WINDOWEDAPP or (kind == p.SHAREDLIB and cfg.sharedlibtype)) then
|
||||
bundlename = basename .. extension
|
||||
bundlepath = path.join(bundlename, iif(kind == p.SHAREDLIB and cfg.sharedlibtype == "OSXFramework", "Versions/A", "Contents/MacOS"))
|
||||
end
|
||||
|
@ -69,7 +69,7 @@
|
||||
elseif os.istarget("haiku") then
|
||||
path = os.getenv("LIBRARY_PATH") or ""
|
||||
else
|
||||
if os.istarget("macosx") or os.istarget("ios") then
|
||||
if os.istarget("darwin") then
|
||||
path = os.getenv("DYLD_LIBRARY_PATH") or ""
|
||||
else
|
||||
path = os.getenv("LD_LIBRARY_PATH") or ""
|
||||
@ -90,7 +90,7 @@
|
||||
|
||||
path = path or ""
|
||||
local archpath = "/lib:/usr/lib:/usr/local/lib"
|
||||
if os.is64bit() and not (os.istarget("macosx") or os.istarget("ios")) then
|
||||
if os.is64bit() and not (os.istarget("darwin")) then
|
||||
archpath = "/lib64:/usr/lib64/:usr/local/lib64" .. ":" .. archpath
|
||||
end
|
||||
if (#path > 0) then
|
||||
@ -116,7 +116,7 @@
|
||||
elseif os.istarget("haiku") then
|
||||
formats = { "lib%s.so", "%s.so" }
|
||||
else
|
||||
if os.istarget("macosx") or os.istarget("ios") then
|
||||
if os.istarget("darwin") then
|
||||
formats = { "lib%s.dylib", "%s.dylib" }
|
||||
else
|
||||
formats = { "lib%s.so", "%s.so" }
|
||||
|
@ -210,7 +210,7 @@
|
||||
table.insert(r, '-Wl,--out-implib="' .. cfg.linktarget.relpath .. '"')
|
||||
elseif cfg.system == p.LINUX then
|
||||
table.insert(r, '-Wl,-soname=' .. p.quoted(cfg.linktarget.name))
|
||||
elseif cfg.system == p.MACOSX or cfg.system == p.IOS then
|
||||
elseif table.contains(os.getSystemTags(cfg.system), "darwin") then
|
||||
table.insert(r, '-Wl,-install_name,' .. p.quoted('@rpath/' .. cfg.linktarget.name))
|
||||
end
|
||||
return r
|
||||
|
@ -259,7 +259,7 @@
|
||||
function gcc.getrunpathdirs(cfg, dirs)
|
||||
local result = {}
|
||||
|
||||
if not ((cfg.system == p.MACOSX) or (cfg.system == p.IOS)
|
||||
if not (table.contains(os.getSystemTags(cfg.system), "darwin")
|
||||
or (cfg.system == p.LINUX)) then
|
||||
return result
|
||||
end
|
||||
@ -286,7 +286,7 @@
|
||||
end
|
||||
|
||||
for _, rpath in ipairs(rpaths) do
|
||||
if (cfg.system == p.MACOSX) or (cfg.system == p.IOS) then
|
||||
if table.contains(os.getSystemTags(cfg.system), "darwin") then
|
||||
rpath = "@loader_path/" .. rpath
|
||||
elseif (cfg.system == p.LINUX) then
|
||||
rpath = iif(rpath == ".", "", "/" .. rpath)
|
||||
@ -303,7 +303,7 @@
|
||||
-- get the right output flag.
|
||||
--
|
||||
function gcc.getsharedlibarg(cfg)
|
||||
if cfg.system == p.MACOSX or cfg.system == p.IOS then
|
||||
if table.contains(os.getSystemTags(cfg.system), "darwin") then
|
||||
if cfg.sharedlibtype == "OSXBundle" then
|
||||
return "-bundle"
|
||||
elseif cfg.sharedlibtype == "OSXFramework" then
|
||||
@ -323,7 +323,7 @@
|
||||
|
||||
function gcc.ldsymbols(cfg)
|
||||
-- OS X has a bug, see http://lists.apple.com/archives/Darwin-dev/2006/Sep/msg00084.html
|
||||
return iif(cfg.system == p.MACOSX or cfg.system == p.IOS, "-Wl,-x", "-s")
|
||||
return iif(table.contains(os.getSystemTags(cfg.system), "darwin"), "-Wl,-x", "-s")
|
||||
end
|
||||
|
||||
gcc.ldflags = {
|
||||
@ -341,7 +341,7 @@
|
||||
table.insert(r, '-Wl,--out-implib="' .. cfg.linktarget.relpath .. '"')
|
||||
elseif cfg.system == p.LINUX then
|
||||
table.insert(r, '-Wl,-soname=' .. p.quoted(cfg.linktarget.name))
|
||||
elseif cfg.system == p.MACOSX or cfg.system == p.IOS then
|
||||
elseif table.contains(os.getSystemTags(cfg.system), "darwin") then
|
||||
table.insert(r, '-Wl,-install_name,' .. p.quoted('@rpath/' .. cfg.linktarget.name))
|
||||
end
|
||||
return r
|
||||
@ -374,14 +374,14 @@
|
||||
architecture = {
|
||||
x86 = function (cfg)
|
||||
local r = {}
|
||||
if cfg.system ~= p.MACOSX and cfg.system ~= p.IOS then
|
||||
if not table.contains(os.getSystemTags(cfg.system), "darwin") then
|
||||
table.insert (r, "-L/usr/lib32")
|
||||
end
|
||||
return r
|
||||
end,
|
||||
x86_64 = function (cfg)
|
||||
local r = {}
|
||||
if cfg.system ~= p.MACOSX and cfg.system ~= p.IOS then
|
||||
if not table.contains(os.getSystemTags(cfg.system), "darwin") then
|
||||
table.insert (r, "-L/usr/lib64")
|
||||
end
|
||||
return r
|
||||
|
Loading…
Reference in New Issue
Block a user