build: support arch-specific compiling for Neoverse N1
[vpp.git] / src / cmake / cpu.cmake
index 916fe0d..0ce8bea 100644 (file)
@@ -107,6 +107,10 @@ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64.*|AARCH64.*)")
   if(compiler_flag_march_cortexa72)
     list(APPEND MARCH_VARIANTS "cortexa72\;-march=armv8-a+crc+crypto -mtune=cortex-a72 -DCLIB_N_PREFETCHES=6")
   endif()
+  check_c_compiler_flag("-march=armv8.2-a+crc+crypto -mtune=neoverse-n1" compiler_flag_march_neoversen1)
+  if(compiler_flag_march_neoversen1)
+    list(APPEND MARCH_VARIANTS "neoversen1\;-march=armv8.2-a+crc+crypto -mtune=neoverse-n1 -DCLIB_N_PREFETCHES=6")
+  endif()
 endif()
 
 macro(vpp_library_set_multiarch_sources lib)