AmdisCXXFeatures.cmake 546 Bytes
Newer Older
1
2
include(CheckCXXSourceCompiles)

3
4
set(CMAKE_REQUIRED_FLAGS "-pedantic-errors")

5
6
7
8
9
10
11
12
13
14
check_cxx_source_compiles("
  #include <iostream>
  #include <tuple>
  int main()
  {
    auto tup = std::make_tuple(0, 'a', 3.14);
    for... (auto elem : tup)
      std::cout << elem << std::endl;
  }
"  AMDIS_HAS_EXPANSION_STATEMENTS
15
16
17
18
19
20
21
22
23
24
25
26
27
)

check_cxx_source_compiles("
  template <auto n>
  struct Foo {};
  int main()
  {
    Foo<0> foo_int;
    Foo<true> foo_bool;
    Foo<1u> foo_unsigned;
  }
"  AMDIS_HAS_CXX_AUTO_TEMPLATE_PARAMETER
)
28
29

unset(CMAKE_REQUIRED_FLAGS)