Check if the compiler supports "-march=native"

This commit is contained in:
scribam 2018-03-18 08:59:46 +01:00 committed by kd-11
parent 526228442b
commit af89b62194

View file

@ -90,6 +90,13 @@ else()
add_definitions(-DGLX_GLXEXT_PROTOTYPES)
endif()
if(USE_NATIVE_INSTRUCTIONS)
CHECK_CXX_COMPILER_FLAG("-march=native" COMPILER_SUPPORTS_MARCH_NATIVE)
if(COMPILER_SUPPORTS_MARCH_NATIVE)
add_compile_options(-march=native)
endif()
endif()
if(NOT MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions")
# This hides our LLVM from mesa's LLVM, otherwise we get some unresolvable conflicts.
@ -108,10 +115,6 @@ if(NOT MSVC)
add_compile_options(-msse -msse2 -mcx16 -mrtm)
if(USE_NATIVE_INSTRUCTIONS)
add_compile_options(-march=native)
endif()
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
# This fixes 'some' of the st11range issues. See issue #2516
if(APPLE)