kde.org.eclass: Allow to use SRC_URI in addition to live sources
[gentoo.git] / eclass / cmake.eclass
index f7887d0e26ffb120ba58a67f94d8ce7b0c496e45..3da3b9aeb5550abab8533079f511d75edf9569f7 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: cmake.eclass
@@ -294,6 +294,8 @@ _cmake_modify-cmakelists() {
 cmake_src_prepare() {
        debug-print-function ${FUNCNAME} "$@"
 
+       # FIXME: workaround from cmake-utils; use current working directory instead, bug #704524
+       # esp. test with 'special' pkgs like: app-arch/brotli, media-gfx/gmic, net-libs/quiche
        pushd "${S}" > /dev/null || die
 
        default_src_prepare
@@ -369,15 +371,6 @@ cmake_src_configure() {
        # Fix xdg collision with sandbox
        xdg_environment_reset
 
-       # @SEE CMAKE_BUILD_TYPE
-       if [[ ${CMAKE_BUILD_TYPE} = Gentoo ]]; then
-               # Handle release builds
-               if ! in_iuse debug || ! use debug; then
-                       local CPPFLAGS=${CPPFLAGS}
-                       append-cppflags -DNDEBUG
-               fi
-       fi
-
        # Prepare Gentoo override rules (set valid compiler, append CPPFLAGS etc.)
        local build_rules=${BUILD_DIR}/gentoo_rules.cmake
 
@@ -566,8 +559,10 @@ cmake_build() {
        case ${CMAKE_MAKEFILE_GENERATOR} in
                emake)
                        [[ -e Makefile ]] || die "Makefile not found. Error during configure stage."
-                       [[ "${CMAKE_VERBOSE}" != "OFF" ]] && local verbosity="VERBOSE=1"
-                       emake "${verbosity} "$@"
+                       case ${CMAKE_VERBOSE} in
+                               OFF) emake "$@" ;;
+                               *) emake VERBOSE=1 "$@" ;;
+                       esac
                        ;;
                ninja)
                        [[ -e build.ninja ]] || die "build.ninja not found. Error during configure stage."
@@ -583,7 +578,7 @@ cmake_build() {
 # @DESCRIPTION:
 # Banned. Use cmake_build instead.
 cmake-utils_src_make() {
-       die "cmake_src_make is banned. Use cmake_build instead"
+       die "cmake-utils_src_make is banned. Use cmake_build instead"
 }
 
 # @FUNCTION: cmake_src_test