Echo Writes Code

CrucibleCheckTargetSupported.cmake

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
include_guard(GLOBAL)

include(CheckCXXSourceCompiles)

function(check_crucible_supports_target)
  check_cxx_source_compiles(
    "
    #include <climits>
    static_assert(sizeof(void *) == 8);
    static_assert(CHAR_BIT == 8);
    int main() { return 0; }
    "
    HAVE_64_BITS)

  if(NOT HAVE_64_BITS)
    message(FATAL_ERROR "Crucible only supports 64-bit targets with 8-bit bytes")
  endif()
endfunction()