summaryrefslogtreecommitdiff
path: root/cmake/ConfigureCVC4.cmake
blob: bd88a2a1dc3de3980862570c566b9b6a1740ca05 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
include(CheckCXXSourceCompiles)

# Check whether "long" and "int64_t" are distinct types w.r.t. overloading.
# Even if they have the same size, they can be distinct, and some platforms
# can have problems with ambiguous function calls when auto-converting
# int64_t to long, and others will complain if you overload a function
# that takes an int64_t with one that takes a long (giving a redefinition
# error).  So we have to keep both happy.  Probably the same underlying
# issue as the hash specialization below, but let's check separately
# for flexibility.

check_cxx_source_compiles(
  "#include <stdint.h>
   void foo(long) {}
   void foo(int64_t) {}
   int main() { return 0; }"
  CVC4_NEED_INT64_T_OVERLOADS
)
if(NOT CVC4_NEED_INT64_T_OVERLOADS)
  set(CVC4_NEED_INT64_T_OVERLOADS 0)
endif()

# Check to see if this version/architecture of GNU C++ explicitly
# instantiates std::hash<uint64_t> or not.  Some do, some don't.
# See src/util/hash.h.

check_cxx_source_compiles(
  "#include <cstdint>
   #include <functional>
   namespace std { template<> struct hash<uint64_t> {}; }
   int main() { return 0; }"
  CVC4_NEED_HASH_UINT64_T_OVERLOAD
)
if(CVC4_NEED_HASH_UINT64_T_OVERLOAD)
  add_definitions(-DCVC4_NEED_HASH_UINT64_T)
endif()
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback