add check for librapidcheck

declare RAPIDCHECK_HEADERS as variable
This commit is contained in:
Philipp Otterbein 2023-04-08 22:29:43 +02:00
parent 8f0ec323ea
commit 8ffc05e7ec

View file

@ -289,13 +289,24 @@ PKG_CHECK_MODULES([GTEST], [gtest_main])
# Look for rapidcheck. # 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 # No pkg-config yet, https://github.com/emil-e/rapidcheck/issues/302
AC_LANG_PUSH(C++) AC_LANG_PUSH(C++)
AC_SUBST(RAPIDCHECK_HEADERS) AC_SUBST(RAPIDCHECK_HEADERS)
[CXXFLAGS="-I $RAPIDCHECK_HEADERS $CXXFLAGS"] [CXXFLAGS="-I $RAPIDCHECK_HEADERS $CXXFLAGS"]
[LIBS="-lrapidcheck -lgtest $LIBS"]
AC_CHECK_HEADERS([rapidcheck/gtest.h], [], [], [#include <gtest/gtest.h>]) AC_CHECK_HEADERS([rapidcheck/gtest.h], [], [], [#include <gtest/gtest.h>])
dnl No good for C++ libs with mangled symbols dnl AC_CHECK_LIB doesn't work for C++ libs with mangled symbols
dnl AC_CHECK_LIB([rapidcheck], []) 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++) AC_LANG_POP(C++)
fi fi