summaryrefslogtreecommitdiff
path: root/xmake/modules/package/tools/cmake.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2024-11-21 00:09:29 +0800
committerruki <[email protected]>2024-11-21 00:09:29 +0800
commitfebbfa8443bc4f0ad33bee3c26b4aae096879027 (patch)
treef0a7f41928ca225a69763c0ec3ecc7128580c156 /xmake/modules/package/tools/cmake.lua
parentb6a04f8a7bf77f759093921ddd95d1ee0abaa998 (diff)
revert cmake flags
Diffstat (limited to 'xmake/modules/package/tools/cmake.lua')
-rw-r--r--xmake/modules/package/tools/cmake.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua
index 6412eeb71..7cbe6616f 100644
--- a/xmake/modules/package/tools/cmake.lua
+++ b/xmake/modules/package/tools/cmake.lua
@@ -1245,8 +1245,10 @@ 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
- local flags = v:replace(" ", "\\ ")
- table.insert(cmake_argv, ("add_compile_options($<$<COMPILE_LANGUAGE:%s>:%s>)"):format(kind, flags))
+ 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
if build_type then
table.insert(cmake_argv, "endif()")
end