summaryrefslogtreecommitdiff
path: root/xmake/rules/c++/modules/modules_support/msvc
diff options
context:
space:
mode:
authorArthur LAURENT <[email protected]>2024-01-30 18:08:17 +0100
committerArthur LAURENT <[email protected]>2024-01-30 19:42:42 +0100
commit8e10652f4f08566ee5c1099d928e75cdefb040d0 (patch)
treedff66a0cc98b6098fdc5945514d20823d84b82c6 /xmake/rules/c++/modules/modules_support/msvc
parenta2ccc580a274200d889d199094e7201076594f0d (diff)
revert last commit
Diffstat (limited to 'xmake/rules/c++/modules/modules_support/msvc')
-rw-r--r--xmake/rules/c++/modules/modules_support/msvc/builder.lua3
-rw-r--r--xmake/rules/c++/modules/modules_support/msvc/dependency_scanner.lua8
2 files changed, 7 insertions, 4 deletions
diff --git a/xmake/rules/c++/modules/modules_support/msvc/builder.lua b/xmake/rules/c++/modules/modules_support/msvc/builder.lua
index 929b0cd5d..8a77a7612 100644
--- a/xmake/rules/c++/modules/modules_support/msvc/builder.lua
+++ b/xmake/rules/c++/modules/modules_support/msvc/builder.lua
@@ -86,7 +86,8 @@ function _compile(target, flags, sourcefile)
if not dryrun then
-- do compile
- try{function() return os.iorunv(compinst:program(), flags, {envs = msvc:runenvs()}) end}
+ local _, err = os.iorunv(compinst:program(), flags, {envs = msvc:runenvs()})
+ assert(err, err)
end
end
diff --git a/xmake/rules/c++/modules/modules_support/msvc/dependency_scanner.lua b/xmake/rules/c++/modules/modules_support/msvc/dependency_scanner.lua
index 6cf095a01..f84a69633 100644
--- a/xmake/rules/c++/modules/modules_support/msvc/dependency_scanner.lua
+++ b/xmake/rules/c++/modules/modules_support/msvc/dependency_scanner.lua
@@ -48,14 +48,16 @@ function generate_dependencies(target, sourcebatch, opt)
local compinst = target:compiler("cxx")
local msvc = target:toolchain("msvc")
local compflags = table.join(compinst:compflags({sourcefile = sourcefile, target = target}) or {}, common_flags, flags)
- try{function() return os.iorunv(compinst:program(), winos.cmdargv(compflags), {envs = msvc:runenvs()}) end}
+ local _, err = os.iorunv(compinst:program(), winos.cmdargv(compflags), {envs = msvc:runenvs()})
+ assert(err, err)
else
fallback_generate_dependencies(target, jsonfile, sourcefile, function(file)
local compinst = target:compiler("cxx")
local compflags = compinst:compflags({sourcefile = file, target = target})
local ifile = path.translate(path.join(outputdir, path.filename(file) .. ".i"))
- try{function() return os.vrunv(compinst:program(), table.join(compflags,
- {"/P", "-TP", file, "/Fi" .. ifile}), {envs = msvc:runenvs()}) end}
+ local _, err = os.iorunv(compinst:program(), table.join(compflags,
+ {"/P", "-TP", file, "/Fi" .. ifile}), {envs = msvc:runenvs()})
+ assert(err, err)
local content = io.readfile(ifile)
os.rm(ifile)
return content