Add -march=skylake-avx512 when required

fixes #1797
This commit is contained in:
Martin Kroeker 2018-10-08 19:18:12 +02:00 committed by GitHub
parent b74aef2816
commit eba394c711
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -71,6 +71,8 @@ if (X86_64 OR X86)
execute_process(COMMAND ${CMAKE_C_COMPILER} -march=skylake-avx512 -v -o ${PROJECT_BINARY_DIR}/avx512.o -x c ${PROJECT_BINARY_DIR}/avx512.tmp OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE NO_AVX512)
if (NO_AVX512 EQUAL 1)
set (CCOMMON_OPT "${CCOMMON_OPT} -DNO_AVX512")
else()
set (CCOMMON_OPT "${CCOMMON_OPT} -march=skylake-avx512")
endif()
file(REMOVE "avx512.tmp" "avx512.o")
endif()