summaryrefslogtreecommitdiff
path: root/xmake/modules/package/tools/cmake.lua
diff options
context:
space:
mode:
authorxq114 <[email protected]>2021-04-23 13:08:27 +0800
committerxq114 <[email protected]>2021-04-23 13:08:27 +0800
commit51bc592d022d1b812bae3f12fb9365f1842c30c3 (patch)
tree26ef7970c7c4d0e919bced863c77cf48a69d5b7f /xmake/modules/package/tools/cmake.lua
parent96d893d29f543f4f24b42fab0645e406435922b8 (diff)
using os.args instead of custom workaround
Diffstat (limited to 'xmake/modules/package/tools/cmake.lua')
-rw-r--r--xmake/modules/package/tools/cmake.lua35
1 files changed, 5 insertions, 30 deletions
diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua
index 7aaf64b7d..a15812300 100644
--- a/xmake/modules/package/tools/cmake.lua
+++ b/xmake/modules/package/tools/cmake.lua
@@ -116,13 +116,8 @@ function _get_cflags(package, opt)
table.join2(result, opt.cxflags)
end
table.join2(result, _get_cflags_from_packagedeps(package, opt))
- for i, flag in ipairs(result) do
- if flag:match(" ") then
- result[i] = '"' .. flag .. '"'
- end
- end
if #result > 0 then
- return table.concat(result, ' ')
+ return os.args(result)
end
end
@@ -146,13 +141,8 @@ function _get_cxxflags(package, opt)
table.join2(result, opt.cxflags)
end
table.join2(result, _get_cflags_from_packagedeps(package, opt))
- for i, flag in ipairs(result) do
- if flag:match(" ") then
- result[i] = '"' .. flag .. '"'
- end
- end
if #result > 0 then
- return table.concat(result, ' ')
+ return os.args(result)
end
end
@@ -170,13 +160,8 @@ function _get_asflags(package, opt)
if opt.asflags then
table.join2(result, opt.asflags)
end
- for i, flag in ipairs(result) do
- if flag:match(" ") then
- result[i] = '"' .. flag .. '"'
- end
- end
if #result > 0 then
- return table.concat(result, ' ')
+ return os.args(result)
end
end
@@ -194,13 +179,8 @@ function _get_ldflags(package, opt)
if opt.ldflags then
table.join2(result, opt.ldflags)
end
- for i, flag in ipairs(result) do
- if flag:match(" ") then
- result[i] = '"' .. flag .. '"'
- end
- end
if #result > 0 then
- return table.concat(result, ' ')
+ return os.args(result)
end
end
@@ -218,13 +198,8 @@ function _get_shflags(package, opt)
if opt.shflags then
table.join2(result, opt.shflags)
end
- for i, flag in ipairs(result) do
- if flag:match(" ") then
- result[i] = '"' .. flag .. '"'
- end
- end
if #result > 0 then
- return table.concat(result, ' ')
+ return os.args(result)
end
end