Skip to content
Snippets Groups Projects
Commit 4ccc2f48 authored by Pavel Cherenkov's avatar Pavel Cherenkov
Browse files

bug977231: gcc version check (>=4.4) moved to cmake, cpuid.h -msse4 also checked

parent 32cdc4bd
No related merge requests found
......@@ -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
......
......@@ -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>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment