diff options
| author | ruki <[email protected]> | 2025-09-26 00:53:12 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-09-26 00:53:12 +0800 |
| commit | 41071f11cb134a124734b922fe51ef6d8f5cfc20 (patch) | |
| tree | 0c74bc9481babb9fed827cd790b98be622d7f8cc /xmake/core/package/package.lua | |
| parent | 4321dfa63bb08dc761ab6810e758a8274cc46162 (diff) | |
improve to has_tool
Diffstat (limited to 'xmake/core/package/package.lua')
| -rw-r--r-- | xmake/core/package/package.lua | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua index 3caa0ac2f..0eec73407 100644 --- a/xmake/core/package/package.lua +++ b/xmake/core/package/package.lua @@ -1408,14 +1408,12 @@ end -- ... -- end function _instance:has_tool(toolkind, ...) - local _, toolname = self:tool(toolkind) - if toolname then - for _, v in ipairs(table.join(...)) do - if v and toolname:find("^" .. v:gsub("%-", "%%-") .. "$") then - return true - end - end + local target_utils = target._target_utils + if target_utils == nil then + target_utils = sandbox_module.import("private.utils.target", {anonymous = true}) + target._target_utils = target_utils end + return target_utils.has_tool(self, toolkind, ...) end -- get the user private data |
