summaryrefslogtreecommitdiff
blob: 67870a6bfa634e2c05b8fd41efd7a4f5d3b15737 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit cmake

DESCRIPTION="Intel Open Path Guiding Library"
HOMEPAGE="https://github.com/OpenPathGuidingLibrary/openpgl"
SRC_URI="https://github.com/OpenPathGuidingLibrary/openpgl/archive/v${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="-* ~amd64 ~arm64"

X86_CPU_FLAGS=( sse4_2 avx2 avx512dq )
CPU_FLAGS=( cpu_flags_arm_neon ${X86_CPU_FLAGS[@]/#/cpu_flags_x86_} )
IUSE="${CPU_FLAGS[@]} debug"
REQUIRED_USE="|| ( ${CPU_FLAGS[@]} )"

RDEPEND="
	media-libs/embree
	dev-cpp/tbb:=
"
DEPEND="${RDEPEND}"

src_configure() {
	local mycmakeargs=(
		-DOPENPGL_ISA_AVX2=$(usex cpu_flags_x86_avx2)
		-DOPENPGL_ISA_AVX512=$(usex cpu_flags_x86_avx512dq)
		-DOPENPGL_ISA_SSE4=$(usex cpu_flags_x86_sse4_2)
		# TODO look into neon 2x support
		-DOPENPGL_ISA_NEON=$(usex cpu_flags_arm_neon)
	)

	# Disable asserts
	append-cppflags $(usex debug '' '-DNDEBUG')

	cmake_src_configure
}