summaryrefslogtreecommitdiff
path: root/xmake/rules/c++/modules/modules_support
diff options
context:
space:
mode:
authorArthur LAURENT <[email protected]>2024-01-31 14:06:30 +0100
committerArthur LAURENT <[email protected]>2024-01-31 14:06:30 +0100
commita5fb58f0db2bea436f89df71b8b4b3b14af6d5b9 (patch)
tree9927da1a0a4f4fdad5578aa23618daa4beb55e69 /xmake/rules/c++/modules/modules_support
parent0b37f42437f79611c7b30503eaa920a918974dd5 (diff)
improve module cmdline print
Diffstat (limited to 'xmake/rules/c++/modules/modules_support')
-rw-r--r--xmake/rules/c++/modules/modules_support/clang/builder.lua10
-rw-r--r--xmake/rules/c++/modules/modules_support/gcc/builder.lua5
-rw-r--r--xmake/rules/c++/modules/modules_support/msvc/builder.lua7
3 files changed, 13 insertions, 9 deletions
diff --git a/xmake/rules/c++/modules/modules_support/clang/builder.lua b/xmake/rules/c++/modules/modules_support/clang/builder.lua
index 2c17318d4..a7e358d28 100644
--- a/xmake/rules/c++/modules/modules_support/clang/builder.lua
+++ b/xmake/rules/c++/modules/modules_support/clang/builder.lua
@@ -84,16 +84,16 @@ function _compile(target, flags, cppfile)
local flags = table.join(compflags or {}, flags)
-- trace
- vprint(compinst:program(), table.unpack(flags))
+ if option.get("verbose") then
+ print(os.args(table.join(compinst:program(), flags)))
+ end
if not dryrun then
-- do compile
if msvc then
- local _, err = os.iorunv(compinst:program(), flags, {envs = msvc:runenvs()})
- assert(err, err)
+ os.vrunv(compinst:program(), flags, {envs = msvc:runenvs()})
else
- local _, err = os.iorunv(compinst:program(), flags)
- assert(err, err)
+ os.vrunv(compinst:program(), flags)
end
end
end
diff --git a/xmake/rules/c++/modules/modules_support/gcc/builder.lua b/xmake/rules/c++/modules/modules_support/gcc/builder.lua
index 95be560d9..9decbcbf3 100644
--- a/xmake/rules/c++/modules/modules_support/gcc/builder.lua
+++ b/xmake/rules/c++/modules/modules_support/gcc/builder.lua
@@ -75,7 +75,10 @@ function _compile(target, flags, sourcefile, outputfile)
local flags = table.join(compflags or {}, flags)
-- trace
- vprint(compinst:compcmd(sourcefile, outputfile, {compflags = flags, rawargs = true}))
+ if option.get("verbose") then
+ print(compinst:compcmd(sourcefile, outputfile, {compflags = flags, rawargs = true}))
+ end
+
if not dryrun then
-- do compile
diff --git a/xmake/rules/c++/modules/modules_support/msvc/builder.lua b/xmake/rules/c++/modules/modules_support/msvc/builder.lua
index 00326143e..13e40830d 100644
--- a/xmake/rules/c++/modules/modules_support/msvc/builder.lua
+++ b/xmake/rules/c++/modules/modules_support/msvc/builder.lua
@@ -82,12 +82,13 @@ function _compile(target, flags, sourcefile)
local flags = table.join(compflags or {}, flags)
-- trace
- vprint(compinst:program(), table.unpack(flags))
+ if option.get("verbose") then
+ print(os.args(table.join(compinst:program(), flags)))
+ end
if not dryrun then
-- do compile
- local _, err = os.iorunv(compinst:program(), flags, {envs = msvc:runenvs()})
- assert(err, err)
+ os.vrunv(compinst:program(), flags, {envs = msvc:runenvs()})
end
end