mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-08-05 10:14:04 +00:00
[all] cmake: use -march=x86-64-v2 when it becomes available
Moves the logic in 0525515
to a common cmake include, and applies it to
the other binaries.
This commit is contained in:
17
cmake/OptimizeForNative.cmake
Normal file
17
cmake/OptimizeForNative.cmake
Normal file
@@ -0,0 +1,17 @@
|
||||
option(OPTIMIZE_FOR_NATIVE "Build with -march=native" OFF)
|
||||
if(OPTIMIZE_FOR_NATIVE)
|
||||
CHECK_C_COMPILER_FLAG("-march=native" COMPILER_SUPPORTS_MARCH_NATIVE)
|
||||
if(COMPILER_SUPPORTS_MARCH_NATIVE)
|
||||
add_compile_options("-march=native")
|
||||
endif()
|
||||
else()
|
||||
CHECK_C_COMPILER_FLAG("-march=x86-64-v2" COMPILER_SUPPORTS_MARCH_X86_64_V2)
|
||||
if(COMPILER_SUPPORTS_MARCH_X86_64_V2)
|
||||
add_compile_options("-march=x86-64-v2")
|
||||
else()
|
||||
CHECK_C_COMPILER_FLAG("-march=nehalem" COMPILER_SUPPORTS_MARCH_NEHALEM)
|
||||
if(COMPILER_SUPPORTS_MARCH_NEHALEM)
|
||||
add_compile_options("-march=nehalem")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
Reference in New Issue
Block a user