]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Detect __builtin_cpu_supports
authorVsevolod Stakhov <vsevolod@rspamd.com>
Mon, 16 Sep 2024 13:22:42 +0000 (14:22 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Mon, 16 Sep 2024 13:22:42 +0000 (14:22 +0100)
CMakeLists.txt
config.h.in

index a9bb50642092e15c0a08237edf9821e01d042b5b..44ebd8c3adf325fb2f485e77683bd5122d23ba3c 100644 (file)
@@ -472,6 +472,13 @@ int main(int argc, char **argv) {
 }
 " HAVE_ATOMIC_BUILTINS)
 
+CHECK_C_SOURCE_RUNS("#include <stdio.h>
+int main() {
+  __builtin_cpu_init();
+  printf(\"%d\", __builtin_cpu_supports(\"avx\"));
+  return 0;
+}" HAVE_BUILTIN_CPU_SUPPORTS)
+
 IF (NOT HAVE_ATOMIC_BUILTINS)
     MESSAGE(STATUS "atomic builtins are -NOT- supported")
 ELSE ()
index 59c70c67c3737f1765afd24d5cf574417dd4dcda..9aff9078309d51851b3ad447a3ec799e98f62e8c 100644 (file)
 #cmakedefine WITH_LUA_REPL       1
 #cmakedefine WITH_FASTTEXT       1
 #cmakedefine BACKWARD_ENABLE     1
+#cmakedefine HAVE_BUILTIN_CPU_SUPPORTS 1
 
 #cmakedefine DISABLE_PTHREAD_MUTEX 1