From: Konstantinos Margaritis Date: Thu, 5 Nov 2020 15:31:20 +0000 (+0200) Subject: fix 32-bit/64-bit detection X-Git-Tag: v5.3.1^2^2~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=18296eee4715f8c03ddb3935441c0ea11d08b450;p=thirdparty%2Fvectorscan.git fix 32-bit/64-bit detection --- diff --git a/cmake/platform.cmake b/cmake/platform.cmake index 4591bf93..479b3680 100644 --- a/cmake/platform.cmake +++ b/cmake/platform.cmake @@ -5,10 +5,10 @@ CHECK_C_SOURCE_COMPILES("#if !(defined(__x86_64__) || defined(_M_X64))\n#error n CHECK_C_SOURCE_COMPILES("#if !(defined(__i386__) || defined(_M_IX86))\n#error not 32bit\n#endif\nint main(void) { return 0; }" ARCH_IA32) -CHECK_C_SOURCE_COMPILES("#if !defined(__aarch64__)\n#error not 64bit\n#endif\nint main(void) { return 0; }" ARCH_AARCH64) -CHECK_C_SOURCE_COMPILES("#if !(defined(__arm__) && !defined(__aarch64__))\n#error not 32bit\n#endif\nint main(void) { return 0; }" ARCH_ARM32) +CHECK_C_SOURCE_COMPILES("#if !defined(__ARM_ARCH_ISA_A64)\n#error not 64bit\n#endif\nint main(void) { return 0; }" ARCH_AARCH64) +CHECK_C_SOURCE_COMPILES("#if !defined(__ARM_ARCH_ISA_ARM)\n#error not 32bit\n#endif\nint main(void) { return 0; }" ARCH_ARM32) -if (DEFINED(ARCH_X86_64) OR DEFINED(ARCH_AARCH64)) +if (ARCH_X86_64 OR ARCH_AARCH64) set(ARCH_64_BIT TRUE) else() set(ARCH_32_BIT TRUE)