summaryrefslogtreecommitdiff
path: root/xmake/core/project/project.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2017-07-10 09:21:34 +0800
committerruki <[email protected]>2017-07-10 09:21:34 +0800
commitdef23a930fc3780e54b2a8a6fc60854d2e193000 (patch)
treed6f268cb27b56c4c191e913cccb3e5d9beaab31a /xmake/core/project/project.lua
parentcc484e28d357f9b65358001c10a6cd95190e684e (diff)
add target.on_load
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