1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
8 inherit cmake-multilib flag-o-matic llvm
10 DESCRIPTION="LLVM-based OpenCL compiler targetting Intel Gen graphics hardware"
11 HOMEPAGE="https://github.com/intel/intel-graphics-compiler"
12 SRC_URI="https://github.com/intel/${PN}/archive/igc-${PV}.tar.gz -> ${P}.tar.gz"
21 COMMON="<=sys-devel/llvm-${LLVM_MAX_SLOT}.9999:=[${MULTILIB_USEDEP}]
22 <=dev-libs/opencl-clang-${LLVM_MAX_SLOT}.9999:=[${MULTILIB_USEDEP}]"
27 "${FILESDIR}"/${PN}-1.0.9-no_Werror.patch
30 S="${WORKDIR}"/${PN}-igc-${PV}
32 multilib_src_configure() {
33 # Select the same slot as the best opencl-clang
34 local ocl_clang_ver="$(best_version -d dev-libs/opencl-clang:=)"
35 einfo "Selecting $ocl_clang_ver"
36 local llvm_slot=$(ver_cut 5 $ocl_clang_ver)
37 # opencl-clang brings the right slot as dep
38 has_version -d sys-devel/llvm:$llvm_slot || die "LLVM slot matching $ocl_clang_ver not found ($llvm_slot)"
39 einfo "Selecting LLVM SLOT $llvm_slot: $(best_version -d sys-devel/llvm:$llvm_slot)"
41 # Since late March 2020 cmake.eclass does not set -DNDEBUG any more, and the way
42 # IGC uses this definition causes problems for some users (see Bug #718824).
43 use debug || append-cppflags -DNDEBUG
46 -DCMAKE_LIBRARY_PATH=$(get_llvm_prefix ${llvm_slot})/$(get_libdir)
47 -DIGC_OPTION__FORCE_SYSTEM_LLVM=ON
48 -DIGC_PREFERRED_LLVM_VERSION=${llvm_slot}