1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python{2_7,3_{6,7}} )
7 inherit cmake-utils llvm llvm.org multiprocessing python-any-r1
9 DESCRIPTION="The LLVM linker (link editor)"
10 HOMEPAGE="https://llvm.org/"
11 LLVM_COMPONENTS=( lld )
12 LLVM_TEST_COMPONENTS=( llvm/utils/{lit,unittest} )
15 LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
19 RESTRICT="!test? ( test )"
21 RDEPEND="~sys-devel/llvm-${PV}"
23 BDEPEND="test? ( $(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]") )"
25 # least intrusive of all
26 CMAKE_BUILD_TYPE=RelWithDebInfo
29 has_version -b "dev-python/lit[${PYTHON_USEDEP}]"
33 LLVM_MAX_SLOT=${PV%%.*} llvm_pkg_setup
34 use test && python-any-r1_pkg_setup
39 -DBUILD_SHARED_LIBS=OFF
41 -DLLVM_INCLUDE_TESTS=$(usex test)
43 use test && mycmakeargs+=(
45 -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
46 -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
47 -DLLVM_LIT_ARGS="-vv;-j;${LIT_JOBS:-$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")}"
50 cmake-utils_src_configure
54 local -x LIT_PRESERVES_TMP=1
55 cmake-utils_src_make check-lld
59 cmake-utils_src_install
60 # LLD has no shared libraries, so strip it all for the time being
61 rm -r "${ED}"/usr/{include,lib*} || die