aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorPhilipp Otterbein <potterbein@blockstream.com>2023-04-08 22:29:43 +0200
committerPhilipp Otterbein <potterbein@blockstream.com>2023-04-08 22:29:43 +0200
commit8ffc05e7ec7da1bff88fafeab9617bcf04005d62 (patch)
tree1287b847eb904201dfb0d5ef49a3a2a1d9493126 /configure.ac
parent8f0ec323ea0cb4791ca8edfe122b0d7523acfc80 (diff)
add check for librapidcheck
declare RAPIDCHECK_HEADERS as variable
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac15
1 files changed, 13 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