diff options
author | Brad King <brad.king@kitware.com> | 2020-11-06 13:48:34 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-11-06 14:17:30 (GMT) |
commit | fcc89bda1d726e59e2f021f8d094ab6159b48e57 (patch) | |
tree | 4de15df345e183b34f5635a3cbd08f7f987cdd3c /Tests/RunCMake/ABI/C.cmake | |
parent | 412ce907a2099b8e65052edcc1f6dbc031b57cdd (diff) | |
download | CMake-fcc89bda1d726e59e2f021f8d094ab6159b48e57.zip CMake-fcc89bda1d726e59e2f021f8d094ab6159b48e57.tar.gz CMake-fcc89bda1d726e59e2f021f8d094ab6159b48e57.tar.bz2 |
TestBigEndian: Re-implement using byte order detected from ABI check
Document the module as deprecated in favor of the ABI check results.
Diffstat (limited to 'Tests/RunCMake/ABI/C.cmake')
-rw-r--r-- | Tests/RunCMake/ABI/C.cmake | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Tests/RunCMake/ABI/C.cmake b/Tests/RunCMake/ABI/C.cmake index a90c766..92f5da4 100644 --- a/Tests/RunCMake/ABI/C.cmake +++ b/Tests/RunCMake/ABI/C.cmake @@ -5,3 +5,18 @@ if(NOT CMAKE_C_BYTE_ORDER MATCHES "^(BIG_ENDIAN|LITTLE_ENDIAN)$") endif() message(FATAL_ERROR "CMAKE_C_BYTE_ORDER has unexpected value '${CMAKE_C_BYTE_ORDER}'") endif() + +include(TestBigEndian) +test_big_endian(IS_BIG_ENDIAN) +if(IS_BIG_ENDIAN AND NOT CMAKE_C_BYTE_ORDER STREQUAL "BIG_ENDIAN") + message(FATAL_ERROR "test_big_endian result does not match ABI result") +endif() + +# Test legacy check. +set(byte_order "${CMAKE_C_BYTE_ORDER}") +unset(CMAKE_C_BYTE_ORDER) +include(TestBigEndian) +test_big_endian(IS_BIG) +if(IS_BIG AND NOT byte_order STREQUAL "BIG_ENDIAN") + message(FATAL_ERROR "test_big_endian result does not match ABI result") +endif() |