summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2025-08-20 22:55:38 +0800
committerruki <[email protected]>2025-08-20 22:55:38 +0800
commit31b98e0c598275bb0809d3c1251ef07db4e71e65 (patch)
treeee3a30f6d8ecb699211cdd181b074f7f48b31f1f
parent573782c949ecf6f0c179822e6003f1075fb37018 (diff)
fix config
-rw-r--r--xmake/core/sandbox/modules/import/core/project/project.lua5
-rw-r--r--xmake/modules/private/action/build/target.lua8
-rw-r--r--xmake/plugins/project/utils/target_cmds.lua2
3 files changed, 9 insertions, 6 deletions
diff --git a/xmake/core/sandbox/modules/import/core/project/project.lua b/xmake/core/sandbox/modules/import/core/project/project.lua
index af1ae11bd..fde977b6e 100644
--- a/xmake/core/sandbox/modules/import/core/project/project.lua
+++ b/xmake/core/sandbox/modules/import/core/project/project.lua
@@ -141,8 +141,11 @@ function sandbox_core_project._config_targets(opt)
import("private.action.build.target", {alias = "target_buildutils"})
-- we need to config all targets (contains non-default targets)
+ --
+ -- @note Currently, many configurations still depend on the order of rules/add_deps (e.g. qt rules),
+ -- so we can only execute single tasks for now (jobs = 1).
local targets_root = target_buildutils.get_root_targets(nil, {all = true})
- target_buildutils.run_targetjobs(targets_root, {job_kind = "config", dep_fence = true, job_opt = opt})
+ target_buildutils.run_targetjobs(targets_root, {job_kind = "config", target_fence = true, jobs = 1, job_opt = opt})
end
-- load rules in the required packages for target
diff --git a/xmake/modules/private/action/build/target.lua b/xmake/modules/private/action/build/target.lua
index 444dfc18e..6c651b68e 100644
--- a/xmake/modules/private/action/build/target.lua
+++ b/xmake/modules/private/action/build/target.lua
@@ -115,8 +115,8 @@ end
function _add_targetjobs_deep_orders(jobgraph, target, dep, opt)
local jobname, jobname_dep
local job_kind = opt.job_kind
- local dep_fence = opt.dep_fence or dep:policy("build.fence") or dep:policy("build.across_targets_in_parallel") == false
- if dep_fence then
+ local target_fence = opt.target_fence or dep:policy("build.fence") or dep:policy("build.across_targets_in_parallel") == false
+ if target_fence then
jobname = string.format("%s/begin_%s", target:fullname(), job_kind)
jobname_dep = string.format("%s/end_%s", dep:fullname(), job_kind)
-- build.across_targets_in_parallel is deprecated
@@ -787,7 +787,7 @@ function run_targetjobs(targets_root, opt)
if errors and progress.showing_without_scroll() then
print("")
end
- end, comax = option.get("jobs") or os.default_njob(), curdir = curdir, distcc = opt.distcc, progress_factor = opt.progress_factor})
+ end, comax = opt.jobs or option.get("jobs") or 1, curdir = curdir, distcc = opt.distcc, progress_factor = opt.progress_factor})
os.cd(curdir)
return true
end
@@ -805,7 +805,7 @@ function run_filejobs(targets_root, opt)
if errors and progress.showing_without_scroll() then
print("")
end
- end, comax = option.get("jobs") or os.default_njob(), curdir = curdir, distcc = opt.distcc, progress_factor = opt.progress_factor})
+ end, comax = opt.jobs or option.get("jobs") or 1, curdir = curdir, distcc = opt.distcc, progress_factor = opt.progress_factor})
os.cd(curdir)
return true
end
diff --git a/xmake/plugins/project/utils/target_cmds.lua b/xmake/plugins/project/utils/target_cmds.lua
index 8d40f2cb3..ab1f8b42a 100644
--- a/xmake/plugins/project/utils/target_cmds.lua
+++ b/xmake/plugins/project/utils/target_cmds.lua
@@ -29,7 +29,7 @@ import("private.action.build.target", {alias = "target_buildutils"})
-- prepare targets
function prepare_targets()
local targets_root = target_buildutils.get_root_targets()
- target_buildutils.run_targetjobs(targets_root, {job_kind = "prepare", for_generator = true})
+ target_buildutils.run_targetjobs(targets_root, {job_kind = "prepare", for_generator = true, jobs = os.default_njob()})
end
-- get target buildcmds