diff options
| author | ruki <[email protected]> | 2025-01-07 00:40:57 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-01-07 00:40:57 +0800 |
| commit | ae8a596c609e01b21caa5825f3fd2eec0bdb7507 (patch) | |
| tree | 20ab76b862913222a52c932d5688eb9c0dc176b3 /xmake/core/project/project.lua | |
| parent | f6904d729ce7ca99fad237e5e0641ee015b97faf (diff) | |
support for inner namespace access
Diffstat (limited to 'xmake/core/project/project.lua')
| -rw-r--r-- | xmake/core/project/project.lua | 11 |
1 files changed, 9 insertions, 2 deletions
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 |
