# Description: High level abstract threading library
# URL: https://www.threadingbuildingblocks.org/
# Maintainer: Tim Biermann, tbier at posteo dot de
# Depends on: cmake hwloc ninja swig

name=onetbb
version=2021.9.0
release=1
source=(https://github.com/oneapi-src/oneTBB/archive/v$version/$name-$version.tar.gz)

build() {
  cmake -S oneTBB-$version -B build -G Ninja \
    -D CMAKE_INSTALL_PREFIX=/usr \
    -D CMAKE_INSTALL_LIBDIR=lib \
    -D CMAKE_BUILD_TYPE=Release \
    -D CMAKE_CXX_FLAGS_RELEASE="$CXXFLAGS -Wno-error=address -Wno-error=uninitialized" \
    -D CMAKE_C_FLAGS_RELEASE="$CFLAGS -Wno-error=address -Wno-error=uninitialized" \
    -D TBB4PY_BUILD=ON \
    -D TBB_STRICT=OFF \
    -Wno-dev
  cmake --build build --target all python_build
  DESTDIR=$PKG cmake --install build

  rm -r $PKG/usr/share/doc
}
