cmake: only add large function growth param when using gcc

the param is only available in gcc so we must not add it to the CFLAGS
when compiling with clang
This commit is contained in:
Andre Puschmann 2020-08-10 15:48:55 +02:00
parent fffff5e7bc
commit 6c12728cc7
1 changed files with 4 additions and 2 deletions

View File

@ -471,8 +471,10 @@ if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
endif()
# Increase inlining limit to allow gcc compilation on e.g. RPi2
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --param large-function-growth=1600")
if(CMAKE_C_COMPILER_ID MATCHES "GNU")
# Increase inlining limit to allow gcc compilation on e.g. RPi2
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --param large-function-growth=1600")
endif(CMAKE_C_COMPILER_ID MATCHES "GNU")
message(STATUS "CMAKE_C_FLAGS is ${CMAKE_C_FLAGS}")
message(STATUS "CMAKE_CXX_FLAGS is ${CMAKE_CXX_FLAGS}")