release 0.1.7
[liba.git] / cmake / CMakeByteOrder.cmake
blob21489fbbad961616de205fbaed7609a38c9a41a0
1 if(CMAKE_VERSION VERSION_GREATER 3.20 AND CMAKE_C_BYTE_ORDER EQUAL LITTLE_ENDIAN)
2   set(CMAKE_BYTE_ORDER 1234)
3 elseif(CMAKE_VERSION VERSION_GREATER 3.20 AND CMAKE_C_BYTE_ORDER EQUAL BIG_ENDIAN)
4   set(CMAKE_BYTE_ORDER 4321)
5 else()
6   include(TestBigEndian)
7   test_big_endian(TEST_BIG_ENDIAN)
8   if(TEST_BIG_ENDIAN)
9     set(CMAKE_BYTE_ORDER 4321)
10   else()
11     set(CMAKE_BYTE_ORDER 1234)
12   endif()
13 endif()