1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 # @ECLASS: cmake-multilib.eclass
6 # gx86-multilib team <multilib@gentoo.org>
8 # Author: Michał Górny <mgorny@gentoo.org>
9 # @SUPPORTED_EAPIS: 6 7
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 # @ECLASS-VARIABLE: CMAKE_ECLASS
24 # Default is "cmake-utils" for compatibility. Specify "cmake" for ebuilds
25 # that ported from cmake-utils.eclass to cmake.eclass already.
26 : ${CMAKE_ECLASS:=cmake-utils}
30 *) die "EAPI=${EAPI} is not supported" ;;
33 if [[ ${CMAKE_IN_SOURCE_BUILD} ]]; then
34 die "${ECLASS}: multilib support requires out-of-source builds."
37 case ${CMAKE_ECLASS} in
40 eerror "Unknown value for \${CMAKE_ECLASS}"
41 die "Value ${CMAKE_ECLASS} is not supported"
45 inherit ${CMAKE_ECLASS} multilib-minimal
47 EXPORT_FUNCTIONS src_configure src_compile src_test src_install
49 cmake-multilib_src_configure() {
50 local _cmake_args=( "${@}" )
52 multilib-minimal_src_configure
55 multilib_src_configure() {
56 ${CMAKE_ECLASS}_src_configure "${_cmake_args[@]}"
59 cmake-multilib_src_compile() {
60 local _cmake_args=( "${@}" )
62 multilib-minimal_src_compile
65 multilib_src_compile() {
66 ${CMAKE_ECLASS}_src_compile "${_cmake_args[@]}"
69 cmake-multilib_src_test() {
70 local _cmake_args=( "${@}" )
72 multilib-minimal_src_test
76 ${CMAKE_ECLASS}_src_test "${_cmake_args[@]}"
79 cmake-multilib_src_install() {
80 local _cmake_args=( "${@}" )
82 multilib-minimal_src_install
85 multilib_src_install() {
86 ${CMAKE_ECLASS}_src_install "${_cmake_args[@]}"