aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2023-03-30 16:28:53 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2023-03-30 16:28:53 -0400
commitaa99005004bccc9be506a2a2f162f78bad4bcb41 (patch)
treeeeda5852bad75701d48776cd141bbc8f857480e0 /configure.ac
parentd381248ec0847cacd918480e83a99287f814456a (diff)
parent06d87b95bc751480d5961def9c0a21f557103625 (diff)
Merge remote-tracking branch 'upstream/master' into path-info
Also improve content-address.hh API docs.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac17
1 files changed, 17 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 09b3651b9..f1f45f868 100644
--- a/configure.ac
+++ b/configure.ac
@@ -145,6 +145,18 @@ if test "x$GCC_ATOMIC_BUILTINS_NEED_LIBATOMIC" = xyes; then
LDFLAGS="-latomic $LDFLAGS"
fi
+# Building without tests is useful for bootstrapping with a smaller footprint
+# or running the tests in a separate derivation. Otherwise, we do compile and
+# run them.
+AC_ARG_ENABLE(tests, AS_HELP_STRING([--disable-tests],[Do not build the tests]),
+ tests=$enableval, tests=yes)
+AC_SUBST(tests)
+
+# Building without API docs is the default as Nix' C++ interfaces are internal and unstable.
+AC_ARG_ENABLE(internal_api_docs, AS_HELP_STRING([--enable-internal-api-docs],[Build API docs for Nix's internal unstable C++ interfaces]),
+ internal_api_docs=$enableval, internal_api_docs=no)
+AC_SUBST(internal_api_docs)
+
# LTO is currently broken with clang for unknown reasons; ld segfaults in the llvm plugin
AC_ARG_ENABLE(lto, AS_HELP_STRING([--enable-lto],[Enable LTO (only supported with GCC) [default=no]]),
lto=$enableval, lto=no)
@@ -270,6 +282,8 @@ if test "$gc" = yes; then
fi
+if test "$tests" = yes; then
+
# Look for gtest.
PKG_CHECK_MODULES([GTEST], [gtest_main])
@@ -277,11 +291,14 @@ PKG_CHECK_MODULES([GTEST], [gtest_main])
# Look for rapidcheck.
# No pkg-config yet, https://github.com/emil-e/rapidcheck/issues/302
AC_LANG_PUSH(C++)
+AC_SUBST(RAPIDCHECK_HEADERS)
+[CXXFLAGS="-I $RAPIDCHECK_HEADERS $CXXFLAGS"]
AC_CHECK_HEADERS([rapidcheck/gtest.h], [], [], [#include <gtest/gtest.h>])
dnl No good for C++ libs with mangled symbols
dnl AC_CHECK_LIB([rapidcheck], [])
AC_LANG_POP(C++)
+fi
# Look for nlohmann/json.
PKG_CHECK_MODULES([NLOHMANN_JSON], [nlohmann_json >= 3.9])