nlohmann-json: Optionize tests to greatly cut down on build times.

This commit is contained in:
nia 2023-11-21 17:37:52 +00:00
parent 6a77310b5d
commit eb758664ce
3 changed files with 24 additions and 8 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.1 2022/12/28 20:18:21 nikita Exp $
# $NetBSD: Makefile,v 1.2 2023/11/21 17:37:52 nia Exp $
DISTNAME= nlohmann-json-3.11.2
CATEGORIES= textproc
@ -11,11 +11,8 @@ HOMEPAGE= https://json.nlohmann.me/
COMMENT= JSON library for Modern C++
LICENSE= mit
USE_CMAKE= yes
USE_LANGUAGES= c c++11
# FIXME: Downloads test data from a fixed tag in a git repository,
# package https://github.com/nlohmann/json_test_data to prevent downloads.
# FIXME: A small number of tests assume that WRKSRC is a git checkout.
TEST_TARGET= test
.include "options.mk"
.include "../../devel/cmake/build.mk"
.include "../../mk/bsd.pkg.mk"

View File

@ -1,4 +1,4 @@
@comment $NetBSD: PLIST,v 1.1 2022/12/28 20:18:21 nikita Exp $
@comment $NetBSD: PLIST,v 1.2 2023/11/21 17:37:52 nia Exp $
include/nlohmann/adl_serializer.hpp
include/nlohmann/byte_container_with_subtype.hpp
include/nlohmann/detail/abi_macros.hpp
@ -43,7 +43,7 @@ include/nlohmann/json_fwd.hpp
include/nlohmann/ordered_map.hpp
include/nlohmann/thirdparty/hedley/hedley.hpp
include/nlohmann/thirdparty/hedley/hedley_undef.hpp
include/test_data.hpp
${PLIST.tests}include/test_data.hpp
share/cmake/nlohmann_json/nlohmann_jsonConfig.cmake
share/cmake/nlohmann_json/nlohmann_jsonConfigVersion.cmake
share/cmake/nlohmann_json/nlohmann_jsonTargets.cmake

View File

@ -0,0 +1,19 @@
# $NetBSD: options.mk,v 1.1 2023/11/21 17:37:52 nia Exp $
PKG_OPTIONS_VAR= PKG_OPTIONS.nlohmann-json
PKG_SUPPORTED_OPTIONS= tests
.include "../../mk/bsd.options.mk"
PLIST_VARS+= tests
.if !empty(PKG_OPTIONS:Mtests)
# FIXME: Downloads test data from a fixed tag in a git repository,
# package https://github.com/nlohmann/json_test_data to prevent downloads.
# FIXME: A small number of tests assume that WRKSRC is a git checkout.
PLIST.tests= yes
TEST_TARGET= test
CMAKE_ARGS+= -DJSON_BuildTests=ON
.else
CMAKE_ARGS+= -DJSON_BuildTests=OFF
.endif