From 58ccd0f2ee0de904eaabeea5d2d08581e6b2cdbb Mon Sep 17 00:00:00 2001 From: ruki Date: Wed, 26 Jul 2017 13:49:41 +0800 Subject: fix check -def: flags --- xmake/modules/detect/tools/link/has_flags.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'xmake/modules/detect/tools') diff --git a/xmake/modules/detect/tools/link/has_flags.lua b/xmake/modules/detect/tools/link/has_flags.lua index 582f6ecf9..d48d2090c 100644 --- a/xmake/modules/detect/tools/link/has_flags.lua +++ b/xmake/modules/detect/tools/link/has_flags.lua @@ -103,6 +103,17 @@ function _check_try_running(flags, opt) return ok end +-- ignore some flags +function _ignore_flags(flags) + local results = {} + for _, flag in ipairs(flags) do + if not flag:find("[%-/]def:.+%.def") then + table.insert(results, flag) + end + end + return results +end + -- has_flags(flags)? -- -- @param opt the argument options, .e.g {toolname = "", program = "", programver = "", toolkind = "[cc|cxx|ld|ar|sh|gc|rc|dc|mm|mxx]"} @@ -111,6 +122,12 @@ end -- function main(flags, opt) + -- ignore some flags + flags = _ignore_flags(flags) + if #flags == 0 then + return true + end + -- attempt to check it from the argument list if _check_from_arglist(flags, opt) then return true -- cgit v1.3.1