Add EXTRA_<LANG>FLAGS to CMAKE_<LANG>_FLAGS if the former are not an empty string

This commit is contained in:
Roberto Di Remigio
2017-04-06 14:52:58 +02:00
parent 8fd3640685
commit d081364685
4 changed files with 8 additions and 0 deletions

View File

@ -36,7 +36,9 @@ if(NOT CMAKE_C_COMPILER_WORKS)
endif()
if(DEFINED EXTRA_CFLAGS)
if(NOT EXTRA_CFLAGS STREQUAL "")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
endif()
endif()
if(DEFINED ENV{CFLAGS})