mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-12-22 22:01:46 +00:00
[host] cmake: use -march=nehalem
by default
Nehalem is the minimum requirement for the host application as it makes use of SSE4.1 instructions, as such we should default to compling with it instead of `-march=native` so that when the binary is distributed it will operate on foreign systems. Fixed #416
This commit is contained in:
parent
7e15ec5e66
commit
6b5842d2ff
1 changed files with 6 additions and 1 deletions
|
@ -6,12 +6,17 @@ set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/")
|
|||
include(CheckCCompilerFlag)
|
||||
include(FeatureSummary)
|
||||
|
||||
option(OPTIMIZE_FOR_NATIVE "Build with -march=native" ON)
|
||||
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=nehalem" COMPILER_SUPPORTS_MARCH_NEHALEM)
|
||||
if(COMPILER_SUPPORTS_MARCH_NEHALEM)
|
||||
add_compile_options("-march=nehalem")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
option(ENABLE_BACKTRACE "Enable backtrace support on crash" ON)
|
||||
|
|
Loading…
Reference in a new issue