don't fail if mtune does not return a valid configuration

This commit is contained in:
Konstantinos Margaritis 2021-12-02 23:09:34 +02:00
parent 451d539f1d
commit 6b364021d1

View File

@ -181,12 +181,12 @@ if (CMAKE_COMPILER_IS_GNUCC AND NOT CROSS_COMPILE)
INPUT_FILE /dev/null
RESULT_VARIABLE GNUCC_TUNE_TEST)
if (NOT GNUCC_TUNE_TEST EQUAL 0)
message(SEND_ERROR "Something went wrong determining gcc tune: -mtune=${GNUCC_ARCH} not valid")
message(WARNING "Something went wrong determining gcc tune: -mtune=${GNUCC_ARCH} not valid, falling back to -mtune=native")
set(TUNE_FLAG native)
else()
set(TUNE_FLAG ${GNUCC_ARCH})
message(STATUS "gcc will tune for ${GNUCC_ARCH}")
endif()
message(STATUS "gcc will tune for ${GNUCC_ARCH}")
elseif (CMAKE_COMPILER_IS_CLANG AND NOT CROSS_COMPILE)
message(STATUS "clang will tune for ${TUNE_FLAG}")
if (ARCH_IA32 OR ARCH_X86_64)