commit: 4f0e629df3f6e44565becf3dc238d6d65ae9c102
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Mon May 19 16:36:57 2025 +0000
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Tue Jun 3 17:00:07 2025 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4f0e629d
cmake.eclass: If CMake 4 is detected, build w/ compat cmake arg
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
eclass/cmake.eclass | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/eclass/cmake.eclass b/eclass/cmake.eclass
index 4c91afa160d9..b538af80a4b1 100644
--- a/eclass/cmake.eclass
+++ b/eclass/cmake.eclass
@@ -644,6 +644,11 @@ cmake_src_configure() {
if [[ ${EAPI} == 7 ]]; then
eqawarn "QA Notice: EAPI=7 detected; this package is
now a prime last-rites target."
fi
+ if has_version -b ">=dev-build/cmake-4"; then
+ eqawarn "QA Notice: CMake 4 detected; building with
-DCMAKE_POLICY_VERSION_MINIMUM=3.5"
+ eqawarn "This is merely a workaround and *not* a
permanent fix."
+ cmakeargs+=( -DCMAKE_POLICY_VERSION_MINIMUM=3.5 )
+ fi
fi
pushd "${BUILD_DIR}" > /dev/null || die