summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUE4SS <[email protected]>2024-12-02 12:20:15 +0100
committerUE4SS <[email protected]>2024-12-02 12:39:12 +0100
commitdc9e1260063bb92d80a9ec9925bf19b6cc0bfb1e (patch)
tree7ce2749011cbbb268669ea5ed0036511417cd6ca
parent3a7e44a68f05137631141d4b2b8f6a5e2c5641a2 (diff)
Fix /sourceDependencies <path> not on one line when using msvc-wine
-rw-r--r--xmake/core/base/winos.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/xmake/core/base/winos.lua b/xmake/core/base/winos.lua
index 30a2d1eba..f2bc7b7d4 100644
--- a/xmake/core/base/winos.lua
+++ b/xmake/core/base/winos.lua
@@ -188,7 +188,11 @@ function winos.cmdargv(argv, opt)
-- -Dxxx
-- foo.obj
--
- if idx + 1 <= #argv and arg:find("^[-/]") and not arg1:find("^[-/]") then
+
+ -- if host is not Windows, paths may start with '/', which conflicts with '/<argname>'
+ -- note that checking if the next argument ends with '.json' will only work for /sourceDependencies
+ -- other arguments will remain broken, perhaps we should discuss a better solution
+ if idx + 1 <= #argv and arg:find("^[-/]") and (os.is_host("windows") and (not arg1:find("^[-/]")) or (arg1:find("%.json$"))) then
f:write(os.args(arg, {escape = opt.escape}) .. " ")
f:write(os.args(arg1, {escape = opt.escape}) .. "\n")
idx = idx + 2