From d95758dc85e1e34e6ce507ffee78f7634a0661c5 Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 20 Dec 2018 23:55:49 +0800 Subject: add flagkind to has_flags --- xmake/core/tool/tool.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'xmake/core/tool/tool.lua') 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 -- cgit v1.3.1