summaryrefslogtreecommitdiff
path: root/xmake/modules
diff options
context:
space:
mode:
authorruki <[email protected]>2017-07-26 13:49:41 +0800
committerruki <[email protected]>2017-07-26 13:49:41 +0800
commit58ccd0f2ee0de904eaabeea5d2d08581e6b2cdbb (patch)
tree357b92e3f3f923b2e14c38f7ca8acb47532487cb /xmake/modules
parent0a36354d2cbc74c08360a9a805d2179269aaec7e (diff)
fix check -def: flags
Diffstat (limited to 'xmake/modules')
-rw-r--r--xmake/modules/detect/tools/link/has_flags.lua17
1 files changed, 17 insertions, 0 deletions
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