commit: c61429856424975f5afc1d55d8f153fb3639ab18
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Mon May 19 18:37:02 2025 +0000
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Tue Jun 3 17:00:08 2025 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c6142985
cmake.eclass: Add CMAKE_QA_COMPAT_SKIP flag to skip compat checks
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
eclass/cmake.eclass | 26 +++++++++++++++++---------
1 file changed, 17 insertions(+), 9 deletions(-)
diff --git a/eclass/cmake.eclass b/eclass/cmake.eclass
index b538af80a4b1..f327521e9fc1 100644
--- a/eclass/cmake.eclass
+++ b/eclass/cmake.eclass
@@ -117,6 +117,12 @@ fi
# for econf and is needed to pass TRY_RUN results when cross-compiling.
# Should be set by user in a per-package basis in /etc/portage/package.env.
+# @ECLASS_VARIABLE: CMAKE_QA_COMPAT_SKIP
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# If set, skip detection of CMakeLists.txt unsupported in CMake 4 in case of
+# false positives (e.g. unused outdated bundled libs).
+
# @ECLASS_VARIABLE: CMAKE_QA_SRC_DIR_READONLY
# @USER_VARIABLE
# @DEFAULT_UNSET
@@ -446,15 +452,17 @@ cmake_src_configure() {
xdg_environment_reset
local file ver cmreq_isold
- while read -d '' -r file ; do
- ver=$(sed -ne
"/cmake_minimum_required/I{s/.*\(\.\.\.*\|\s\)\([0-9.]*\)\([)]\|\s\).*$/\2/p;q}"
\
- "${file}" 2>/dev/null \
- )
-
- if [[ -n $ver ]] && ver_test $ver -lt "3.5"; then
- cmreq_isold=true
- fi
- done < <(find "${CMAKE_USE_DIR}" -type f -iname "CMakeLists.txt"
-print0)
+ if ! [[ ${CMAKE_QA_COMPAT_SKIP} ]]; then
+ while read -d '' -r file ; do
+ ver=$(sed -ne
"/cmake_minimum_required/I{s/.*\(\.\.\.*\|\s\)\([0-9.]*\)\([)]\|\s\).*$/\2/p;q}"
\
+ "${file}" 2>/dev/null \
+ )
+
+ if [[ -n $ver ]] && ver_test $ver -lt "3.5"; then
+ cmreq_isold=true
+ fi
+ done < <(find "${CMAKE_USE_DIR}" -type f -iname
"CMakeLists.txt" -print0)
+ fi
# Prepare Gentoo override rules (set valid compiler, append CPPFLAGS
etc.)
local build_rules=${BUILD_DIR}/gentoo_rules.cmake