diff options
| -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 |
