summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2017-07-04 17:46:03 +0800
committerruki <[email protected]>2017-07-04 17:46:03 +0800
commit152c7aca7fc28916ae38e00ff2a48dc69b1f0558 (patch)
tree485f89965f41918adc87a56f4fd692b7586ac70f
parent347b05c2c2b249c482f746ae2d7b4d72861e7501 (diff)
fix object file path
-rw-r--r--xmake/core/project/target.lua11
1 files changed, 4 insertions, 7 deletions
diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua
index ce84f5714..ebc778c3a 100644
--- a/xmake/core/project/target.lua
+++ b/xmake/core/project/target.lua
@@ -385,10 +385,6 @@ function target:objectfile(sourcefile)
local objectdir = self:objectdir()
assert(objectdir and type(objectdir) == "string")
- -- make object file
- -- full file name(not base) to avoid name-clash of object file
- local objectfile = string.format("%s/%s/%s/%s", objectdir, self:name(), path.directory(sourcefile), target.filename(path.filename(sourcefile), "object"))
-
-- translate path
--
-- .e.g
@@ -401,10 +397,11 @@ function target:objectfile(sourcefile)
--
-- we need replace '..' to '__' in this case
--
- objectfile = (path.translate(objectfile):gsub("%.%.", "__"))
+ local sourcedir = path.directory(sourcefile):gsub("%.%.", "__")
- -- ok?
- return objectfile
+ -- make object file
+ -- full file name(not base) to avoid name-clash of object file
+ return string.format("%s/%s/%s/%s", objectdir, self:name(), sourcedir, target.filename(path.filename(sourcefile), "object"))
end
-- get the object files