diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua index 770c1a6310..db83658a7a 100644 --- a/xmake/modules/package/tools/cmake.lua +++ b/xmake/modules/package/tools/cmake.lua @@ -1240,6 +1240,7 @@ function _shrink_cmake_arguments(argv, oldir, opt) end -- improve cmake flags -- @see https://github.com/xmake-io/xmake/issues/5826 + --[[ local build_type = mode and buildtypes_map[mode] or nil if #v > 0 and add_compile_options and (kind == "C" or kind == "CXX" or kind == "ASM") then if build_type then @@ -1253,9 +1254,9 @@ function _shrink_cmake_arguments(argv, oldir, opt) end shrink = true return true - end + end]] -- shrink long arguments - if #v > 128 then + if #v > 0 then local flags = v:replace("\"", "\\\"") table.insert(cmake_argv, ("set(%s \"%s\")"):format(k, flags)) shrink = true