[CMake] Do not pass -Wno-expansion-to-defined to Clang <4.0.0
authoraperez@igalia.com <aperez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 31 May 2017 19:54:20 +0000 (19:54 +0000)
committeraperez@igalia.com <aperez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 31 May 2017 19:54:20 +0000 (19:54 +0000)
https://bugs.webkit.org/show_bug.cgi?id=172750

Reviewed by Michael Catanzaro.

* Source/cmake/OptionsCommon.cmake:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217618 268f45cc-cd09-0410-ab3c-d52691b4dbfc

ChangeLog
Source/cmake/OptionsCommon.cmake

index 224d07d..dd8e3fa 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2017-05-31  Adrian Perez de Castro  <aperez@igalia.com>
 
+        [CMake] Do not pass -Wno-expansion-to-defined to Clang <4.0.0
+        https://bugs.webkit.org/show_bug.cgi?id=172750
+
+        Reviewed by Michael Catanzaro.
+
+        * Source/cmake/OptionsCommon.cmake:
+
+2017-05-31  Adrian Perez de Castro  <aperez@igalia.com>
+
         Consider enabling -Wno-expansion-to-defined for gcc 7
         https://bugs.webkit.org/show_bug.cgi?id=167643
 
index 55e7404..50d4094 100644 (file)
@@ -31,11 +31,13 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
 define_property(TARGET PROPERTY FOLDER INHERITED BRIEF_DOCS "folder" FULL_DOCS "IDE folder name")
 
 if (COMPILER_IS_GCC_OR_CLANG)
-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-expansion-to-defined")
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-exceptions -fno-strict-aliasing")
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-expansion-to-defined")
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions -fno-strict-aliasing -fno-rtti")
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y")
+    if (NOT (COMPILER_IS_CLANG AND "${CLANG_VERSION}" VERSION_LESS 4.0.0))
+        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-expansion-to-defined")
+        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-expansion-to-defined")
+    endif ()
 endif ()
 
 if (CMAKE_GENERATOR STREQUAL "Ninja")