[cmake] Added COMPILER_IS_GCC_OR_CLANG variable to simplify conditions.
authorannulen@yandex.ru <annulen@yandex.ru@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Sep 2016 12:31:58 +0000 (12:31 +0000)
committerannulen@yandex.ru <annulen@yandex.ru@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Sep 2016 12:31:58 +0000 (12:31 +0000)
https://bugs.webkit.org/show_bug.cgi?id=162605

Reviewed by Michael Catanzaro.

* CMakeLists.txt:
* Source/cmake/OptionsCommon.cmake:
* Source/cmake/WebKitHelpers.cmake:

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

CMakeLists.txt
ChangeLog
Source/cmake/OptionsCommon.cmake
Source/cmake/WebKitHelpers.cmake

index 385bd5f..6e739b3 100644 (file)
@@ -39,6 +39,13 @@ endif ()
 string(TOLOWER ${PORT} WEBKIT_PORT_DIR)
 
 # -----------------------------------------------------------------------------
+# Determine the compiler
+# -----------------------------------------------------------------------------
+if (CMAKE_COMPILER_IS_GNUCXX OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
+    set(COMPILER_IS_GCC_OR_CLANG ON)
+endif ()
+
+# -----------------------------------------------------------------------------
 # Determine the target processor
 # -----------------------------------------------------------------------------
 # Use MSVC_CXX_ARCHITECTURE_ID instead of CMAKE_SYSTEM_PROCESSOR when defined,
index 2eee1c1..219e89f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2016-09-27  Konstantin Tokarev  <annulen@yandex.ru>
+
+        [cmake] Added COMPILER_IS_GCC_OR_CLANG variable to simplify conditions.
+        https://bugs.webkit.org/show_bug.cgi?id=162605
+
+        Reviewed by Michael Catanzaro.
+
+        * CMakeLists.txt:
+        * Source/cmake/OptionsCommon.cmake:
+        * Source/cmake/WebKitHelpers.cmake:
+
 2016-09-26  Daniel Bates  <dabates@apple.com>
 
         Rename IOS_TEXT_AUTOSIZING to TEXT_AUTOSIZING
index da70ab5..04bae62 100644 (file)
@@ -29,7 +29,7 @@ endif ()
 set_property(GLOBAL PROPERTY USE_FOLDERS ON)
 define_property(TARGET PROPERTY FOLDER INHERITED BRIEF_DOCS "folder" FULL_DOCS "IDE folder name")
 
-if (CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+if (COMPILER_IS_GCC_OR_CLANG)
     set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -fno-exceptions -fno-strict-aliasing")
     set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fno-exceptions -fno-strict-aliasing -fno-rtti")
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y")
index 0db7826..ef53565 100644 (file)
@@ -4,7 +4,7 @@ include(CMakeParseArguments)
 macro(WEBKIT_SET_EXTRA_COMPILER_FLAGS _target)
     set(options ENABLE_WERROR IGNORECXX_WARNINGS)
     CMAKE_PARSE_ARGUMENTS("OPTION" "${options}" "" "" ${ARGN})
-    if (CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+    if (COMPILER_IS_GCC_OR_CLANG)
         get_target_property(OLD_COMPILE_FLAGS ${_target} COMPILE_FLAGS)
         if (${OLD_COMPILE_FLAGS} STREQUAL "OLD_COMPILE_FLAGS-NOTFOUND")
             set(OLD_COMPILE_FLAGS "")