Add default VESPA_CPU_ARCH_FLAGS setting when using clang on Fedora.
@@ -95,6 +95,7 @@ function(vespa_use_default_build_settings)
unset(DEFAULT_EXTRA_LINK_DIRECTORY)
unset(DEFAULT_EXTRA_INCLUDE_DIRECTORY)
unset(DEFAULT_VESPA_USER)
+ unset(DEFAULT_VESPA_CPU_ARCH_FLAGS)
if(NOT DEFINED VESPA_UNPRIVILEGED)
message("-- Setting VESPA_UNPRIVILEGED to yes")
set(VESPA_UNPRIVILEGED "yes" PARENT_SCOPE)
@@ -166,6 +167,11 @@ function(vespa_use_default_build_settings)
if(NOT DEFINED DEFAULT_EXTRA_INCLUDE_DIRECTORY)
set(DEFAULT_EXTRA_INCLUDE_DIRECTORY "${VESPA_DEPS}/include")
endif()
+ if(NOT DEFINED DEFAULT_VESPA_CPU_ARCH_FLAGS)
+ if(VESPA_OS_DISTRO STREQUAL "fedora" AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+ set(DEFAULT_VESPA_CPU_ARCH_FLAGS "-march=westmere")
+ endif()
+ endif()
if(DEFINED DEFAULT_CMAKE_INSTALL_PREFIX)
message("-- DEFAULT_CMAKE_INSTALL_PREFIX is ${DEFAULT_CMAKE_INSTALL_PREFIX}")
endif()
@@ -184,6 +190,9 @@ function(vespa_use_default_build_settings)
if(DEFINED DEFAULT_VESPA_USER)
message("-- DEFAULT_VESPA_USER is ${DEFAULT_VESPA_USER}")
endif()
+ if(DEFINED DEFAULT_VESPA_CPU_ARCH_FLAGS)
+ message("-- DEFAULT_VESPA_CPU_ARCH_FLAGS is ${DEFAULT_VESPA_CPU_ARCH_FLAGS}")
+ endif()
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND DEFINED DEFAULT_CMAKE_INSTALL_PREFIX)
message("-- Setting CMAKE_INSTALL_PREFIX to ${DEFAULT_CMAKE_INSTALL_PREFIX}")
set(CMAKE_INSTALL_PREFIX "${DEFAULT_CMAKE_INSTALL_PREFIX}" CACHE PATH "Install prefix for vespa project" FORCE)
@@ -232,6 +241,10 @@ function(vespa_use_default_build_settings)
message("-- Setting VESPA_USER to ${DEFAULT_VESPA_USER}")
set(VESPA_USER "${DEFAULT_VESPA_USER}" PARENT_SCOPE)
endif()
+ if(NOT DEFINED VESPA_CPU_ARCH_FLAGS AND DEFINED DEFAULT_VESPA_CPU_ARCH_FLAGS)
+ message("-- Setting VESPA_CPU_ARCH_FLAGS to ${DEFAULT_VESPA_CPU_ARCH_FLAGS}")
+ set(VESPA_CPU_ARCH_FLAGS "${DEFAULT_VESPA_CPU_ARCH_FLAGS}" PARENT_SCOPE)
+ endif()
endfunction()
function(vespa_use_default_cxx_compiler)
