Skip to content

Commit

Permalink
fix object file path bug
Browse files Browse the repository at this point in the history
  • Loading branch information
waruqi committed Nov 27, 2015
1 parent 834f71c commit 8b47028
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion xmake/scripts/base/rule.lua
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,22 @@ function rule.objectfiles(target_name, target, sourcefiles, buildir)
-- make object file
local objectfile = string.format("%s/%s/%s/%s", objectdir, target_name, path.directory(sourcefile), rule.filename(path.basename(sourcefile), "object"))

-- translate path
--
-- .e.g
--
-- src/xxx.c
-- project/xmake.lua
-- build/.objs
--
-- objectfile: project/build/.objs/xxxx/../../xxx.c will be out of range for objectdir
--
-- we need replace '..' to '__' in this case
--
objectfile = (path.translate(objectfile):gsub("%.%.", "__"))

-- save it
objectfiles[i] = path.translate(objectfile)
objectfiles[i] = objectfile
i = i + 1

end
Expand Down

0 comments on commit 8b47028

Please sign in to comment.