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

Contents of /eclass/cmake-multilib.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (hide annotations) (download)
Wed Nov 20 19:23:45 2013 UTC (9 months, 4 weeks ago) by mgorny
Branch: MAIN
Changes since 1.3: +7 -4 lines
Run multilib header wrapping only when multiple ABIs are enabled, bug #491752. Other eclasses do that already.

1 mgorny 1.1 # Copyright 1999-2013 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3 mgorny 1.4 # $Header: /var/cvsroot/gentoo-x86/eclass/cmake-multilib.eclass,v 1.3 2013/09/06 17:11:52 axs Exp $
4 mgorny 1.1
5     # @ECLASS: cmake-multilib.eclass
6     # @MAINTAINER:
7     # Michał Górny <mgorny@gentoo.org>
8     # @BLURB: cmake-utils wrapper for multilib builds
9     # @DESCRIPTION:
10     # The cmake-multilib.eclass is a cmake-utils.eclass(5) wrapper
11     # introducing support for building for more than one ABI (multilib).
12     #
13     # Inheriting this eclass sets IUSE and exports cmake-utils phase
14     # function wrappers which build the package for each supported ABI
15     # if the appropriate flag is enabled.
16     #
17     # Note that the multilib support requires out-of-source builds to be
18     # enabled. Thus, it is impossible to use CMAKE_IN_SOURCE_BUILD with
19     # it.
20    
21     # EAPI=5 is required for meaningful MULTILIB_USEDEP.
22     case ${EAPI:-0} in
23     5) ;;
24     *) die "EAPI=${EAPI} is not supported" ;;
25     esac
26    
27     if [[ ${CMAKE_IN_SOURCE_BUILD} ]]; then
28     die "${ECLASS}: multilib support requires out-of-source builds."
29     fi
30    
31     inherit cmake-utils multilib-build
32    
33     EXPORT_FUNCTIONS src_configure src_compile src_test src_install
34    
35     cmake-multilib_src_configure() {
36 xmw 1.2 multilib_parallel_foreach_abi cmake-utils_src_configure "${@}"
37 mgorny 1.1 }
38    
39     cmake-multilib_src_compile() {
40 xmw 1.2 multilib_foreach_abi cmake-utils_src_compile "${@}"
41 mgorny 1.1 }
42    
43     cmake-multilib_src_test() {
44 xmw 1.2 multilib_foreach_abi cmake-utils_src_test "${@}"
45 mgorny 1.1 }
46    
47     cmake-multilib_src_install() {
48     cmake-multilib_secure_install() {
49 xmw 1.2 cmake-utils_src_install "${@}"
50 mgorny 1.1
51 mgorny 1.4 # Do multilib magic only when >1 ABI is used.
52     if [[ ${#MULTIBUILD_VARIANTS[@]} -gt 1 ]]; then
53     multilib_prepare_wrappers
54     # Make sure all headers are the same for each ABI.
55     multilib_check_headers
56     fi
57 mgorny 1.1 }
58    
59 xmw 1.2 multilib_foreach_abi cmake-multilib_secure_install "${@}"
60 axs 1.3 multilib_install_wrappers
61 mgorny 1.1 }

  ViewVC Help
Powered by ViewVC 1.1.20