summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2024-06-05 16:39:56 +0800
committerGitHub <[email protected]>2024-06-05 16:39:56 +0800
commit5c2b2d655df07ded0361d200c65961694af0a663 (patch)
treecdea5056e145319faca6f28b4d5e51a28d2af02e
parentab97f33e9a4bf38049c84ac03eafd3898f82ba3e (diff)
parentd70a24d9daf8c829ad2c949076d6bc2e50676a86 (diff)
Merge pull request #5193 from xmake-io/dmd
Improve dmd linkargv #5192
-rw-r--r--xmake/modules/core/tools/dmd.lua9
1 files changed, 7 insertions, 2 deletions
diff --git a/xmake/modules/core/tools/dmd.lua b/xmake/modules/core/tools/dmd.lua
index 182c2ce04..4a14acfac 100644
--- a/xmake/modules/core/tools/dmd.lua
+++ b/xmake/modules/core/tools/dmd.lua
@@ -173,7 +173,8 @@ function nf_rpathdir(self, dir)
end
-- make the link arguments list
-function linkargv(self, objectfiles, targetkind, targetfile, flags)
+function linkargv(self, objectfiles, targetkind, targetfile, flags, opt)
+ opt = opt or {}
-- add rpath for dylib (macho), e.g. -install_name @rpath/file.dylib
local flags_extra = {}
@@ -183,7 +184,11 @@ function linkargv(self, objectfiles, targetkind, targetfile, flags)
end
-- init arguments
- return self:program(), table.join(flags, flags_extra, "-of" .. targetfile, objectfiles)
+ local argv = table.join(flags, flags_extra, "-of" .. targetfile, objectfiles)
+ if is_host("windows") and not opt.rawargs then
+ argv = winos.cmdargv(argv, {escape = true})
+ end
+ return self:program(), argv
end
-- link the target file