hyperscan/Fix-hyperscan-gcc10.patch
王勇 655a10b289 fix failure caused by GCC upgrade to GCC-10
[why]
set default value when ${GNUCC_ARCH} is NULL
2021-08-04 17:44:16 +08:00

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