summaryrefslogtreecommitdiff
path: root/xmake/core/project/project.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/core/project/project.lua')
-rw-r--r--xmake/core/project/project.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/xmake/core/project/project.lua b/xmake/core/project/project.lua
index 4368a7220..f16d61c5d 100644
--- a/xmake/core/project/project.lua
+++ b/xmake/core/project/project.lua
@@ -246,6 +246,7 @@ function project._interpreter()
{
-- target.on_xxx
"target.on_run"
+ , "target.on_load"
, "target.on_build"
, "target.on_clean"
, "target.on_package"
@@ -433,6 +434,17 @@ function project.load()
-- save targets
project._TARGETS = targets
+ -- on load for each target
+ for _, target in pairs(targets) do
+ local on_load = target:script("load")
+ if on_load then
+ ok, errors = sandbox.load(on_load, target)
+ if not ok then
+ return false, errors
+ end
+ end
+ end
+
-- ok
return true
end