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