summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2017-11-16 23:59:32 +0800
committerruki <[email protected]>2017-11-16 17:57:13 +0800
commitd6c77c3a850f3c32c4f62ed6bb80015f6326fda1 (patch)
tree7de5b86f805e5f2712ae8d2e2ca676bb0a61d155
parent6ae954995c3796bb89ba8fd1ccc613244090aa02 (diff)
fix object directory
-rw-r--r--xmake/core/project/target.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua
index 87b53c0e7..752459ce1 100644
--- a/xmake/core/project/target.lua
+++ b/xmake/core/project/target.lua
@@ -568,7 +568,11 @@ function target:objectfile(sourcefile)
--
-- we need replace '..' to '__' in this case
--
- local sourcedir = path.directory(sourcefile):gsub("%.%.", "__")
+ local sourcedir = path.directory(sourcefile)
+ if path.is_absolute(sourcedir) then
+ sourcedir = path.relative(sourcedir, objectdir)
+ end
+ sourcedir = sourcedir:gsub("%.%.", "__")
-- make object file
-- full file name(not base) to avoid name-clash of object file