aboutsummaryrefslogtreecommitdiffstats
path: root/functions.cmake
diff options
context:
space:
mode:
authorArnstein Ressem <aressem@yahoo-inc.com>2016-10-14 12:47:43 +0000
committerArnstein Ressem <aressem@yahoo-inc.com>2016-10-14 12:47:43 +0000
commite89edf777283a0309561acadf3d4bebe174c82a1 (patch)
treecaa70fc2d2629c085926107e9d995acecc9228fb /functions.cmake
parent4fd21e20966853f00d5a73ec83bb6927f88df2a0 (diff)
Add function to only add -mtune=skylake-avx512 for gcc >= 5.3
Diffstat (limited to 'functions.cmake')
-rw-r--r--functions.cmake9
1 files changed, 9 insertions, 0 deletions
diff --git a/functions.cmake b/functions.cmake
index 7db3d2edaf1..4e679509735 100644
--- a/functions.cmake
+++ b/functions.cmake
@@ -431,6 +431,15 @@ function(vespa_workaround_gcc_bug_67055 SOURCE_FILE)
endif()
endfunction()
+function(vespa_workaround_set_gcc_march_skylake_avx512_if_supported SOURCE_FILE)
+ if(CMAKE_COMPILER_IS_GNUCC)
+ execute_process(COMMAND ${CMAKE_CPP_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
+ if (GCC_VERSION VERSION_GREATER "5.2")
+ set_source_files_properties(${SOURCE_FILE} PROPERTIES COMPILE_FLAGS -march=skylake-avx512)
+ endif()
+ endif()
+endfunction()
+
macro(__initialize_module)
# Set a couple of useful variables for this module
set(MODULE_ROOT ${CMAKE_CURRENT_BINARY_DIR})