1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
5 # @ECLASS: cmake-multilib.eclass
7 # gx86-multilib team <multilib@gentoo.org>
9 # Author: Michał Górny <mgorny@gentoo.org>
10 # @BLURB: cmake-utils wrapper for multilib builds
12 # The cmake-multilib.eclass provides a glue between cmake-utils.eclass(5)
13 # and multilib-minimal.eclass(5), aiming to provide a convenient way
14 # to build packages using cmake for multiple ABIs.
16 # Inheriting this eclass sets IUSE and exports default multilib_src_*()
17 # sub-phases that call cmake-utils phase functions for each ABI enabled.
18 # The multilib_src_*() functions can be defined in ebuild just like
19 # in multilib-minimal, yet they ought to call appropriate cmake-utils
20 # phase rather than 'default'.
22 # EAPI=5 is required for meaningful MULTILIB_USEDEP.
25 *) die "EAPI=${EAPI} is not supported" ;;
28 if [[ ${CMAKE_IN_SOURCE_BUILD} ]]; then
29 die "${ECLASS}: multilib support requires out-of-source builds."
32 inherit cmake-utils multilib-minimal
34 EXPORT_FUNCTIONS src_configure src_compile src_test src_install
36 cmake-multilib_src_configure() {
37 local _cmake_args=( "${@}" )
39 multilib-minimal_src_configure
42 multilib_src_configure() {
43 cmake-utils_src_configure "${_cmake_args[@]}"
46 cmake-multilib_src_compile() {
47 local _cmake_args=( "${@}" )
49 multilib-minimal_src_compile
52 multilib_src_compile() {
53 cmake-utils_src_compile "${_cmake_args[@]}"
56 cmake-multilib_src_test() {
57 local _cmake_args=( "${@}" )
59 multilib-minimal_src_test
63 cmake-utils_src_test "${_cmake_args[@]}"
66 cmake-multilib_src_install() {
67 local _cmake_args=( "${@}" )
69 multilib-minimal_src_install
72 multilib_src_install() {
73 cmake-utils_src_install "${_cmake_args[@]}"