summaryrefslogtreecommitdiff
path: root/xmake/core/tool/builder.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2021-11-28 03:03:50 +0800
committerruki <[email protected]>2021-11-28 03:03:50 +0800
commit04a13fd238c754b55338f9debdcf09aff27427ee (patch)
treeb018ba362117243c31fe99c0b2bae0b1f512609f /xmake/core/tool/builder.lua
parent4e40a9197b6e2ec738fa882eade00777b89e23d9 (diff)
add builder:is
Diffstat (limited to 'xmake/core/tool/builder.lua')
-rw-r--r--xmake/core/tool/builder.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/xmake/core/tool/builder.lua b/xmake/core/tool/builder.lua
index 91bb707f8..e3c5de456 100644
--- a/xmake/core/tool/builder.lua
+++ b/xmake/core/tool/builder.lua
@@ -442,6 +442,16 @@ function builder:map_flags(name, values, opt)
end
end
+-- is the given name?
+function builder:is(...)
+ local name = self:name()
+ for _, v in ipairs(table.join(...)) do
+ if v and name:find("^" .. v:gsub("%-", "%%-") .. "$") then
+ return true
+ end
+ end
+end
+
-- get the format of the given target kind
function builder:format(targetkind)
local formats = self:get("formats")