summaryrefslogtreecommitdiff
path: root/xmake/rules/c++/modules/clang/builder.lua
diff options
context:
space:
mode:
authorArthur LAURENT <[email protected]>2025-05-11 22:04:11 +0200
committerArthur LAURENT <[email protected]>2025-05-11 22:04:11 +0200
commit406aa7ca454fad3ef8872070cbac6efdd7d440e7 (patch)
tree981e5a93416263194a4a0f82ba7c35560adee57d /xmake/rules/c++/modules/clang/builder.lua
parent22fcfc64078f4ad04a9ecf5af30adaf7dae199e5 (diff)
(C++ modules support) make flag order coherent between different compilers
Diffstat (limited to 'xmake/rules/c++/modules/clang/builder.lua')
-rw-r--r--xmake/rules/c++/modules/clang/builder.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/xmake/rules/c++/modules/clang/builder.lua b/xmake/rules/c++/modules/clang/builder.lua
index 9404f4d3d..8d8a240e7 100644
--- a/xmake/rules/c++/modules/clang/builder.lua
+++ b/xmake/rules/c++/modules/clang/builder.lua
@@ -53,6 +53,7 @@ end
function _compile_one_step(target, module, opt)
-- get flags
+ local module_outputflag = support.get_moduleoutputflag(target)
if module_outputflag then
local flags = _make_modulebuildflags(target, module, {bmi = true, objectfile = true})
if opt and opt.batchcmds then
@@ -101,7 +102,7 @@ function _compile(target, flags, sourcefile, outputfile, opt)
local dryrun = option.get("dry-run")
local compinst = target:compiler("cxx")
local compflags = compinst:compflags({sourcefile = sourcefile, target = target, sourcekind = "cxx"})
- flags = table.join(flags or {}, compflags or {})
+ flags = table.join(compflags or {}, flags or {})
local bmifile = opt and opt.bmifile
@@ -122,7 +123,7 @@ function _batchcmds_compile(batchcmds, target, flags, sourcefile, outputfile, op
opt = opt or {}
local compinst = target:compiler("cxx")
local compflags = compinst:compflags({sourcefile = sourcefile, target = target, sourcekind = "cxx"})
- flags = table.join("-c", compflags or {}, flags, {"-o", outputfile, opt.bmifile or sourcefile})
+ flags = table.join("-c", compflags or {}, flags or {}, {"-o", outputfile, opt.bmifile or sourcefile})
batchcmds:compilev(flags, {compiler = compinst, sourcekind = "cxx"})
end