The recently introduced detection of big-endian AArch64 uses the
CMAKE_C_BYTE_ORDER variable, which was introduced in 3.20, but ccache
currently only requires CMake 3.18.
To avoid using an undefined variable, simply assume AArch64 to be
little-endian on CMake versions that don't define the aforementioned
variable. This is okay because big-endian AArch64 has few users and the
subset of them that use CMake 3.18/3.19 is likely negligible.
Reported-by: @awawa-dev
Fixes: https://github.com/ccache/ccache/issues/1651
_add_blake3_source_if_enabled(avx512 "/arch:AVX512" "-mavx512f -mavx512vl" "_mm256_abs_epi64(_mm256_set1_epi32(42))")
# Neon is always available on AArch64, but blake3_neon.c only supports little-endian
_add_blake3_source_if_enabled(avx512 "/arch:AVX512" "-mavx512f -mavx512vl" "_mm256_abs_epi64(_mm256_set1_epi32(42))")
# Neon is always available on AArch64, but blake3_neon.c only supports little-endian
-if(CMAKE_SIZEOF_VOID_P EQUAL 8 AND CMAKE_C_BYTE_ORDER STREQUAL "LITTLE_ENDIAN")
+# Byte order detection requires CMake 3.20, we just assume little-endian on 3.18/3.19.
+if(CMAKE_SIZEOF_VOID_P EQUAL 8 AND
+ (NOT DEFINED CMAKE_C_BYTE_ORDER OR CMAKE_C_BYTE_ORDER STREQUAL "LITTLE_ENDIAN"))
# https://developer.arm.com/architectures/instruction-sets/simd-isas/neon/intrinsics
check_c_source_compiles(
[=[
# https://developer.arm.com/architectures/instruction-sets/simd-isas/neon/intrinsics
check_c_source_compiles(
[=[