diff options
author | Michał Górny <mgorny@gentoo.org> | 2018-03-15 22:11:44 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2018-03-15 22:12:43 +0100 |
commit | 1b84f21fdb4a5598f44052a91932eab4b4276caf (patch) | |
tree | 6a0ed1b46540887d15b0b205e1b262b690a4adaa /sys-libs/libcxxabi/libcxxabi-6.0.9999.ebuild | |
parent | sys-libs/libcxx: Fix calling lit with llvm-6+ (diff) | |
download | gentoo-1b84f21fdb4a5598f44052a91932eab4b4276caf.tar.gz gentoo-1b84f21fdb4a5598f44052a91932eab4b4276caf.tar.bz2 gentoo-1b84f21fdb4a5598f44052a91932eab4b4276caf.zip |
sys-libs/libcxxabi: Build local copy of libc++ for tests
Build a local copy of libc++ when performing tests instead of depending
on system instance. This avoids a circular dependency, and also makes
it possible to build & test libcxxabi independently of the installed
libc++ variant.
Diffstat (limited to 'sys-libs/libcxxabi/libcxxabi-6.0.9999.ebuild')
-rw-r--r-- | sys-libs/libcxxabi/libcxxabi-6.0.9999.ebuild | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/sys-libs/libcxxabi/libcxxabi-6.0.9999.ebuild b/sys-libs/libcxxabi/libcxxabi-6.0.9999.ebuild index b9675a9e147f..63e42c376c3d 100644 --- a/sys-libs/libcxxabi/libcxxabi-6.0.9999.ebuild +++ b/sys-libs/libcxxabi/libcxxabi-6.0.9999.ebuild @@ -20,7 +20,7 @@ EGIT_BRANCH="release_60" LICENSE="|| ( UoI-NCSA MIT )" SLOT="0" KEYWORDS="" -IUSE="+libunwind +static-libs test" +IUSE="+libunwind +static-libs test elibc_musl" RESTRICT="!test? ( test )" RDEPEND=" @@ -34,7 +34,6 @@ RDEPEND=" DEPEND="${RDEPEND} >=sys-devel/llvm-6 test? ( >=sys-devel/clang-3.9.0 - ~sys-libs/libcxx-${PV}[libcxxabi(-)] $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') )" # least intrusive of all @@ -56,7 +55,7 @@ src_unpack() { git-r3_fetch git-r3_checkout https://llvm.org/git/libcxx.git \ - "${WORKDIR}"/libcxx '' include utils/libcxx + "${WORKDIR}"/libcxx '' git-r3_checkout } @@ -83,12 +82,36 @@ multilib_src_configure() { cmake-utils_src_configure } +build_libcxx() { + local CMAKE_USE_DIR=${WORKDIR}/libcxx + local BUILD_DIR=${BUILD_DIR}/libcxx + local mycmakeargs=( + -DLIBCXX_LIBDIR_SUFFIX= + -DLIBCXX_ENABLE_SHARED=ON + -DLIBCXX_ENABLE_STATIC=OFF + -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF + -DLIBCXX_CXX_ABI=libcxxabi + -DLIBCXX_CXX_ABI_INCLUDE_PATHS="${S}"/include + -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF + -DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl) + -DLIBCXX_HAS_GCC_S_LIB=OFF + -DLIBCXX_INCLUDE_TESTS=OFF + ) + + cmake-utils_src_configure + cmake-utils_src_compile +} + multilib_src_test() { local clang_path=$(type -P "${CHOST:+${CHOST}-}clang" 2>/dev/null) [[ -n ${clang_path} ]] || die "Unable to find ${CHOST}-clang for tests" sed -i -e "/cxx_under_test/s^\".*\"^\"${clang_path}\"^" test/lit.site.cfg || die + # build a local copy of libc++ for testing to avoid circular dep + build_libcxx + cp "${BUILD_DIR}"/libcxx/lib/libc++* "${BUILD_DIR}/$(get_libdir)/" || die + cmake-utils_src_make check-libcxxabi } |