summaryrefslogtreecommitdiff
path: root/xmake/modules/lib
diff options
context:
space:
mode:
authorruki <[email protected]>2017-07-13 10:52:42 +0800
committerruki <[email protected]>2017-07-13 10:52:42 +0800
commitb7ae88c507b9afe89cd677ee81894e44a961a4b4 (patch)
treea8aca817b422ca83f76d8310678351eaa3f3cf75 /xmake/modules/lib
parentb9e5a411e38224db1f71a39cad57cc54dc13fee6 (diff)
improve flags for linker and compiler
Diffstat (limited to 'xmake/modules/lib')
-rw-r--r--xmake/modules/lib/detect/has_flags.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/xmake/modules/lib/detect/has_flags.lua b/xmake/modules/lib/detect/has_flags.lua
index 47347e5ed..1957a6b72 100644
--- a/xmake/modules/lib/detect/has_flags.lua
+++ b/xmake/modules/lib/detect/has_flags.lua
@@ -55,6 +55,20 @@ function main(name, flags, opt)
-- wrap flags
flags = table.wrap(flags)
+ -- split flag group, .e.g "-I /xxx" => {"-I", "/xxx"}
+ local results = {}
+ for _, flag in ipairs(flags) do
+ flag = flag:trim()
+ if #flag > 0 then
+ if flag:find(" ", 1, true) then
+ table.join2(results, os.argv(flag))
+ else
+ table.insert(results, flag)
+ end
+ end
+ end
+ flags = results
+
-- init tool
opt.toolname = tool.name
opt.program = tool.program