summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmake/modules/core/tools/cosmocc.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/xmake/modules/core/tools/cosmocc.lua b/xmake/modules/core/tools/cosmocc.lua
index c412d287b..68b531a2a 100644
--- a/xmake/modules/core/tools/cosmocc.lua
+++ b/xmake/modules/core/tools/cosmocc.lua
@@ -32,10 +32,22 @@ end
-- link the target file
function link(self, objectfiles, targetkind, targetfile, flags, opt)
+ if is_host("windows") then
+ targetfile = targetfile:gsub("\\", "/")
+ local objectfiles_new = {}
+ for idx, objectfile in ipairs(objectfiles) do
+ objectfiles_new[idx] = objectfiles[idx]:gsub("\\", "/")
+ end
+ objectfiles = objectfiles_new
+ end
return _super.link(self, objectfiles, targetkind, targetfile, flags, table.join(opt, {shell = true}))
end
-- compile the source file
function compile(self, sourcefile, objectfile, dependinfo, flags, opt)
+ if is_host("windows") then
+ sourcefile = sourcefile:gsub("\\", "/")
+ objectfile = objectfile:gsub("\\", "/")
+ end
return _super.compile(self, sourcefile, objectfile, dependinfo, flags, table.join(opt, {shell = true}))
end