Skip to content

Commit

Permalink
Do not use GCC_MINOR in CMakeLists.txt
Browse files Browse the repository at this point in the history
"gcc -dumpversion" with GCC >= 7 only prints "7", thus GCC_MINOR is not defined.
That results in:

CMake Error at CMakeLists.txt:86 (list):
list index: 1 out of range (-1, 0)
  • Loading branch information
Vogtinator committed Jul 3, 2017
1 parent bac4bef commit 04052ce
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,8 @@ IF( MINGW OR UNIX )
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
string(REGEX MATCHALL "[0-9]+" GCC_VERSION_COMPONENTS ${GCC_VERSION})
list(GET GCC_VERSION_COMPONENTS 0 GCC_MAJOR)
list(GET GCC_VERSION_COMPONENTS 1 GCC_MINOR)

message(STATUS Compiler: ${COMPILER} " Major:" ${GCC_MAJOR} " Minor:" ${GCC_MINOR})
message(STATUS Compiler: ${COMPILER} " Major:" ${GCC_MAJOR})

IF ( CYGWIN OR ( ${GCC_MAJOR} GREATER 5 ))
ADD_DEFINITIONS( -std=gnu++98 ) # to support snprintf
Expand Down

0 comments on commit 04052ce

Please sign in to comment.