summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2025-12-03 00:55:55 +0800
committerruki <[email protected]>2025-12-03 00:55:55 +0800
commit13eda469fbca1407d7948191f2a7f04949ba392e (patch)
treed7a33d5e27c0fad94997b5c8d904d96f49469058
parent80a93765f31748434537a5a91fb10e8338ed4565 (diff)
add jobs
-rw-r--r--xmake/modules/private/check/checkers/syntax.lua13
1 files changed, 11 insertions, 2 deletions
diff --git a/xmake/modules/private/check/checkers/syntax.lua b/xmake/modules/private/check/checkers/syntax.lua
index 35ae9da3d..439e03835 100644
--- a/xmake/modules/private/check/checkers/syntax.lua
+++ b/xmake/modules/private/check/checkers/syntax.lua
@@ -32,6 +32,8 @@ local options = {
"e.g.",
" - xmake check syntax -f src/foo.cpp",
" - xmake check syntax -f 'src/*.cpp'"},
+ {"j", "jobs", "kv", tostring(os.default_njob()),
+ "Set the number of parallel check jobs."},
{nil, "targets", "vs", nil, "Check the sourcefiles of the given target.",
"e.g.",
" - xmake check syntax",
@@ -109,11 +111,18 @@ function _check(opt)
local sourcefiles = opt.files
local targetnames = opt.targets
+ local jobs = opt.jobs and tonumber(opt.jobs) or nil
+
local check_time = os.mclock()
+ local build_opt = {linkjobs = false}
+ if jobs then
+ build_opt.jobs = jobs
+ end
if sourcefiles then
- build_files(targetnames, {sourcefiles = sourcefiles, linkjobs = false})
+ build_opt.sourcefiles = sourcefiles
+ build_files(targetnames, build_opt)
else
- build(targetnames, {linkjobs = false})
+ build(targetnames, build_opt)
end
check_time = os.mclock() - check_time
progress.show(100, "${color.success}syntax check ok, spent %.3fs", check_time / 1000)