Title: [246873] trunk
Revision
246873
Author
[email protected]
Date
2019-06-27 00:11:26 -0700 (Thu, 27 Jun 2019)

Log Message

[cmake] Switch to built-in handling of C++ standard instead of hardcoding -std=c++17
https://bugs.webkit.org/show_bug.cgi?id=199108

Reviewed by Don Olmstead.

Rationale:

1. It provides an abstraction over exact flags of particular compilers -
   we just specify required version of C++ standard
2. External libraries (like Qt used in WPEQt) may require particular C++
   standard or even particular C++ features to be availabe (e.g. Qt
   requires INTERFACE_COMPILE_FEATURES cxx_decltype, which causes cmake
   to add -std=gnu++11 unless proper CXX_STANDARD is defined)

.:

* Source/cmake/OptionsCommon.cmake:
* Source/cmake/OptionsMSVC.cmake:
* Source/cmake/WebKitCompilerFlags.cmake:

Source/WebKit:

* PlatformWPE.cmake: Use project-level default for CXX_STANDARD
property.

Modified Paths

Diff

Modified: trunk/ChangeLog (246872 => 246873)


--- trunk/ChangeLog	2019-06-27 06:33:50 UTC (rev 246872)
+++ trunk/ChangeLog	2019-06-27 07:11:26 UTC (rev 246873)
@@ -1,3 +1,23 @@
+2019-06-21  Konstantin Tokarev  <[email protected]>
+
+        [cmake] Switch to built-in handling of C++ standard instead of hardcoding -std=c++17
+        https://bugs.webkit.org/show_bug.cgi?id=199108
+
+        Reviewed by Don Olmstead.
+
+        Rationale:
+
+        1. It provides an abstraction over exact flags of particular compilers -
+           we just specify required version of C++ standard
+        2. External libraries (like Qt used in WPEQt) may require particular C++
+           standard or even particular C++ features to be availabe (e.g. Qt
+           requires INTERFACE_COMPILE_FEATURES cxx_decltype, which causes cmake
+           to add -std=gnu++11 unless proper CXX_STANDARD is defined)
+
+        * Source/cmake/OptionsCommon.cmake:
+        * Source/cmake/OptionsMSVC.cmake:
+        * Source/cmake/WebKitCompilerFlags.cmake:
+
 2019-06-25  Michael Catanzaro  <[email protected]>
 
         Fully rename WebKitGTK+ -> WebKitGTK everywhere

Modified: trunk/Source/WebKit/ChangeLog (246872 => 246873)


--- trunk/Source/WebKit/ChangeLog	2019-06-27 06:33:50 UTC (rev 246872)
+++ trunk/Source/WebKit/ChangeLog	2019-06-27 07:11:26 UTC (rev 246873)
@@ -1,3 +1,22 @@
+2019-06-21  Konstantin Tokarev  <[email protected]>
+
+        [cmake] Switch to built-in handling of C++ standard instead of hardcoding -std=c++17
+        https://bugs.webkit.org/show_bug.cgi?id=199108
+
+        Reviewed by Don Olmstead.
+
+        Rationale:
+
+        1. It provides an abstraction over exact flags of particular compilers -
+           we just specify required version of C++ standard
+        2. External libraries (like Qt used in WPEQt) may require particular C++
+           standard or even particular C++ features to be availabe (e.g. Qt
+           requires INTERFACE_COMPILE_FEATURES cxx_decltype, which causes cmake
+           to add -std=gnu++11 unless proper CXX_STANDARD is defined)
+
+        * PlatformWPE.cmake: Use project-level default for CXX_STANDARD
+        property.
+
 2019-06-26  Jiewen Tan  <[email protected]>
 
         SubFrameSOAuthorizationSession should preserve the referrer header when fall back to web path

Modified: trunk/Source/WebKit/PlatformWPE.cmake (246872 => 246873)


--- trunk/Source/WebKit/PlatformWPE.cmake	2019-06-27 06:33:50 UTC (rev 246872)
+++ trunk/Source/WebKit/PlatformWPE.cmake	2019-06-27 07:11:26 UTC (rev 246873)
@@ -397,7 +397,6 @@
     set_target_properties(qtwpe PROPERTIES
         OUTPUT_NAME qtwpe
         AUTOMOC ON
-        CXX_STANDARD 17
     )
     target_compile_definitions(qtwpe PUBLIC QT_NO_KEYWORDS=1)
     target_link_libraries(qtwpe ${qtwpe_LIBRARIES})

Modified: trunk/Source/cmake/OptionsCommon.cmake (246872 => 246873)


--- trunk/Source/cmake/OptionsCommon.cmake	2019-06-27 06:33:50 UTC (rev 246872)
+++ trunk/Source/cmake/OptionsCommon.cmake	2019-06-27 07:11:26 UTC (rev 246873)
@@ -1,3 +1,7 @@
+set(CMAKE_CXX_STANDARD 17)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+set(CMAKE_CXX_EXTENSIONS OFF)
+
 add_definitions(-DBUILDING_WITH_CMAKE=1)
 add_definitions(-DHAVE_CONFIG_H=1)
 

Modified: trunk/Source/cmake/OptionsMSVC.cmake (246872 => 246873)


--- trunk/Source/cmake/OptionsMSVC.cmake	2019-06-27 06:33:50 UTC (rev 246872)
+++ trunk/Source/cmake/OptionsMSVC.cmake	2019-06-27 07:11:26 UTC (rev 246873)
@@ -26,10 +26,6 @@
     add_definitions(-D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1)
 endif ()
 
-# Enable C++17
-# https://docs.microsoft.com/en-us/cpp/build/reference/std-specify-language-standard-version
-add_compile_options(/std:c++17)
-
 # Specify the source code encoding
 add_compile_options(/utf-8 /validate-charset)
 

Modified: trunk/Source/cmake/WebKitCompilerFlags.cmake (246872 => 246873)


--- trunk/Source/cmake/WebKitCompilerFlags.cmake	2019-06-27 06:33:50 UTC (rev 246872)
+++ trunk/Source/cmake/WebKitCompilerFlags.cmake	2019-06-27 07:11:26 UTC (rev 246873)
@@ -104,13 +104,6 @@
         WEBKIT_APPEND_GLOBAL_COMPILER_FLAGS(-fno-exceptions)
         WEBKIT_APPEND_GLOBAL_CXX_FLAGS(-fno-rtti)
 
-        check_cxx_compiler_flag("-std=c++17" CXX_COMPILER_SUPPORTS_CXX17)
-        if (CXX_COMPILER_SUPPORTS_CXX17)
-            WEBKIT_APPEND_GLOBAL_CXX_FLAGS(-std=c++17)
-        else ()
-            message(FATAL_ERROR "Compiler with C++17 support is required")
-        endif ()
-
         if (WIN32)
             WEBKIT_APPEND_GLOBAL_COMPILER_FLAGS(-mno-ms-bitfields)
             WEBKIT_PREPEND_GLOBAL_COMPILER_FLAGS(-Wno-unknown-pragmas)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to