diff options
| author | ruki <[email protected]> | 2025-11-22 00:41:38 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-11-22 00:41:38 +0800 |
| commit | 230c33e5a03047733c309d8208b72b00f6574559 (patch) | |
| tree | 974935b3eea96970845ff8e4e4f4467af79632b3 | |
| parent | b68aca8d7221f6554e04884c289d50eba6f54ad0 (diff) | |
improve compargv
| -rw-r--r-- | xmake/modules/core/tools/cl.lua | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/xmake/modules/core/tools/cl.lua b/xmake/modules/core/tools/cl.lua index 7d14d56fb..de64df3da 100644 --- a/xmake/modules/core/tools/cl.lua +++ b/xmake/modules/core/tools/cl.lua @@ -661,16 +661,17 @@ function compargv(self, sourcefile, objectfile, flags, opt) return _compargv_pch(self, sourcefile, objectfile, flags) end - -- make the compile arguments list - local argv = table.join("-c", flags, "-Fo" .. objectfile, sourcefile) - -- suppress clang-cl warnings -- clang-cl: warning: argument unused during compilation: '-c' [-Wunused-command-line-argument] -- -- @see https://github.com/xmake-io/xmake/issues/7049 - if self:name() == "clang_cl" and objectfile:endswith(".pcm") then - table.remove(argv, 1) + local argv = {} + if not (self:name() == "clang_cl" and objectfile:endswith(".pcm")) then + table.insert(argv, "-c") end + + -- make the compile arguments list + table.join2(argv, flags, "-Fo" .. objectfile, sourcefile) return self:program(), (opt and opt.rawargs) and argv or winos.cmdargv(argv) end |
