summaryrefslogtreecommitdiff
path: root/xmake/actions
diff options
context:
space:
mode:
authorruki <[email protected]>2023-02-21 23:23:14 +0800
committerruki <[email protected]>2023-02-21 23:23:14 +0800
commit77c0a9dcfbbad5e72b3b59b02ebdf8f00a3141ac (patch)
treed45f6dd8b71b30942a8dcf438d3f6a3c0cb0d741 /xmake/actions
parentd4a354d714f69c598945f91557f7a6eec2334161 (diff)
improve check stage
Diffstat (limited to 'xmake/actions')
-rw-r--r--xmake/actions/build/check.lua17
-rw-r--r--xmake/actions/build/main.lua4
2 files changed, 5 insertions, 16 deletions
diff --git a/xmake/actions/build/check.lua b/xmake/actions/build/check.lua
index 6bbb45b8a..e26e4f0d0 100644
--- a/xmake/actions/build/check.lua
+++ b/xmake/actions/build/check.lua
@@ -44,18 +44,8 @@ function _show(str, opt)
end
end
-function _check_target(target)
- local checkers = checker.checkers()
- for name, info in table.orderpairs(checkers) do
- -- just do some faster checkers
- if info.timely then
- import("private.check.checkers." .. name, {anonymous = true})({
- target = target, show = _show})
- end
- end
-end
-
-function main(targetname)
+function main(targetname, opt)
+ opt = opt or {}
-- get targets
local targets = {}
@@ -75,8 +65,7 @@ function main(targetname)
-- do check
local checkers = checker.checkers()
for name, info in table.orderpairs(checkers) do
- -- just do some faster checkers
- if info.timely then
+ if (info.build and opt.build) or (info.build_failure and opt.build_failure) then
local check = import("private.check.checkers." .. name, {anonymous = true})
for _, target in ipairs(targets) do
check({target = target, show = _show})
diff --git a/xmake/actions/build/main.lua b/xmake/actions/build/main.lua
index 355b7753a..31a63b1d1 100644
--- a/xmake/actions/build/main.lua
+++ b/xmake/actions/build/main.lua
@@ -125,7 +125,7 @@ function _on_exit(ok, errors)
-- we just handle the build failure
if handled and not ok then
- print("build failed")
+ check_targets(targetname, {build_failure = true})
end
end
@@ -172,7 +172,7 @@ function main()
function ()
-- do check
- check_targets(targetname)
+ check_targets(targetname, {build = true})
-- do rules before building
_do_project_rules("build_before")