From 8ffc05e7ec7da1bff88fafeab9617bcf04005d62 Mon Sep 17 00:00:00 2001 From: Philipp Otterbein Date: Sat, 8 Apr 2023 22:29:43 +0200 Subject: [PATCH 1/2] add check for librapidcheck declare RAPIDCHECK_HEADERS as variable --- configure.ac | 15 +++++++++++++-- 1 file 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 ]) -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 + #include + ]], [[ + return RUN_ALL_TESTS(); + ]]) + ], + [], + [AC_MSG_ERROR([librapidcheck is not found.])]) AC_LANG_POP(C++) fi From ca6b759f4ed95faba814ce0fda1668f09eb8faf3 Mon Sep 17 00:00:00 2001 From: Philipp Otterbein Date: Sun, 9 Apr 2023 02:33:53 +0200 Subject: [PATCH 2/2] fix failing configure in nix-tests --- flake.nix | 1 + 1 file changed, 1 insertion(+) 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;