summaryrefslogtreecommitdiff
path: root/xmake/core/project/project.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2020-05-14 23:09:34 +0800
committerruki <[email protected]>2020-05-14 12:57:29 +0800
commit46abd569d127f5d77735cc2071018970d34bcd37 (patch)
tree8592e9e8b2953c85b2f7cda939802c19fc2f9568 /xmake/core/project/project.lua
parent0648c5178d1fabbaa082db10aeb1fa6bf822bd6a (diff)
check policies name
Diffstat (limited to 'xmake/core/project/project.lua')
-rw-r--r--xmake/core/project/project.lua14
1 files changed, 13 insertions, 1 deletions
diff --git a/xmake/core/project/project.lua b/xmake/core/project/project.lua
index 2f9fd629c..e900f394f 100644
--- a/xmake/core/project/project.lua
+++ b/xmake/core/project/project.lua
@@ -811,7 +811,19 @@ end
-- get the project policy, the root policy of the target scope
function project.policy(name)
- local policies = project.get("target.policy")
+ local policies = project._POLICIES
+ if not policies then
+ policies = project.get("target.policy")
+ project._POLICIES = policies
+ if policies then
+ local defined_policies = policy.policies()
+ for name, _ in pairs(policies) do
+ if not defined_policies[name] then
+ utils.warning("unknown policy(%s), please run `xmake l core.project.policy.policies` if you want to all policies", name)
+ end
+ end
+ end
+ end
return policy.check(name, policies and policies[name])
end