From ae8a596c609e01b21caa5825f3fd2eec0bdb7507 Mon Sep 17 00:00:00 2001 From: ruki Date: Tue, 7 Jan 2025 00:40:57 +0800 Subject: support for inner namespace access --- xmake/core/project/project.lua | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'xmake/core/project/project.lua') diff --git a/xmake/core/project/project.lua b/xmake/core/project/project.lua index 77793d3e5..f395f5f6b 100644 --- a/xmake/core/project/project.lua +++ b/xmake/core/project/project.lua @@ -911,9 +911,16 @@ function project.is_loaded() end -- get the given target -function project.target(name) +function project.target(name, opt) + opt = opt or {} local targets = project.targets() - return targets and targets[name] + if targets then + local t = targets[name] + if not t and opt.namespace then + t = targets[opt.namespace .. "::" .. name] + end + return t + end end -- add the given target, @note if the target name is the same, it will be replaced -- cgit v1.3.1