/[gentoo-x86]/eclass/cmake-utils.eclass
Gentoo

Diff of /eclass/cmake-utils.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.101 Revision 1.102
1# Copyright 1999-2013 Gentoo Foundation 1# Copyright 1999-2014 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/cmake-utils.eclass,v 1.101 2013/12/24 14:54:26 dilfridge Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/cmake-utils.eclass,v 1.102 2014/01/25 04:07:04 floppym Exp $
4 4
5# @ECLASS: cmake-utils.eclass 5# @ECLASS: cmake-utils.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# kde@gentoo.org 7# kde@gentoo.org
8# @AUTHOR: 8# @AUTHOR:
521 521
522 has src_configure ${CMAKE_EXPF} || cmake-utils_src_configure 522 has src_configure ${CMAKE_EXPF} || cmake-utils_src_configure
523 cmake-utils_src_make "$@" 523 cmake-utils_src_make "$@"
524} 524}
525 525
526_ninjaopts_from_makeopts() {
527 if [[ ${NINJAOPTS+set} == set ]]; then
528 return 0
529 fi
530 local ninjaopts=()
531 set -- ${MAKEOPTS}
532 while (( $# )); do
533 case $1 in
534 -j|-l|-k)
535 ninjaopts+=( $1 $2 )
536 shift 2
537 ;;
538 -j*|-l*|-k*)
539 ninjaopts+=( $1 )
540 shift 1
541 ;;
542 *) shift ;;
543 esac
544 done
545 export NINJAOPTS="${ninjaopts[*]}"
546}
547
526# @FUNCTION: ninja_src_make 548# @FUNCTION: ninja_src_make
527# @INTERNAL 549# @INTERNAL
528# @DESCRIPTION: 550# @DESCRIPTION:
529# Build the package using ninja generator 551# Build the package using ninja generator
530ninja_src_make() { 552ninja_src_make() {
531 debug-print-function ${FUNCNAME} "$@" 553 debug-print-function ${FUNCNAME} "$@"
532 554
533 [[ -e build.ninja ]] || die "Makefile not found. Error during configure stage." 555 [[ -e build.ninja ]] || die "build.ninja not found. Error during configure stage."
534 556
557 _ninjaopts_from_makeopts
558
535 if [[ "${CMAKE_VERBOSE}" != "OFF" ]]; then 559 if [[ "${CMAKE_VERBOSE}" != "OFF" ]]; then
536 # TODO: get load average from portage (-l option) 560 set -- ninja ${NINJAOPTS} -v "$@"
537 ninja ${MAKEOPTS} -v "$@" || die
538 else 561 else
562 set -- ninja ${NINJAOPTS} "$@"
563 fi
564
565 echo "$@"
539 ninja "$@" || die 566 "$@" || die
540 fi
541} 567}
542 568
543# @FUNCTION: emake_src_make 569# @FUNCTION: emake_src_make
544# @INTERNAL 570# @INTERNAL
545# @DESCRIPTION: 571# @DESCRIPTION:
546# Build the package using make generator 572# Build the package using make generator
547emake_src_make() { 573emake_src_make() {
548 debug-print-function ${FUNCNAME} "$@" 574 debug-print-function ${FUNCNAME} "$@"
549 575
550 [[ -e Makefile ]] || die "Makefile not found. Error during configure stage." 576 [[ -e Makefile ]] || die "Makefile not found. Error during configure stage."
551 577
552 if [[ "${CMAKE_VERBOSE}" != "OFF" ]]; then 578 if [[ "${CMAKE_VERBOSE}" != "OFF" ]]; then
553 emake VERBOSE=1 "$@" || die 579 emake VERBOSE=1 "$@" || die
554 else 580 else
555 emake "$@" || die 581 emake "$@" || die
556 fi 582 fi
557 583
558} 584}
559 585

Legend:
Removed from v.1.101  
changed lines
  Added in v.1.102

  ViewVC Help
Powered by ViewVC 1.1.20