diff options
| author | ruki <[email protected]> | 2024-02-06 22:35:17 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2024-02-06 22:35:17 +0800 |
| commit | 7dd4614a455be4d24ef6d8796f053f250bf92c39 (patch) | |
| tree | 9f1102ea5a5ebfeaede71194b00e6f5bee9298a2 | |
| parent | 1328e9a90cbc4be7d3019539226c61f3d7eccac6 (diff) | |
fix windows files path
| -rw-r--r-- | xmake/modules/core/tools/cosmocc.lua | 12 |
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 |
