From: Vsevolod Stakhov Date: Mon, 16 Sep 2024 13:22:42 +0000 (+0100) Subject: [Minor] Detect __builtin_cpu_supports X-Git-Tag: 3.10.0~12^2~2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3ca5e9bdce7e7bc0a9f3e218989e8ace5c675c2f;p=rspamd.git [Minor] Detect __builtin_cpu_supports --- diff --git a/CMakeLists.txt b/CMakeLists.txt index a9bb50642..44ebd8c3a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -472,6 +472,13 @@ int main(int argc, char **argv) { } " HAVE_ATOMIC_BUILTINS) +CHECK_C_SOURCE_RUNS("#include +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 () diff --git a/config.h.in b/config.h.in index 59c70c67c..9aff90783 100644 --- a/config.h.in +++ b/config.h.in @@ -115,6 +115,7 @@ #cmakedefine WITH_LUA_REPL 1 #cmakedefine WITH_FASTTEXT 1 #cmakedefine BACKWARD_ENABLE 1 +#cmakedefine HAVE_BUILTIN_CPU_SUPPORTS 1 #cmakedefine DISABLE_PTHREAD_MUTEX 1