diff options
| author | Andreas Sturmlechner <asturm@gentoo.org> | 2025-05-17 19:09:31 +0200 |
|---|---|---|
| committer | Andreas Sturmlechner <asturm@gentoo.org> | 2025-05-20 22:51:45 +0200 |
| commit | f339ee5843ba31255239bce871c470cfef590bee (patch) | |
| tree | 8d501e6dad1867b8c0ed0db6404cce5fa1355ed8 /eclass/cmake.eclass | |
| parent | d976a68928e95e9a80fe4f7bb9069686e67af0aa (diff) | |
| download | kde-f339ee5843ba31255239bce871c470cfef590bee.tar.gz kde-f339ee5843ba31255239bce871c470cfef590bee.tar.bz2 kde-f339ee5843ba31255239bce871c470cfef590bee.zip | |
cmake.eclass: Add recursive CMakeLists.txt unsupported version detection
We need to ramp up detection of unsupported CMake build systems with
CMake 4. This will detect CMakeLists.txt files setting insufficient
cmake_minimum_required VERSION level even in project subdirectories,
putting out appropriate eqawarn message about the need to fix ${PN}.
That makes us not rely on tinderbox runs w/ unmasked cmake-4 slowly
being able to build everything up to leaf packages, and also helps
detect insufficient subproject minimums that could otherwise be masked
by USE flag choice.
Bug: https://bugs.gentoo.org/951350
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'eclass/cmake.eclass')
| -rw-r--r-- | eclass/cmake.eclass | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/eclass/cmake.eclass b/eclass/cmake.eclass index 083b566d261..59835b50f4c 100644 --- a/eclass/cmake.eclass +++ b/eclass/cmake.eclass @@ -362,6 +362,17 @@ cmake_src_configure() { # Fix xdg collision with sandbox xdg_environment_reset + local file ver cmreq_isold + while read -d '' -r file ; do + ver=$(sed -ne "/cmake_minimum_required/ s/.*\(\.\.\.\|\s\)\([0-9.]*\)\([)]\|\s\).*$/\2/p" \ + "${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) + # Prepare Gentoo override rules (set valid compiler, append CPPFLAGS etc.) local build_rules=${BUILD_DIR}/gentoo_rules.cmake @@ -543,6 +554,13 @@ cmake_src_configure() { cmakeargs+=( -C "${CMAKE_EXTRA_CACHE_FILE}" ) fi + if [[ ${cmreq_isold} ]]; then + eqawarn "QA Notice: Compatibility with CMake < 3.5 has been removed from CMake 4," + eqawarn "${CATEGORY}/${PN} will fail to build w/o a fix." + eqawarn "See also tracker bug #951350; check existing bug or file a new one for" + eqawarn "this package." + fi + pushd "${BUILD_DIR}" > /dev/null || die debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: mycmakeargs is ${mycmakeargs_local[*]}" echo "${CMAKE_BINARY}" "${cmakeargs[@]}" "${CMAKE_USE_DIR}" |
