Add workarounds for building against CVC4 on ArchLinux.

This commit is contained in:
Daniel Kirchner 2018-08-08 16:31:17 +02:00
parent 551343ae3e
commit 9b4546c487
3 changed files with 21 additions and 2 deletions

View File

@ -1,8 +1,16 @@
if (USE_CVC4) if (USE_CVC4)
find_path(CVC4_INCLUDE_DIR cvc4/cvc4.h) find_path(CVC4_INCLUDE_DIR cvc4/cvc4.h)
find_library(CVC4_LIBRARY NAMES cvc4 ) find_library(CVC4_LIBRARY NAMES cvc4)
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(CVC4 DEFAULT_MSG CVC4_LIBRARY CVC4_INCLUDE_DIR) find_package_handle_standard_args(CVC4 DEFAULT_MSG CVC4_LIBRARY CVC4_INCLUDE_DIR)
if(CVC4_FOUND)
find_library(CLN_LIBRARY NAMES cln)
if(CLN_LIBRARY)
set(CVC4_LIBRARIES ${CVC4_LIBRARY} ${CLN_LIBRARY})
else()
set(CVC4_LIBRARIES ${CVC4_LIBRARY})
endif()
endif()
else() else()
set(CVC4_FOUND FALSE) set(CVC4_FOUND FALSE)
endif() endif()

View File

@ -39,6 +39,6 @@ if (${Z3_FOUND})
endif() endif()
if (${CVC4_FOUND} AND ${GMP_FOUND}) if (${CVC4_FOUND} AND ${GMP_FOUND})
target_link_libraries(solidity PUBLIC ${CVC4_LIBRARY}) target_link_libraries(solidity PUBLIC ${CVC4_LIBRARIES})
target_link_libraries(solidity PUBLIC ${GMP_LIBRARY}) target_link_libraries(solidity PUBLIC ${GMP_LIBRARY})
endif() endif()

View File

@ -21,8 +21,19 @@
#include <boost/noncopyable.hpp> #include <boost/noncopyable.hpp>
#if defined(__GLIBC__)
// The CVC4 headers includes the deprecated system headers <ext/hash_map>
// and <ext/hash_set>. These headers cause a warning that will break the
// build, unless _GLIBCXX_PERMIT_BACKWARD_HASH is set.
#define _GLIBCXX_PERMIT_BACKWARD_HASH
#endif
#include <cvc4/cvc4.h> #include <cvc4/cvc4.h>
#if defined(__GLIBC__)
#undef _GLIBCXX_PERMIT_BACKWARD_HASH
#endif
namespace dev namespace dev
{ {
namespace solidity namespace solidity