Changeset 246873 in webkit


Ignore:
Timestamp:
Jun 27, 2019 12:11:26 AM (5 years ago)
Author:
Konstantin Tokarev
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.

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r246790 r246873  
     12019-06-21  Konstantin Tokarev  <annulen@yandex.ru>
     2
     3        [cmake] Switch to built-in handling of C++ standard instead of hardcoding -std=c++17
     4        https://bugs.webkit.org/show_bug.cgi?id=199108
     5
     6        Reviewed by Don Olmstead.
     7
     8        Rationale:
     9
     10        1. It provides an abstraction over exact flags of particular compilers -
     11           we just specify required version of C++ standard
     12        2. External libraries (like Qt used in WPEQt) may require particular C++
     13           standard or even particular C++ features to be availabe (e.g. Qt
     14           requires INTERFACE_COMPILE_FEATURES cxx_decltype, which causes cmake
     15           to add -std=gnu++11 unless proper CXX_STANDARD is defined)
     16
     17        * Source/cmake/OptionsCommon.cmake:
     18        * Source/cmake/OptionsMSVC.cmake:
     19        * Source/cmake/WebKitCompilerFlags.cmake:
     20
    1212019-06-25  Michael Catanzaro  <mcatanzaro@igalia.com>
    222
  • trunk/Source/WebKit/ChangeLog

    r246872 r246873  
     12019-06-21  Konstantin Tokarev  <annulen@yandex.ru>
     2
     3        [cmake] Switch to built-in handling of C++ standard instead of hardcoding -std=c++17
     4        https://bugs.webkit.org/show_bug.cgi?id=199108
     5
     6        Reviewed by Don Olmstead.
     7
     8        Rationale:
     9
     10        1. It provides an abstraction over exact flags of particular compilers -
     11           we just specify required version of C++ standard
     12        2. External libraries (like Qt used in WPEQt) may require particular C++
     13           standard or even particular C++ features to be availabe (e.g. Qt
     14           requires INTERFACE_COMPILE_FEATURES cxx_decltype, which causes cmake
     15           to add -std=gnu++11 unless proper CXX_STANDARD is defined)
     16
     17        * PlatformWPE.cmake: Use project-level default for CXX_STANDARD
     18        property.
     19
    1202019-06-26  Jiewen Tan  <jiewen_tan@apple.com>
    221
  • trunk/Source/WebKit/PlatformWPE.cmake

    r246671 r246873  
    398398        OUTPUT_NAME qtwpe
    399399        AUTOMOC ON
    400         CXX_STANDARD 17
    401400    )
    402401    target_compile_definitions(qtwpe PUBLIC QT_NO_KEYWORDS=1)
  • trunk/Source/cmake/OptionsCommon.cmake

    r244960 r246873  
     1set(CMAKE_CXX_STANDARD 17)
     2set(CMAKE_CXX_STANDARD_REQUIRED ON)
     3set(CMAKE_CXX_EXTENSIONS OFF)
     4
    15add_definitions(-DBUILDING_WITH_CMAKE=1)
    26add_definitions(-DHAVE_CONFIG_H=1)
  • trunk/Source/cmake/OptionsMSVC.cmake

    r244653 r246873  
    2626    add_definitions(-D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1)
    2727endif ()
    28 
    29 # Enable C++17
    30 # https://docs.microsoft.com/en-us/cpp/build/reference/std-specify-language-standard-version
    31 add_compile_options(/std:c++17)
    3228
    3329# Specify the source code encoding
  • trunk/Source/cmake/WebKitCompilerFlags.cmake

    r245127 r246873  
    104104        WEBKIT_APPEND_GLOBAL_COMPILER_FLAGS(-fno-exceptions)
    105105        WEBKIT_APPEND_GLOBAL_CXX_FLAGS(-fno-rtti)
    106 
    107         check_cxx_compiler_flag("-std=c++17" CXX_COMPILER_SUPPORTS_CXX17)
    108         if (CXX_COMPILER_SUPPORTS_CXX17)
    109             WEBKIT_APPEND_GLOBAL_CXX_FLAGS(-std=c++17)
    110         else ()
    111             message(FATAL_ERROR "Compiler with C++17 support is required")
    112         endif ()
    113106
    114107        if (WIN32)
Note: See TracChangeset for help on using the changeset viewer.