From b9959f5922a4b969beab8f0b99aa0b34bc9ee55c Mon Sep 17 00:00:00 2001 From: Dmitriy Musatkin <63878209+DmitriyMusatkin@users.noreply.github.com> Date: Fri, 6 Sep 2024 12:07:00 -0700 Subject: [PATCH] Only set mtune neoverse if compiler supports it (#1150) --- cmake/AwsSIMD.cmake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmake/AwsSIMD.cmake b/cmake/AwsSIMD.cmake index 65fce96c7..753e53397 100644 --- a/cmake/AwsSIMD.cmake +++ b/cmake/AwsSIMD.cmake @@ -18,7 +18,13 @@ else() set(AWS_AVX512vL_FLAG "-mavx512vl") set(AWS_CLMUL_FLAG "-mpclmul") set(AWS_SSE4_2_FLAG "-msse4.2") - set(AWS_ARMv8_1_FLAG "-march=armv8-a+crc+crypto -mtune=neoverse-v1") + + check_c_compiler_flag("-mtune=neoverse-v1" HAVE_MTUNE_NEOVERSE_V1) + if (HAVE_MTUNE_NEOVERSE_V1) + set(AWS_ARMv8_1_FLAG "-march=armv8-a+crc+crypto -mtune=neoverse-v1") + else() + set(AWS_ARMv8_1_FLAG "-march=armv8-a+crc+crypto") + endif() set(WERROR_FLAG "-Werror") endif()