diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index fb753cf491c9721c6897d53fab979f44b89a9c05..4bf5ca728cde5cc315f1823d78a35296112a625e 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -4,6 +4,24 @@ add_library(ev tarantool_ev.c) check_c_compiler_flag ("-Wno-unused-result" gcc_has_wno_unused_result) +check_c_compiler_flag ("-msse4" gcc_has_sse4) +check_include_file("cpuid.h" gcc_has_cpuid) + +execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion + OUTPUT_VARIABLE GCC_VERSION) +if (GCC_VERSION VERSION_GREATER 4.4 OR GCC_VERSION VERSION_EQUAL 4.4) + message(STATUS "GCC Version >= 4.4") +else() + message (FATAL_ERROR "GCC version should be >= 4.4") +endif() + +if (NOT gcc_has_sse4) + message (FATAL_ERROR "GCC must support SSE4 instructions (-msse4).") +endif() + +if (NOT gcc_has_cpuid) + message (FATAL_ERROR "GCC is missing cpuid.h") +endif() if (gcc_has_wno_unused_result) set_source_files_properties(tarantool_ev.c diff --git a/core/cpu_feature.m b/core/cpu_feature.m index 559b8d6cf8232619e8b1018207deb9ba2ad27645..83816ec94455f7ffb3decf5c0eff76c60d6982d5 100644 --- a/core/cpu_feature.m +++ b/core/cpu_feature.m @@ -31,13 +31,6 @@ #error "Only x86 and x86_64 architectures supported" #endif -#ifndef __GNUC__ - #error This module uses GCC intrinsic header(s) and should be compiled using gcc. -#elif ((__GNUC__ * 10000) + (__GNUC_MINOR__ * 100)) < 40400 - #error This module should be compiled with GCC 4.4 and higher -#endif - - /* GCC intrinsic headers */ #include <cpuid.h> #include <smmintrin.h>