From 1bd953502f96253a87c36085d356944621ba00c9 Mon Sep 17 00:00:00 2001 From: Andreas Sturmlechner Date: Sun, 17 Nov 2019 16:40:11 +0100 Subject: cmake.eclass: Drop _cmake_ninja_build() and _cmake_emake_build() Do it all in cmake_build() Signed-off-by: Andreas Sturmlechner --- eclass/cmake.eclass | 41 +++++++++++------------------------------ 1 file changed, 11 insertions(+), 30 deletions(-) (limited to 'eclass/cmake.eclass') diff --git a/eclass/cmake.eclass b/eclass/cmake.eclass index ef6a5c3d7f1..20ba229377b 100644 --- a/eclass/cmake.eclass +++ b/eclass/cmake.eclass @@ -547,35 +547,6 @@ cmake_src_compile() { cmake_build "$@" } -# @FUNCTION: _cmake_ninja_build -# @INTERNAL -# @DESCRIPTION: -# Build the package using ninja generator -_cmake_ninja_build() { - debug-print-function ${FUNCNAME} "$@" - - [[ -e build.ninja ]] || die "build.ninja not found. Error during configure stage." - - eninja "$@" -} - -# @FUNCTION: _cmake_emake_build -# @INTERNAL -# @DESCRIPTION: -# Build the package using make generator -_cmake_emake_build() { - debug-print-function ${FUNCNAME} "$@" - - [[ -e Makefile ]] || die "Makefile not found. Error during configure stage." - - if [[ "${CMAKE_VERBOSE}" != "OFF" ]]; then - emake VERBOSE=1 "$@" - else - emake "$@" - fi - -} - # @FUNCTION: cmake_build # @DESCRIPTION: # Function for building the package. Automatically detects the build type. @@ -586,7 +557,17 @@ cmake_build() { _cmake_check_build_dir pushd "${BUILD_DIR}" > /dev/null || die - _cmake_${CMAKE_MAKEFILE_GENERATOR}_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} ""$@" + ;; + ninja) + [[ -e build.ninja ]] || die "build.ninja not found. Error during configure stage." + eninja "$@" + ;; + esac popd > /dev/null || die } -- cgit v1.2.3