From 8a880cadc3cc8fc9294a8d57a76417274380a448 Mon Sep 17 00:00:00 2001 From: "Juergen E. Fischer" Date: Sun, 3 Feb 2013 21:20:26 +0100 Subject: [PATCH] use CMAKE_*_FLAGS also on unix --- CMakeLists.txt | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 96e04401a08..8cc09c20138 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -304,24 +304,17 @@ IF (PEDANTIC) ADD_DEFINITIONS( /wd4610 ) # user defined constructor required (sqlite3_index_info) ADD_DEFINITIONS( /wd4706 ) # assignment within conditional expression (pal) ELSE (MSVC) - IF (APPLE) - # add warnings via flags instead of definitions on Mac (otherwise -Wall can not be overridden per language) - SET(_warnings "-Wall -Wextra -Wno-long-long -Wformat-security -Wno-strict-aliasing") - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_warnings}") - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_warnings}") - ELSE (APPLE) - ADD_DEFINITIONS( -Wall -Wextra -Wno-long-long -Wformat-security -Wno-strict-aliasing ) - ENDIF (APPLE) + # add warnings via flags (not as definitions as on Mac -Wall can not be overridden per language ) + SET(_warnings "-Wall -Wextra -Wno-long-long -Wformat-security -Wno-strict-aliasing") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_warnings}") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_warnings}") + # Qt produces lots of warnings with strict aliasing (as of Qt 4.4.0 & GCC 4.3) # There are redundant declarations in Qt and GDAL # ADD_DEFINITIONS( -fstrict-aliasing -Wstrict-aliasing=1 -Wredundant-decls ) IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - IF (APPLE) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-return-type-c-linkage") - ELSE (APPLE) - ADD_DEFINITIONS(-Wno-return-type-c-linkage) # used in plugins and providers - ENDIF (APPLE) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-return-type-c-linkage") ENDIF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") ENDIF (MSVC)