diff options
| author | ruki <[email protected]> | 2018-12-20 23:55:49 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2018-12-20 17:34:56 +0800 |
| commit | d95758dc85e1e34e6ce507ffee78f7634a0661c5 (patch) | |
| tree | f740966dedf5eea54bf54c4f7d379fcfa012034a /xmake/core/tool/tool.lua | |
| parent | cbce3651b8baff9d4cad89b3056e629c9ace4a41 (diff) | |
add flagkind to has_flags
Diffstat (limited to 'xmake/core/tool/tool.lua')
| -rw-r--r-- | xmake/core/tool/tool.lua | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/xmake/core/tool/tool.lua b/xmake/core/tool/tool.lua index 7b1bcaed3..7556860ab 100644 --- a/xmake/core/tool/tool.lua +++ b/xmake/core/tool/tool.lua @@ -109,13 +109,19 @@ function _instance:get(name) end -- has the given flag? -function _instance:has_flags(flags) +function _instance:has_flags(flags, flagkind) -- import has_flags() self._has_flags = self._has_flags or import("lib.detect.has_flags") + -- get base flags + local baseflags = self:get(self:kind() .. 'flags') + if not baseflags and flagkind then + baseflags = self:get(flagkind) + end + -- has flags? - return self._has_flags(self:name(), flags, {program = self:program(), toolkind = self:kind()}) + return self._has_flags(self:name(), table.join(flags, baseflags), {program = self:program(), toolkind = self:kind(), flagkind = flagkind}) end -- load the given tool from the given kind |
