aboutsummaryrefslogtreecommitdiffstats
path: root/community/benchmark/APKBUILD
blob: 8e126ae095a10d4b62a50cc035c06a3b3d4f0e21 (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
41
42
43
44
# Contributor: Duncan Bellamy <dunk@denkimushi.com>
# Maintainer: Duncan Bellamy <dunk@denkimushi.com>
pkgname=benchmark
pkgver=1.8.3
pkgrel=0
pkgdesc="microbenchmark support library"
url="https://github.com/google/benchmark"
arch="all"
license="Apache-2.0"
makedepends="cmake doxygen gtest-dev samurai"
subpackages="$pkgname-dev $pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/google/benchmark/archive/v$pkgver.tar.gz"

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build \
		-G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DBENCHMARK_ENABLE_ASSEMBLY_TESTS=OFF \
		-DBENCHMARK_ENABLE_DOXYGEN=ON \
		-DBENCHMARK_ENABLE_LTO=ON \
		-DBENCHMARK_ENABLE_WERROR=OFF \
		-DBENCHMARK_USE_BUNDLED_GTEST=OFF \
		$CMAKE_CROSSOPTS .
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
4e12114251c79a426873cfba6e27270b69fc980cef9a68e9cb3170f8e2e203f77dee19ab1e65cad51cd67e60991d3bbfdd52553f22522ce5e6c611b5aa07602c  benchmark-1.8.3.tar.gz
"