summaryrefslogtreecommitdiff
path: root/xmake/core
diff options
context:
space:
mode:
authorruki <[email protected]>2025-09-06 19:14:41 +0800
committerruki <[email protected]>2025-09-06 19:14:41 +0800
commit76f10432e1ad6b20b8e1c8ed7b7576dc274fe31b (patch)
tree4968c9af42601ae0432b729875785e58830b25e1 /xmake/core
parent31d2273f44022b19870f2a0f05f644ffd56bb6b5 (diff)
revert config targets #6775
Diffstat (limited to 'xmake/core')
-rw-r--r--xmake/core/sandbox/modules/import/core/project/project.lua43
1 files changed, 41 insertions, 2 deletions
diff --git a/xmake/core/sandbox/modules/import/core/project/project.lua b/xmake/core/sandbox/modules/import/core/project/project.lua
index fde977b6e..4a191576c 100644
--- a/xmake/core/sandbox/modules/import/core/project/project.lua
+++ b/xmake/core/sandbox/modules/import/core/project/project.lua
@@ -126,6 +126,43 @@ function sandbox_core_project.check_options()
end
end
+-- config target
+function sandbox_core_project._config_target(target, opt)
+ for _, rule in ipairs(table.wrap(target:orderules())) do
+ local before_config = rule:script("config_before")
+ if before_config then
+ before_config(target, opt)
+ end
+ end
+
+ for _, rule in ipairs(table.wrap(target:orderules())) do
+ local on_config = rule:script("config")
+ if on_config then
+ on_config(target, opt)
+ end
+ end
+ local on_config = target:script("config")
+ if on_config then
+ on_config(target, opt)
+ end
+
+ for _, rule in ipairs(table.wrap(target:orderules())) do
+ local after_config = rule:script("config_after")
+ if after_config then
+ after_config(target, opt)
+ end
+ end
+end
+
+function sandbox_core_project._config_targets(opt)
+ opt = opt or {}
+ for _, target in ipairs(table.wrap(project.ordertargets())) do
+ if target:is_enabled() then
+ sandbox_core_project._config_target(target, opt)
+ end
+ end
+end
+
-- config targets
--
-- @param opt the extra option, e.g. {recheck = false}
@@ -136,7 +173,9 @@ end
-- target:has_cfuncs(...)
-- end
-- end
---
+-- TODO we need to optimize jobgraph
+-- https://github.com/xmake-io/xmake/issues/6775
+--[[
function sandbox_core_project._config_targets(opt)
import("private.action.build.target", {alias = "target_buildutils"})
@@ -146,7 +185,7 @@ function sandbox_core_project._config_targets(opt)
-- 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", target_fence = true, jobs = 1, job_opt = opt})
-end
+end]]
-- load rules in the required packages for target
function sandbox_core_project._load_package_rules_for_target(target)