diff options
author | Michael Palimaka <kensington@gentoo.org> | 2018-05-26 19:37:56 +1000 |
---|---|---|
committer | Andreas Sturmlechner <asturm@gentoo.org> | 2018-08-15 13:43:34 +0200 |
commit | 268f10ef6c0bea42edbecd71341953635c9aa4fa (patch) | |
tree | 2fd8576521d33c4f0d7a6927d8b0c9dc3f5a801d /eclass/cmake-utils.eclass | |
parent | kde5-functions.eclass: Drop obsolete KDE Applications 17.12.3 deps (diff) | |
download | gentoo-268f10ef6c0bea42edbecd71341953635c9aa4fa.tar.gz gentoo-268f10ef6c0bea42edbecd71341953635c9aa4fa.tar.bz2 gentoo-268f10ef6c0bea42edbecd71341953635c9aa4fa.zip |
cmake-utils.eclass: Port has_version usage handle EAPI=7
Diffstat (limited to 'eclass/cmake-utils.eclass')
-rw-r--r-- | eclass/cmake-utils.eclass | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass index e64502b3b9b0..7c76762c4957 100644 --- a/eclass/cmake-utils.eclass +++ b/eclass/cmake-utils.eclass @@ -226,9 +226,18 @@ _cmake_generator_to_use() { ninja) # if ninja is enabled but not installed, the build could fail # this could happen if ninja is manually enabled (eg. make.conf) but not installed - if ! ROOT=/ has_version dev-util/ninja; then - die "CMAKE_MAKEFILE_GENERATOR is set to ninja, but ninja is not installed. Please install dev-util/ninja or unset CMAKE_MAKEFILE_GENERATOR." - fi + case ${EAPI} in + 5|6) + if ! ROOT=/ has_version dev-util/ninja; then + die "CMAKE_MAKEFILE_GENERATOR is set to ninja, but ninja is not installed. Please install dev-util/ninja or unset CMAKE_MAKEFILE_GENERATOR." + fi + ;; + *) + if ! has_version -b dev-util/ninja; then + die "CMAKE_MAKEFILE_GENERATOR is set to ninja, but ninja is not installed. Please install dev-util/ninja or unset CMAKE_MAKEFILE_GENERATOR." + fi + ;; + esac generator_name="Ninja" ;; emake) @@ -511,11 +520,23 @@ cmake-utils_src_configure() { # Since cmake-3.4.0_rc1 "<FLAGS>" no longer contains includes and thus # we need to add "<INCLUDES>" local includes= + + local has_cmake_340= + case ${EAPI} in + 5|6) + has_cmake_34=$(ROOT=/ has_version \>=dev-util/cmake-3.4.0_rc1) + ;; + *) + has_cmake_34=$(has_version -b \>=dev-util/cmake-3.4.0_rc1) + ;; + esac + + if [[ ${PN} == cmake ]] ; then if $(ver_test $(ver_cut 1-3 ${PV}) -ge 3.4.0) ; then includes="<INCLUDES>" fi - elif ROOT=/ has_version \>=dev-util/cmake-3.4.0_rc1 ; then + elif [[ ${has_cmake_340} ]]; then includes="<INCLUDES>" fi cat > "${build_rules}" <<- _EOF_ || die |