From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 689FC138334 for ; Sat, 21 Dec 2019 10:40:55 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CEFE5E0918; Sat, 21 Dec 2019 10:40:51 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id AB632E0918 for ; Sat, 21 Dec 2019 10:40:51 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 864D134D5E4 for ; Sat, 21 Dec 2019 10:40:50 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 4E05C991 for ; Sat, 21 Dec 2019 10:40:46 +0000 (UTC) From: "Andreas Sturmlechner" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Andreas Sturmlechner" Message-ID: <1576924822.4254dcbfdbd03a65488951dcafbff5b721aaf9c4.asturm@gentoo> Subject: [gentoo-commits] proj/kde:master commit in: eclass/ X-VCS-Repository: proj/kde X-VCS-Files: eclass/cmake.eclass X-VCS-Directories: eclass/ X-VCS-Committer: asturm X-VCS-Committer-Name: Andreas Sturmlechner X-VCS-Revision: 4254dcbfdbd03a65488951dcafbff5b721aaf9c4 X-VCS-Branch: master Date: Sat, 21 Dec 2019 10:40:46 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: fe91a203-b02d-4a0d-a2b9-b22255672abc X-Archives-Hash: 91d307e0bf522bbf4d7771bf2502b632 commit: 4254dcbfdbd03a65488951dcafbff5b721aaf9c4 Author: Andreas Sturmlechner gentoo org> AuthorDate: Sun Nov 17 13:08:39 2019 +0000 Commit: Andreas Sturmlechner gentoo org> CommitDate: Sat Dec 21 10:40:22 2019 +0000 URL: https://gitweb.gentoo.org/proj/kde.git/commit/?id=4254dcbf cmake.eclass: Drop _cmake_generator_to_use() CMAKE_MAKEFILE_GENERATOR validity is already checked in global scope. Move the check for dev-util/ninja into src_prepare. Signed-off-by: Andreas Sturmlechner gentoo.org> eclass/cmake.eclass | 40 ++++++++++++++-------------------------- 1 file changed, 14 insertions(+), 26 deletions(-) diff --git a/eclass/cmake.eclass b/eclass/cmake.eclass index af8ca6faa5..ca23bf452c 100644 --- a/eclass/cmake.eclass +++ b/eclass/cmake.eclass @@ -146,31 +146,6 @@ _cmake_check_build_dir() { einfo "Working in BUILD_DIR: \"$BUILD_DIR\"" } -# Determine which generator to use -_cmake_generator_to_use() { - local generator_name - - case ${CMAKE_MAKEFILE_GENERATOR} in - 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 ! 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 - generator_name="Ninja" - ;; - emake) - generator_name="Unix Makefiles" - ;; - *) - eerror "Unknown value for \${CMAKE_MAKEFILE_GENERATOR}" - die "Value ${CMAKE_MAKEFILE_GENERATOR} is not supported" - ;; - esac - - echo ${generator_name} -} - # @FUNCTION: cmake_comment_add_subdirectory # @USAGE: # @DESCRIPTION: @@ -329,6 +304,13 @@ cmake_src_prepare() { die "FATAL: Unable to find CMakeLists.txt" fi + # 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 [[ ${CMAKE_MAKEFILE_GENERATOR} == ninja ]] && ! has_version -b dev-util/ninja; then + eerror "CMAKE_MAKEFILE_GENERATOR is set to ninja, but ninja is not installed." + die "Please install dev-util/ninja or unset CMAKE_MAKEFILE_GENERATOR." + fi + local modules_list if [[ $(declare -p CMAKE_REMOVE_MODULES_LIST) == "declare -a"* ]]; then modules_list=( "${CMAKE_REMOVE_MODULES_LIST[@]}" ) @@ -524,13 +506,19 @@ cmake_src_configure() { warn_unused_cli="--no-warn-unused-cli" fi + local generator_name + case ${CMAKE_MAKEFILE_GENERATOR} in + ninja) generator_name="Ninja" ;; + emake) generator_name="Unix Makefiles" ;; + esac + # Common configure parameters (overridable) # NOTE CMAKE_BUILD_TYPE can be only overridden via CMAKE_BUILD_TYPE eclass variable # No -DCMAKE_BUILD_TYPE=xxx definitions will be in effect. local cmakeargs=( ${warn_unused_cli} -C "${common_config}" - -G "$(_cmake_generator_to_use)" + -G "${generator_name}" -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr" "${mycmakeargs_local[@]}" -DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}"