diff options
author | Gregory M. Turner <gmt@be-evil.net> | 2013-10-07 20:49:49 -0700 |
---|---|---|
committer | Gregory M. Turner <gmt@be-evil.net> | 2013-10-07 20:49:49 -0700 |
commit | 81bbaf7a694094ca533e89cb9797d4bb0037e850 (patch) | |
tree | ac1e9be209757fb56490eef7d20a90752059182f /eclass/cmake-multilib.eclass | |
parent | eclass/autotools-utils: @GET_LIBDIR@ substitution and ehooks (diff) | |
download | gmt-81bbaf7a694094ca533e89cb9797d4bb0037e850.tar.gz gmt-81bbaf7a694094ca533e89cb9797d4bb0037e850.tar.bz2 gmt-81bbaf7a694094ca533e89cb9797d4bb0037e850.zip |
eclass/cmake-{multilib,utils}.eclass: clone upstream
Signed-off-by: Gregory M. Turner <gmt@be-evil.net>
Diffstat (limited to 'eclass/cmake-multilib.eclass')
-rw-r--r-- | eclass/cmake-multilib.eclass | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/eclass/cmake-multilib.eclass b/eclass/cmake-multilib.eclass new file mode 100644 index 0000000..282cc21 --- /dev/null +++ b/eclass/cmake-multilib.eclass @@ -0,0 +1,58 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +# @ECLASS: cmake-multilib.eclass +# @MAINTAINER: +# Michał Górny <mgorny@gentoo.org> +# @BLURB: cmake-utils wrapper for multilib builds +# @DESCRIPTION: +# The cmake-multilib.eclass is a cmake-utils.eclass(5) wrapper +# introducing support for building for more than one ABI (multilib). +# +# Inheriting this eclass sets IUSE and exports cmake-utils phase +# function wrappers which build the package for each supported ABI +# if the appropriate flag is enabled. +# +# Note that the multilib support requires out-of-source builds to be +# enabled. Thus, it is impossible to use CMAKE_IN_SOURCE_BUILD with +# it. + +# EAPI=5 is required for meaningful MULTILIB_USEDEP. +case ${EAPI:-0} in + 5) ;; + *) die "EAPI=${EAPI} is not supported" ;; +esac + +if [[ ${CMAKE_IN_SOURCE_BUILD} ]]; then + die "${ECLASS}: multilib support requires out-of-source builds." +fi + +inherit cmake-utils multilib-build + +EXPORT_FUNCTIONS src_configure src_compile src_test src_install + +cmake-multilib_src_configure() { + multilib_parallel_foreach_abi cmake-utils_src_configure "${@}" +} + +cmake-multilib_src_compile() { + multilib_foreach_abi cmake-utils_src_compile "${@}" +} + +cmake-multilib_src_test() { + multilib_foreach_abi cmake-utils_src_test "${@}" +} + +cmake-multilib_src_install() { + cmake-multilib_secure_install() { + cmake-utils_src_install "${@}" + + # Make sure all headers are the same for each ABI. + multilib_prepare_wrappers + multilib_check_headers + } + + multilib_foreach_abi cmake-multilib_secure_install "${@}" + multilib_install_wrappers +} |