aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac15
-rw-r--r--flake.nix1
2 files changed, 14 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index f1f45f868..e587bd563 100644
--- a/configure.ac
+++ b/configure.ac
@@ -289,13 +289,24 @@ PKG_CHECK_MODULES([GTEST], [gtest_main])
# Look for rapidcheck.
+AC_ARG_VAR([RAPIDCHECK_HEADERS], [include path of gtest headers shipped by 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"]
+[LIBS="-lrapidcheck -lgtest $LIBS"]
AC_CHECK_HEADERS([rapidcheck/gtest.h], [], [], [#include <gtest/gtest.h>])
-dnl No good for C++ libs with mangled symbols
-dnl AC_CHECK_LIB([rapidcheck], [])
+dnl AC_CHECK_LIB doesn't work for C++ libs with mangled symbols
+AC_LINK_IFELSE([
+ AC_LANG_PROGRAM([[
+ #include <gtest/gtest.h>
+ #include <rapidcheck/gtest.h>
+ ]], [[
+ return RUN_ALL_TESTS();
+ ]])
+ ],
+ [],
+ [AC_MSG_ERROR([librapidcheck is not found.])])
AC_LANG_POP(C++)
fi
diff --git a/flake.nix b/flake.nix
index dc64bdfcf..a4ee80b32 100644
--- a/flake.nix
+++ b/flake.nix
@@ -219,6 +219,7 @@
enableParallelBuilding = true;
+ configureFlags = testConfigureFlags; # otherwise configure fails
dontBuild = true;
doInstallCheck = true;