From 152c7aca7fc28916ae38e00ff2a48dc69b1f0558 Mon Sep 17 00:00:00 2001 From: ruki Date: Tue, 4 Jul 2017 17:46:03 +0800 Subject: fix object file path --- xmake/core/project/target.lua | 11 ++++------- 1 file 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 -- cgit v1.3.1