Provide a configure flag to use the system doctest

This will allow distributions to more easily maintain
incompatibilies between doctest and the rest of their software.

Fixes #912

Signed-off-by: Randy Barlow <randy@electronsweatshop.com>
This commit is contained in:
Randy Barlow 2021-09-18 21:56:19 -04:00
parent 6761e2d7df
commit 85515b2c19
No known key found for this signature in database
GPG Key ID: 8BDEA098CD242B7A
4 changed files with 5527 additions and 5464 deletions

View File

@ -153,6 +153,27 @@ AS_IF([test "x$enable_simd" = "xyes"], [
])
AC_ARG_WITH([system_doctest],
AS_HELP_STRING(
[--with-system-doctest],
[Use the system provided doctest library rather than the bundled one]
),
[], []
)
AS_IF([test "x$with_system_doctest" = "xyes"], [
AC_CHECK_HEADERS(doctest/doctest.h)
AS_IF([test "x$ac_cv_header_doctest_doctest_h" != "xyes"], [
AC_MSG_ERROR([system doctest not found])dnl
])
AC_DEFINE([DOCTEST_HEADER], ["doctest/doctest.h"], [doctest include path])
])
AS_IF([test "x$with_system_doctest" != "xyes"], [
AC_DEFINE([DOCTEST_HEADER], ["doctest_vendored.hh"], [doctest include path])
AS_VAR_SET(doctest_vendored_h, "doctest_vendored.hh")
AC_SUBST(doctest_vendored_h)
])
LNAV_WITH_JEMALLOC

View File

@ -151,6 +151,9 @@ dist_noinst_DATA = \
$(FORMAT_FILES) \
xterm-palette.json
EXTRA_HEADERS = \
doctest_vendored.hh
noinst_HEADERS = \
all_logs_vtab.hh \
ansi_scrubber.hh \
@ -174,6 +177,7 @@ noinst_HEADERS = \
db_sub_source.hh \
doc_status_source.hh \
doctest.hh \
$(doctest_vendored_h) \
elem_to_json.hh \
environ_vtab.hh \
field_overlay_source.hh \

File diff suppressed because it is too large Load Diff

5464
src/doctest_vendored.hh Normal file

File diff suppressed because it is too large Load Diff