diff options
author | Sebastian Leske <sebastian.leske@sleske.name> | 2017-09-20 20:09:50 +0200 |
---|---|---|
committer | Sebastian Leske <sebastian.leske@sleske.name> | 2017-09-22 16:37:07 +0200 |
commit | e94308d13f565ff3b5e711f8942e44a65cf89dab (patch) | |
tree | d11bb37c54de856ae212f0e12a331d41c56979cd /cmake | |
parent | bec2ce96c8fa9eec077dc53e18bb8e26727504fc (diff) | |
download | navit-e94308d13f565ff3b5e711f8942e44a65cf89dab.tar.gz |
Fix:build:Fix conditional compiler warning options
Convert add_compiler_flag_if_available from a CMake function to a macro
so it can change the global variables CMAKE_C(XX)_FLAG to add compiler
warning options. Without this fix, the compiler warning options that
depend on the compiler version are never used.
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/navit_macros.cmake | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cmake/navit_macros.cmake b/cmake/navit_macros.cmake index 734a5381f..eb1f3fc7c 100644 --- a/cmake/navit_macros.cmake +++ b/cmake/navit_macros.cmake @@ -92,7 +92,7 @@ endmacro(message_error) include(CheckCCompilerFlag) include(CheckCXXCompilerFlag) -function(add_compiler_flag_if_available FLAG) +macro(add_compiler_flag_if_available FLAG) set(VAR_FLAG_AVAILABLE_C "FLAG_AVAILABLE_C_${FLAG}") check_c_compiler_flag(${FLAG} ${VAR_FLAG_AVAILABLE_C}) if (${${VAR_FLAG_AVAILABLE_C}}) @@ -105,4 +105,4 @@ function(add_compiler_flag_if_available FLAG) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLAG} ") endif() endif() -endfunction(add_compiler_flag_if_available) +endmacro(add_compiler_flag_if_available) |