Skip to content

Commit

Permalink
gcc-9: fix CMake parsing of CPU architecture
Browse files Browse the repository at this point in the history
GCC-9 adds known options section for march that causes regex
replace failure in CMake file

Fixes github issue intel#136
  • Loading branch information
xiangwang1 committed Mar 26, 2019
1 parent f9c7837 commit 5c8f06e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ else()
set (EXEC_ARGS ${CC_ARG1} -c -Q --help=target -march=native -mtune=native)
execute_process(COMMAND ${CMAKE_C_COMPILER} ${EXEC_ARGS}
OUTPUT_VARIABLE _GCC_OUTPUT)
string(FIND "${_GCC_OUTPUT}" "Known" POS)
string(SUBSTRING "${_GCC_OUTPUT}" 0 ${POS} _GCC_OUTPUT)
string(REGEX REPLACE ".*march=[ \t]*([^ \n]*)[ \n].*" "\\1"
GNUCC_ARCH "${_GCC_OUTPUT}")

Expand Down

0 comments on commit 5c8f06e

Please sign in to comment.