summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2025-04-03 22:29:35 +0800
committerruki <[email protected]>2025-04-03 22:29:35 +0800
commit40566ed177f49fb1a08272db65c8872c9426ff0a (patch)
tree90b82e641f5a4703fbe4b1fb2da4a48ca9c55526
parent18bab4f32a2c48b5bea4e94c3fbff360ded90088 (diff)
improve tools.cmake
-rw-r--r--xmake/modules/package/tools/cmake.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua
index c0f86a95e..90f756591 100644
--- a/xmake/modules/package/tools/cmake.lua
+++ b/xmake/modules/package/tools/cmake.lua
@@ -427,6 +427,11 @@ function _get_configs_for_generic(package, configs, opt)
if not package:use_external_includes() then
table.insert(configs, "-DCMAKE_NO_SYSTEM_FROM_IMPORTED=ON")
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
+ table.insert(configs, "-DCMAKE_POLICY_VERSION_MINIMUM=3.5")
+ end
end
-- get configs for windows