File tree Expand file tree Collapse file tree 3 files changed +15
-2
lines changed Expand file tree Collapse file tree 3 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -117,6 +117,10 @@ ENDIF (WITH_GLOBE)
117
117
# Compile flag. Make it possible to turn it off.
118
118
SET (PEDANTIC TRUE CACHE BOOL "Determines if we should compile in pedantic mode." )
119
119
120
+ # whether the compiler front-end is clang on Apple (Mac OS X 10.7+)
121
+ SET (APPLE_CLANG (APPLE AND "${CMAKE_CXX_COMPILER_ID} " STREQUAL "Clang" ))
122
+ SET (APPLE_CLANG_WARNINGS TRUE CACHE BOOL "Whether to show extra compiler warnings on Mac from clang front-end not shown in gcc front-end builds" )
123
+
120
124
# whether unit tests should be build
121
125
SET (ENABLE_TESTS TRUE CACHE BOOL "Build unit tests?" )
122
126
@@ -304,7 +308,12 @@ IF (PEDANTIC)
304
308
ADD_DEFINITIONS ( /wd4610 ) # user defined constructor required (sqlite3_index_info)
305
309
ADD_DEFINITIONS ( /wd4706 ) # assignment within conditional expression (pal)
306
310
ELSE (MSVC )
307
- ADD_DEFINITIONS ( -Wall -Wextra -Wno-long-long -Wformat-security -Wno-strict-aliasing )
311
+ IF (APPLE_CLANG AND NOT APPLE_CLANG_WARNINGS )
312
+ SET (CMAKE_C_FLAGS "-Wall -Wextra -Wno-long-long -Wformat-security -Wno-strict-aliasing " )
313
+ SET (CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -Wno-return-type-c-linkage -Wno-overloaded-virtual " )
314
+ ELSE (APPLE_CLANG AND NOT APPLE_CLANG_WARNINGS )
315
+ ADD_DEFINITIONS ( -Wall -Wextra -Wno-long-long -Wformat-security -Wno-strict-aliasing )
316
+ ENDIF (APPLE_CLANG AND NOT APPLE_CLANG_WARNINGS )
308
317
# Qt produces lots of warnings with strict aliasing (as of Qt 4.4.0 & GCC 4.3)
309
318
# There are redundant declarations in Qt and GDAL
310
319
# ADD_DEFINITIONS( -fstrict-aliasing -Wstrict-aliasing=1 -Wredundant-decls )
Original file line number Diff line number Diff line change @@ -11,6 +11,10 @@ ELSE (WIN32)
11
11
ADD_DEFINITIONS (-DHAVE_POSIX_OPENPT )
12
12
ENDIF (WIN32 )
13
13
14
+ IF (APPLE_CLANG AND NOT APPLE_CLANG_WARNINGS )
15
+ SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-mismatched-tags " )
16
+ ENDIF (APPLE_CLANG AND NOT APPLE_CLANG_WARNINGS )
17
+
14
18
########################################################
15
19
# Files
16
20
Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ K3ProcessController::~K3ProcessController()
123
123
close ( d->fd [0 ] );
124
124
close ( d->fd [1 ] );
125
125
#else
126
- # warning FIXME: why does close() freeze up destruction?
126
+ // FIXME: why does close() freeze up destruction?
127
127
#endif
128
128
129
129
delete d;
You can’t perform that action at this time.
0 commit comments