diff options
Diffstat (limited to 'eclass')
| -rw-r--r-- | eclass/cmake.eclass | 45 |
1 files changed, 28 insertions, 17 deletions
diff --git a/eclass/cmake.eclass b/eclass/cmake.eclass index 72212d0fd96..5ce56bc461b 100644 --- a/eclass/cmake.eclass +++ b/eclass/cmake.eclass @@ -363,37 +363,48 @@ _cmake_minreqver-info() { weak_qaw="" # weak notice: no "QA Notice" starting with second call } + local info minreqver_listing() { - local info - eqawarn "${2}" case ${1} in - 305) for info in ${_CMAKE_MINREQVER_CMAKE305[*]}; do eqawarn " ${info}"; done ;; - 310) for info in ${_CMAKE_MINREQVER_CMAKE310[*]}; do eqawarn " ${info}"; done ;; - 316) for info in ${_CMAKE_MINREQVER_CMAKE316[*]}; do eqawarn " ${info}"; done ;; + 305) + eqawarn "The following CMakeLists.txt files are causing errors:" + for info in ${_CMAKE_MINREQVER_CMAKE305[*]}; do eqawarn " ${info}"; done + eqawarn + ;; + 310) + if [[ -n ${_CMAKE_MINREQVER_CMAKE310[@]} ]]; then + eqawarn "The following CMakeLists.txt files are causing warnings:" + for info in ${_CMAKE_MINREQVER_CMAKE310[*]}; do eqawarn " ${info}"; done + eqawarn + fi + ;; + 316) + if [[ ${warnlvl} -ge 316 ]] && [[ -n ${_CMAKE_MINREQVER_CMAKE316[@]} ]]; then + eqawarn "The following CMakeLists.txt files are causing warnings:" + for info in ${_CMAKE_MINREQVER_CMAKE316[*]}; do eqawarn " ${info}"; done + eqawarn + fi + ;; esac - eqawarn } # CMake 4-caused error is highest priority and must always be shown if [[ -n ${_CMAKE_MINREQVER_CMAKE305[@]} ]]; then minreqver_qanotice 305 - minreqver_listing 305 "The following CMakeLists.txt files are causing errors:" - if ! [[ ${CMAKE_QA_COMPAT_SKIP} ]] && has_version -b ">=dev-build/cmake-4"; then - eqawarn "CMake 4 detected; building with -DCMAKE_POLICY_VERSION_MINIMUM=3.5" - eqawarn "This is merely a workaround to avoid CMake Error and *not* a permanent fix;" - eqawarn "there may be new build or runtime bugs as a result." - fi - eqawarn + minreqver_listing 305 fi # for warnings, we only want the latest relevant one, but list all flagged files if [[ ${warnlvl} -ge 310 ]]; then minreqver_qanotice ${warnlvl} - [[ -n ${_CMAKE_MINREQVER_CMAKE310[@]} ]] && - minreqver_listing 310 "The following CMakeLists.txt files are causing warnings:" - [[ ${warnlvl} -ge 316 ]] && [[ -n ${_CMAKE_MINREQVER_CMAKE316[@]} ]] && - minreqver_listing 316 "The following CMakeLists.txt files are causing warnings:" + for info in 310 316; do minreqver_listing ${info}; done fi if [[ ${warnlvl} ]]; then + if [[ -n ${_CMAKE_MINREQVER_CMAKE305[@]} ]] && has_version -b ">=dev-build/cmake-4"; then + eqawarn "CMake 4 detected; building with -DCMAKE_POLICY_VERSION_MINIMUM=3.5" + eqawarn "This is merely a workaround to avoid CMake Error and *not* a permanent fix;" + eqawarn "there may be new build or runtime bugs as a result." + eqawarn + fi eqawarn "An upstreamable patch should take any resulting CMake policy changes" eqawarn "into account. See also:" eqawarn " https://cmake.org/cmake/help/latest/manual/cmake-policies.7.html" |
