diff options
Diffstat (limited to 'xmake/core/tool/builder.lua')
| -rw-r--r-- | xmake/core/tool/builder.lua | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/xmake/core/tool/builder.lua b/xmake/core/tool/builder.lua index e706a9933..ba8d44a18 100644 --- a/xmake/core/tool/builder.lua +++ b/xmake/core/tool/builder.lua @@ -373,9 +373,15 @@ function builder:_preprocess_flags(flags) flag = flag:trim() if #flag > 0 then if flag:find(" ", 1, true) then + local split = true -- ignore e.g. -DTEST="Hello world" - local s = flag:gsub("\".-\"", "") - if s:find(" ", 1, true) then + if flag:find("\"", 1, true) then + local s = flag:gsub("\".-\"", "") + if not s:find(" ", 1, true) then + split = false + end + end + if split then table.join2(results, os.argv(flag)) else table.insert(results, flag) |
