summaryrefslogtreecommitdiff
path: root/xmake/modules/core/tools/gcc.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2020-05-27 22:32:14 +0800
committerruki <[email protected]>2020-05-27 09:13:27 +0800
commit19543006bae204763ea5922f883f279c6038f499 (patch)
tree14fa0ef0f238a912180394b603aadec931fc8b92 /xmake/modules/core/tools/gcc.lua
parent7690eaf09fd10101d67c10f8fdbf3fc0f02992fe (diff)
improve cmdargv for win
Diffstat (limited to 'xmake/modules/core/tools/gcc.lua')
-rw-r--r--xmake/modules/core/tools/gcc.lua15
1 files changed, 4 insertions, 11 deletions
diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua
index 912519316..1df869751 100644
--- a/xmake/modules/core/tools/gcc.lua
+++ b/xmake/modules/core/tools/gcc.lua
@@ -310,21 +310,14 @@ function linkargv(self, objectfiles, targetkind, targetfile, flags, opt)
-- add `-Wl,--out-implib,outputdir/libxxx.a` for xxx.dll on mingw/gcc
if targetkind == "shared" and is_plat("mingw") then
- table.insert(flags_extra, "-Wl,--out-implib," .. os.args(path.join(path.directory(targetfile), path.basename(targetfile) .. ".lib")))
+ table.insert(flags_extra, "-Wl,--out-implib," .. path.join(path.directory(targetfile), path.basename(targetfile) .. ".lib"))
end
-- init arguments
+ opt = opt or {}
local argv = table.join("-o", targetfile, objectfiles, flags, flags_extra)
-
- -- too long arguments for windows?
- if is_host("windows") then
- opt = opt or {}
- local args = os.args(argv, {escape = true})
- if #args > 1024 and not opt.rawargs then
- local argsfile = os.tmpfile(args) .. ".args.txt"
- io.writefile(argsfile, args)
- argv = {"@" .. argsfile}
- end
+ if is_host("windows") and not opt.rawargs then
+ argv = winos.cmdargv(argv)
end
return self:program(), argv
end