summaryrefslogtreecommitdiff
path: root/xmake/core
diff options
context:
space:
mode:
authorruki <[email protected]>2023-09-11 22:49:38 +0800
committerruki <[email protected]>2023-09-11 22:49:38 +0800
commit17b467d17875eb1fcc45522852a1bbe8a446028f (patch)
treefbb403b880bd39cee4aed221f28c5d936c81cc85 /xmake/core
parent53383cc8a09235f148b99f45c20c29bcc7873977 (diff)
add recheck argument to on_config
Diffstat (limited to 'xmake/core')
-rw-r--r--xmake/core/sandbox/modules/import/core/project/project.lua23
1 files changed, 16 insertions, 7 deletions
diff --git a/xmake/core/sandbox/modules/import/core/project/project.lua b/xmake/core/sandbox/modules/import/core/project/project.lua
index f43590bb3..5573de619 100644
--- a/xmake/core/sandbox/modules/import/core/project/project.lua
+++ b/xmake/core/sandbox/modules/import/core/project/project.lua
@@ -125,24 +125,33 @@ function sandbox_core_project.check_options()
end
-- config target
-function sandbox_core_project._config_target(target)
+function sandbox_core_project._config_target(target, opt)
for _, rule in ipairs(table.wrap(target:orderules())) do
local on_config = rule:script("config")
if on_config then
- on_config(target)
+ on_config(target, opt)
end
end
local on_config = target:script("config")
if on_config then
- on_config(target)
+ on_config(target, opt)
end
end
-- config targets
-function sandbox_core_project._config_targets()
+--
+-- @param opt the extra option, e.g. {recheck = false}
+--
+-- on_config(target, opt)
+-- if opt.recheck then
+-- target:has_cfuncs(...)
+-- end
+-- end
+--
+function sandbox_core_project._config_targets(opt)
for _, target in ipairs(table.wrap(project.ordertargets())) do
if target:is_enabled() then
- sandbox_core_project._config_target(target)
+ sandbox_core_project._config_target(target, opt)
end
end
end
@@ -187,13 +196,13 @@ function sandbox_core_project._load_package_rules_for_targets()
end
-- load project targets
-function sandbox_core_project.load_targets()
+function sandbox_core_project.load_targets(opt)
-- load package rules for targets
sandbox_core_project._load_package_rules_for_targets()
-- config targets
- sandbox_core_project._config_targets()
+ sandbox_core_project._config_targets(opt)
end
-- get the filelock of the whole project directory