Skip to content

Commit d52b351

Browse files
committed
...
1 parent deef73d commit d52b351

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

xmake/modules/package/tools/cmake.lua

+7-5
Original file line numberDiff line numberDiff line change
@@ -427,11 +427,6 @@ function _get_configs_for_generic(package, configs, opt)
427427
if not package:use_external_includes() then
428428
table.insert(configs, "-DCMAKE_NO_SYSTEM_FROM_IMPORTED=ON")
429429
end
430-
-- fix error for cmake 4.x
431-
-- e.g. Compatibility with CMake < 3.5 has been removed from CMake.
432-
if _get_cmake_version() and _get_cmake_version():ge("4.0") then
433-
table.insert(configs, "-DCMAKE_POLICY_VERSION_MINIMUM=3.5")
434-
end
435430
end
436431

437432
-- get configs for windows
@@ -950,6 +945,13 @@ function _get_configs(package, configs, opt)
950945
else
951946
_get_configs_for_generic(package, configs, opt)
952947
end
948+
949+
-- fix error for cmake 4.x
950+
-- e.g. Compatibility with CMake < 3.5 has been removed from CMake.
951+
if _get_cmake_version() and _get_cmake_version():ge("4.0") then
952+
table.insert(configs, "-DCMAKE_POLICY_VERSION_MINIMUM=3.5")
953+
end
954+
953955
local envs = _get_envs_for_default_flags(package, configs, opt)
954956
local runtime_envs = _get_envs_for_runtime_flags(package, configs, opt)
955957
if runtime_envs then

0 commit comments

Comments
 (0)