aboutsummaryrefslogtreecommitdiffstats
path: root/community/benchmark/APKBUILD
blob: 102e34c43bf4c6cfe7152d453276b1ec174ffb41 (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.6.1
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="
7d3e3baf5a2d92e9552ab5007c37253b3510ac269edf8922a2794ff3dfbd0bf5b4c519240d4577b1ec30ef9e8a64caa17a809054c3dc7f2b1bcd410596177d67  benchmark-1.6.1.tar.gz
"