diff options
Diffstat (limited to 'xmake/modules/package/tools/cmake.lua')
| -rw-r--r-- | xmake/modules/package/tools/cmake.lua | 6 |
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 |
