commit:     fd3e7f8444703cec62a422c6cc33f26cea4442b7
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 23 14:03:06 2024 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Sat Mar 23 14:08:50 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fd3e7f84

dev-libs/ncnn: fix openmp automagic

Meant to do this earlier but kind of forgot about it.

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 .../ncnn/{ncnn-20240102.ebuild => ncnn-20240102-r1.ebuild}  | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/dev-libs/ncnn/ncnn-20240102.ebuild 
b/dev-libs/ncnn/ncnn-20240102-r1.ebuild
similarity index 82%
rename from dev-libs/ncnn/ncnn-20240102.ebuild
rename to dev-libs/ncnn/ncnn-20240102-r1.ebuild
index d2e68b1ee053..0a726c51cc3e 100644
--- a/dev-libs/ncnn/ncnn-20240102.ebuild
+++ b/dev-libs/ncnn/ncnn-20240102-r1.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=8
 
-inherit cmake
+inherit cmake toolchain-funcs
 
 DESCRIPTION="High-performance neural network inference framework"
 HOMEPAGE="https://github.com/Tencent/ncnn/";
@@ -15,7 +15,7 @@ SRC_URI="
 LICENSE="BSD ZLIB"
 SLOT="0/${PV}" # currently has unstable ABI that often requires rebuilds
 KEYWORDS="amd64 ~x86"
-IUSE="tools +vulkan"
+IUSE="openmp tools +vulkan"
 
 # Need the static library to run tests + skip vulkan / GPU:
 # -DNCNN_BUILD_TESTS=ON -DNCNN_SHARED_LIB=OFF -DNCNN_VULKAN=OFF
@@ -38,11 +38,20 @@ DEPEND="
 
 DOCS=( README.md docs/. )
 
+pkg_pretend() {
+       [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+}
+
+pkg_setup() {
+       [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+}
+
 src_configure() {
        local mycmakeargs=(
                -DGLSLANG_TARGET_DIR="${ESYSROOT}"/usr/$(get_libdir)/cmake
                -DNCNN_BUILD_EXAMPLES=no
                -DNCNN_BUILD_TOOLS=$(usex tools)
+               -DNCNN_OPENMP=$(usex openmp)
                -DNCNN_PYTHON=no # todo if something needs it
                -DNCNN_SHARED_LIB=yes
                -DNCNN_SIMPLEVK=no

Reply via email to