Commit ba2bc4911d99e20f1060bb6767edab94fd5d97a6

Patrick Steinhardt 2017-03-01T14:51:39

Merge pull request #4148 from pks-t/pks/fix-haiku-builds cmake: only enable supported compiler warning flags

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4bfd1b4..317ad34 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -464,7 +464,10 @@ IF (MSVC)
    # Precompiled headers
 
 ELSE ()
-	SET(CMAKE_C_FLAGS "-D_GNU_SOURCE -Wall -Wextra ${CMAKE_C_FLAGS}")
+	SET(CMAKE_C_FLAGS "-D_GNU_SOURCE ${CMAKE_C_FLAGS}")
+
+	ADD_C_FLAG_IF_SUPPORTED(-Wall)
+	ADD_C_FLAG_IF_SUPPORTED(-Wextra)
 
 	IF (CMAKE_SYSTEM_NAME MATCHES "(Solaris|SunOS)")
 		SET(CMAKE_C_FLAGS "-std=c99 -D_POSIX_C_SOURCE=200112L -D__EXTENSIONS__ -D_POSIX_PTHREAD_SEMANTICS ${CMAKE_C_FLAGS}")