# Template file for 'json-c++'
pkgname=json-c++
version=3.12.0
revision=2
build_style=cmake
configure_args="-DJSON_MultipleHeaders=ON"
checkdepends="git"
short_desc="JSON for modern C++"
maintainer="Érico Nogueira <ericonr@disroot.org>"
license="MIT"
homepage="https://github.com/nlohmann/json"
distfiles="https://github.com/nlohmann/json/archive/v${version}.tar.gz"
checksum=4b92eb0c06d10683f7447ce9406cb97cd4b453be18d7279320f7b2f025c10187

do_check() {
	# skip tests requiring wrksrc to be a git clone as they always fail
	cd build
	if [ "$XBPS_TARGET_LIBC" = "glibc" ]; then
		ctest -LE "git_required"
	else
		# also skip locale-dependent test
		ctest -LE "git_required" -E "test-locale-cpp_cpp11"
	fi
}

post_install() {
	vdoc README.md
	vlicense LICENSE.MIT
}
