summaryrefslogtreecommitdiff
path: root/xmake/core/tool/builder.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2020-11-29 10:34:55 +0800
committerruki <[email protected]>2020-11-29 10:34:55 +0800
commit4f5ff519cfc45d189f5767aaf76701a289530c41 (patch)
tree116db9274f52e41d76541171cbe29d82596f307d /xmake/core/tool/builder.lua
parent7a16a7339dee73b150ee39d92e272f3e59c1fc2d (diff)
improve preprocess flags
Diffstat (limited to 'xmake/core/tool/builder.lua')
-rw-r--r--xmake/core/tool/builder.lua11
1 files changed, 5 insertions, 6 deletions
diff --git a/xmake/core/tool/builder.lua b/xmake/core/tool/builder.lua
index ba8d44a18..7a2a16949 100644
--- a/xmake/core/tool/builder.lua
+++ b/xmake/core/tool/builder.lua
@@ -372,8 +372,9 @@ function builder:_preprocess_flags(flags)
for _, flag in ipairs(flags) do
flag = flag:trim()
if #flag > 0 then
+ local split = false
if flag:find(" ", 1, true) then
- local split = true
+ split = true
-- ignore e.g. -DTEST="Hello world"
if flag:find("\"", 1, true) then
local s = flag:gsub("\".-\"", "")
@@ -381,11 +382,9 @@ function builder:_preprocess_flags(flags)
split = false
end
end
- if split then
- table.join2(results, os.argv(flag))
- else
- table.insert(results, flag)
- end
+ end
+ if split then
+ table.join2(results, os.argv(flag))
else
table.insert(results, flag)
end