# Contributor: Max Rees <maxcrees@me.com>
# Maintainer: Max Rees <maxcrees@me.com>
pkgname=spdlog
pkgver=1.5.0
pkgrel=0
pkgdesc="C++ header-only logging library"
url="https://github.com/gabime/spdlog"
arch="all"
license="MIT AND BSD-2-Clause"
depends=""
makedepends="cmake"
source="$pkgname-$pkgver.tar.gz::https://github.com/gabime/spdlog/archive/v$pkgver.tar.gz"

build() {
	cmake \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DCMAKE_BUILD_TYPE=RelWithDebugInfo \
		-DSPDLOG_BUILD_SHARED=ON \
		-DSPDLOG_BUILD_TESTS=ON \
		-DSPDLOG_BUILD_BENCH=OFF \
		-DSPDLOG_BUILD_EXAMPLES=OFF
	make
}

check() {
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="78991c943dd95af563c4b29545b9b5d635caf1af5031262dde734ecf70c0b4ae866d954ee77b050f9f0cc089a3bc57ee9583895e51cb00dd1cc6c10ff905ca34  spdlog-1.5.0.tar.gz"