20 lines
698 B
Diff
20 lines
698 B
Diff
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|
index ef09142..3eb6d73 100644
|
|
--- a/CMakeLists.txt
|
|
+++ b/CMakeLists.txt
|
|
@@ -194,8 +194,12 @@ else()
|
|
string(REGEX REPLACE ".*march=[ \t]*([^ \n]*)[ \n].*" "\\1"
|
|
GNUCC_ARCH "${_GCC_OUTPUT}")
|
|
|
|
- # test the parsed flag
|
|
- set (EXEC_ARGS ${CC_ARG1} -E - -mtune=${GNUCC_ARCH})
|
|
+ # test the parsed flag
|
|
+ if (!GNUCC_ARCH EQUAL NULL)
|
|
+ set (EXEC_ARGS ${CC_ARG1} -E - -mtune=${GNUCC_ARCH})
|
|
+ else ()
|
|
+ set (EXEC_ARGS ${CC_ARG1} -E - -mtune=native)
|
|
+ endif()
|
|
execute_process(COMMAND ${CMAKE_C_COMPILER} ${EXEC_ARGS}
|
|
OUTPUT_QUIET ERROR_QUIET
|
|
INPUT_FILE /dev/null
|