From 860b2c9d4100bd69927aa9e099e07e7c0bdd9638 Mon Sep 17 00:00:00 2001 From: ruki Date: Mon, 17 Oct 2022 23:14:36 +0800 Subject: pass project policy to target --- xmake/core/project/target.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua index f20d0e3f7..af78ee398 100644 --- a/xmake/core/project/target.lua +++ b/xmake/core/project/target.lua @@ -643,7 +643,14 @@ function _instance:policy(name) end end end - return policy.check(name, policies and policies[name]) + local value + if policies then + value = policies[name] + end + if value == nil and target._project() then + value = target._project().policy(name) + end + return policy.check(name, value) end -- get the base name of target file -- cgit v1.3.1