summaryrefslogtreecommitdiff
path: root/xmake/modules/core/tools/armlink.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2022-10-22 00:53:40 +0800
committerruki <[email protected]>2022-10-22 00:53:40 +0800
commitd8be2a1ca7bbc360a808eb921607fad74095f3cf (patch)
treec5c9c84537cce87ad2ac025b5688b2d0471efc10 /xmake/modules/core/tools/armlink.lua
parentb2d842ab8de497bc5c0949d013adbc03e047e3d9 (diff)
fix armlink for long path #2952
Diffstat (limited to 'xmake/modules/core/tools/armlink.lua')
-rw-r--r--xmake/modules/core/tools/armlink.lua13
1 files changed, 11 insertions, 2 deletions
diff --git a/xmake/modules/core/tools/armlink.lua b/xmake/modules/core/tools/armlink.lua
index e25a81967..fa8a1510f 100644
--- a/xmake/modules/core/tools/armlink.lua
+++ b/xmake/modules/core/tools/armlink.lua
@@ -49,8 +49,17 @@ function nf_runtime(self, runtime)
end
-- make the link arguments list
-function linkargv(self, objectfiles, targetkind, targetfile, flags)
- return self:program(), table.join("-o", targetfile, objectfiles, flags)
+function linkargv(self, objectfiles, targetkind, targetfile, flags, opt)
+ opt = opt or {}
+ local argv = table.join("-o", targetfile, objectfiles, flags)
+ if is_host("windows") and not opt.rawargs then
+ argv = winos.cmdargv(argv, {escape = true})
+ if #argv > 0 and argv[1] and argv[1]:startswith("@") then
+ argv[1] = argv[1]:replace("@", "", {plain = true})
+ table.insert(argv, 1, "--via")
+ end
+ end
+ return self:program(), argv
end
-- link the target file