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
No known key found for this signature in database
GPG Key ID: E4FADFE6DFB29C6E
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})

View File

@ -36,7 +36,9 @@ if(NOT CMAKE_C_COMPILER_WORKS)
endif()
if(DEFINED EXTRA_CXXFLAGS)
if(NOT EXTRA_CXXFLAGS STREQUAL "")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CXXFLAGS}")
endif()
endif()
if(DEFINED ENV{CXXFLAGS})

View File

@ -43,7 +43,9 @@ if(NOT CMAKE_Fortran_COMPILER_WORKS)
endif()
if(DEFINED EXTRA_FCFLAGS)
if(NOT EXTRA_FCFLAGS STREQUAL "")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${EXTRA_FCFLAGS}")
endif()
endif()
if(DEFINED ENV{FCFLAGS})

View File

@ -54,7 +54,9 @@ if(ENABLE_FC_SUPPORT)
endif()
if(DEFINED EXTRA_FCFLAGS)
if(NOT EXTRA_FCFLAGS STREQUAL "")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${EXTRA_FCFLAGS}")
endif()
endif()
if(DEFINED ENV{FCFLAGS})