diff options
| author | xq114 <[email protected]> | 2021-04-22 22:42:38 +0800 |
|---|---|---|
| committer | xq114 <[email protected]> | 2021-04-22 22:42:38 +0800 |
| commit | 96d893d29f543f4f24b42fab0645e406435922b8 (patch) | |
| tree | 242caed6b42f8896bcea2ccf2f10935d20ce3fba /xmake/modules/package/tools/cmake.lua | |
| parent | e124d5d2cc26aa76a0c295791c2ba18f101de7f8 (diff) | |
improve package.tools.cmake
Diffstat (limited to 'xmake/modules/package/tools/cmake.lua')
| -rw-r--r-- | xmake/modules/package/tools/cmake.lua | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua index 92d6d7e72..7aaf64b7d 100644 --- a/xmake/modules/package/tools/cmake.lua +++ b/xmake/modules/package/tools/cmake.lua @@ -116,6 +116,11 @@ 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, ' ') end @@ -141,6 +146,11 @@ 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, ' ') end @@ -160,6 +170,11 @@ 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, ' ') end @@ -179,6 +194,11 @@ 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, ' ') end @@ -198,6 +218,11 @@ 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, ' ') end |
