mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-13 04:27:55 +00:00
[host] cmake: use -march=x86-64-v2 when it becomes available
GCC 11 will support x86_64 micro-architecture feature levels. What we really want to support is nehalem or newer, which is x86-64-v2, and specifying this instead of nehalem means that we are not tuning for nehalem specifically.
This commit is contained in:
parent
f5ad14b109
commit
0525515bee
1 changed files with 8 additions and 3 deletions
|
@ -17,9 +17,14 @@ if(OPTIMIZE_FOR_NATIVE)
|
|||
add_compile_options("-march=native")
|
||||
endif()
|
||||
else()
|
||||
CHECK_C_COMPILER_FLAG("-march=nehalem" COMPILER_SUPPORTS_MARCH_NEHALEM)
|
||||
if(COMPILER_SUPPORTS_MARCH_NEHALEM)
|
||||
add_compile_options("-march=nehalem")
|
||||
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()
|
||||
|
||||
|
|
Loading…
Reference in a new issue