diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua index c1eed339a0..c83e547239 100644 --- a/xmake/modules/package/tools/cmake.lua +++ b/xmake/modules/package/tools/cmake.lua @@ -946,6 +946,10 @@ function _get_configs(package, configs, opt) _get_configs_for_generic(package, configs, opt) end + if not opt._configs_str:find("CMAKE_INTERPROCEDURAL_OPTIMIZATION", 1, true) then + table.insert(configs, "-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=OFF") + end + -- fix error for cmake 4.x -- e.g. Compatibility with CMake < 3.5 has been removed from CMake. if _get_cmake_version() and _get_cmake_version():ge("4.0") then