Fix relative paths to target dependencies
This commit is contained in:
parent
63a2f3fe60
commit
1bd66554bd
@ -36,6 +36,7 @@
|
||||
for _, prj in ipairs(deps) do
|
||||
local prjcfg = premake.getconfig(prj, cfg.name)
|
||||
local target = premake.gettargetfile(prjcfg, "target", prjcfg.kind, iif(prjcfg.kind == "StaticLib", "linux", nil))
|
||||
target = path.rebase(target, prjcfg.location, cfg.location)
|
||||
table.insert(result, _MAKE.esc(target))
|
||||
end
|
||||
return result
|
||||
|
@ -170,11 +170,7 @@
|
||||
target = prjcfg.target
|
||||
end
|
||||
|
||||
-- target is currently relative to its project location, make
|
||||
-- it relative to my location instead
|
||||
target = path.getabsolute(path.join(prjcfg.location, target))
|
||||
target = path.getrelative(cfg.location, target)
|
||||
|
||||
target = path.rebase(target, prjcfg.location, cfg.location)
|
||||
table.insert(libs, target)
|
||||
else
|
||||
if (range ~= "siblings") then
|
||||
|
@ -97,6 +97,18 @@
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Takes a path which is relative to one location and makes it relative
|
||||
-- to another location instead.
|
||||
--
|
||||
|
||||
function path.rebase(p, oldbase, newbase)
|
||||
p = path.getabsolute(path.join(oldbase, p))
|
||||
p = path.getrelative(newbase, p)
|
||||
return p
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Returns the relative path from src to dest.
|
||||
--
|
||||
|
Reference in New Issue
Block a user