Commit 81eb18a4 authored by Davis King's avatar Davis King

Added intel architecture detection so SSE/AVX isn't enabled when it shouldn't be.

parent 3124ec4b
......@@ -23,10 +23,13 @@ if (CMAKE_COMPILER_IS_GNUCXX)
add_global_compiler_switch(-Wreturn-type)
endif()
set(gcc_like_compilers GNU Clang Intel)
set(intel_archs x86_64 i386)
# Setup some options to allow a user to enable SSE and AVX instruction use.
if (CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang"
OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU"
OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
if ((";${gcc_like_compilers};" MATCHES ";${CMAKE_CXX_COMPILER_ID};") AND
(";${intel_archs};" MATCHES ";${CMAKE_SYSTEM_PROCESSOR};"))
option(USE_SSE2_INSTRUCTIONS "Compile your program with SSE2 instructions" OFF)
option(USE_SSE4_INSTRUCTIONS "Compile your program with SSE4 instructions" OFF)
option(USE_AVX_INSTRUCTIONS "Compile your program with AVX instructions" OFF)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment