diff --git a/host/CMakeLists.txt b/host/CMakeLists.txt index 0b4bd11a..a5bb203c 100644 --- a/host/CMakeLists.txt +++ b/host/CMakeLists.txt @@ -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)