summaryrefslogtreecommitdiff
path: root/xmake/modules/package/tools
diff options
context:
space:
mode:
authorruki <[email protected]>2024-11-21 00:09:35 +0800
committerruki <[email protected]>2024-11-21 00:09:35 +0800
commitef16d2434c22fc36c3a9d79bee9dfec6c00a5292 (patch)
treec11cc692d2b83bf27c3c1323a21df509bf29ab7c /xmake/modules/package/tools
parentfebbfa8443bc4f0ad33bee3c26b4aae096879027 (diff)
fix cmake flags
Diffstat (limited to 'xmake/modules/package/tools')
-rw-r--r--xmake/modules/package/tools/cmake.lua6
1 files changed, 2 insertions, 4 deletions
diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua
index 7cbe6616f..6412eeb71 100644
--- a/xmake/modules/package/tools/cmake.lua
+++ b/xmake/modules/package/tools/cmake.lua
@@ -1245,10 +1245,8 @@ function _shrink_cmake_arguments(argv, oldir, opt)
if build_type then
table.insert(cmake_argv, ("if(CMAKE_BUILD_TYPE STREQUAL \"%s\")"):format(build_type))
end
- for _, flag in ipairs(os.argv(v)) do
- flag = flag:replace(" ", "\\ ")
- table.insert(cmake_argv, ("add_compile_options($<$<COMPILE_LANGUAGE:%s>:%s>)"):format(kind, flag))
- end
+ local flags = v:replace(" ", "\\ ")
+ table.insert(cmake_argv, ("add_compile_options($<$<COMPILE_LANGUAGE:%s>:%s>)"):format(kind, flags))
if build_type then
table.insert(cmake_argv, "endif()")
end