diff options
| author | ruki <[email protected]> | 2020-11-29 10:32:59 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-11-29 10:32:59 +0800 |
| commit | 7a16a7339dee73b150ee39d92e272f3e59c1fc2d (patch) | |
| tree | 34015905282b2a24fc07873f517d8d95e70f688f /xmake/core/tool/builder.lua | |
| parent | 3aa65c3dcda3260d8125de9325ffa0284ce3fdae (diff) | |
improve preprocess flags
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) |
