Skip to content
Permalink
Browse files
[CMake] Make WebCore headers copies
https://bugs.webkit.org/show_bug.cgi?id=182512
<rdar://problem/37510435>

Reviewed by Alex Christensen.

Source/WebCore:

The header copying is moved to a target WebCorePrivateFrameworkHeaders. This target was
originally Windows only but now this is enabled for all CMake based ports.

Enumerated all headers within WebCore that are used for WebKit(Legacy), tools and
tests. Shared headers are within Headers.cmake while port and platform specific headers
are in their respective CMake files. Listing out all headers is preferred because globbing
will break the build whenever a file is added.

All include directories within the WebCore source tree are now PRIVATE. They were
modified to use WebCore_PRIVATE_INCLUDE_DIRECTORIES. They will not propagate to other targets
which will prevent erroneous includes in targets dependent on WebCore.

* CMakeLists.txt:
* Headers.cmake: Added.
* PlatformAppleWin.cmake:
* PlatformGTK.cmake:
* PlatformMac.cmake:
* PlatformPlayStation.cmake:
* PlatformWPE.cmake:
* PlatformWin.cmake:
* PlatformWinCairo.cmake:
* platform/Cairo.cmake:
* platform/Curl.cmake:
* platform/FreeType.cmake:
* platform/GStreamer.cmake:
* platform/HolePunch.cmake:
* platform/ImageDecoders.cmake:
* platform/Soup.cmake: Added.
* platform/TextureMapper.cmake:

Source/WebKit:

WebCore now uses WebCore_PRIVATE_INCLUDE_DIRECTORIES for all ports. This revealed
problems with WebKit's usage of WebCore headers. All include directories directly
referencing the WebCore source tree we're removed from the CMake files. Any includes
of WebCore headers using "*.h" were modified to <WebCore/*.h>

Removed generation of forwarding headers for WebCore using the perl script.

* CMakeLists.txt:
* NetworkProcess/curl/NetworkDataTaskCurl.h:
* PlatformWPE.cmake:
* PlatformWin.cmake:
* Scripts/generate-forwarding-headers.pl:
* UIProcess/API/glib/WebKitUserContentFilterStore.cpp:
* UIProcess/API/wpe/WebKitColorPrivate.h:
* UIProcess/WebsiteData/win/WebsiteDataStoreWin.cpp:
* UIProcess/win/PageClientImpl.cpp:

Source/WebKitLegacy:

Added WebCorePrivateFrameworkHeaders as a dependency of WebKitLegacy for all
ports.

WebCore now uses WebCore_PRIVATE_INCLUDE_DIRECTORIES for all ports. This revealed
problems with WebKit's usage of WebCore headers. All include directories directly
referencing the WebCore source tree we're removed from the CMake files.

* CMakeLists.txt:
* PlatformWin.cmake:

Tools:

Added WebCorePrivateFrameworkHeaders as a dependency of TestWebKitAPI for all
ports.

WebCore now uses WebCore_PRIVATE_INCLUDE_DIRECTORIES for all ports. Any includes
of WebCore headers using "*.h" were modified to <WebCore/*.h>

* DumpRenderTree/TestNetscapePlugIn/CMakeLists.txt:
* DumpRenderTree/TestNetscapePlugIn/ForwardingHeaders/WebKit/npapi.h:
* DumpRenderTree/TestNetscapePlugIn/ForwardingHeaders/WebKit/npfunctions.h:
* DumpRenderTree/TestNetscapePlugIn/ForwardingHeaders/WebKit/npruntime.h:
* TestWebKitAPI/CMakeLists.txt:
* TestWebKitAPI/PlatformWin.cmake:
* TestWebKitAPI/Tests/WebCore/AbortableTaskQueue.cpp:
* TestWebKitAPI/Tests/WebCore/gstreamer/GstMappedBuffer.cpp:
* WebKitTestRunner/win/PlatformWebViewWin.cpp:


Canonical link: https://commits.webkit.org/211325@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244443 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
donny-dont committed Apr 18, 2019
1 parent 071e3f0 commit ed3954ecdc897d94022434b41bd7cea97a16f194
Showing with 2,009 additions and 457 deletions.
  1. +35 −28 Source/WebCore/CMakeLists.txt
  2. +38 −0 Source/WebCore/ChangeLog
  3. +1,462 −0 Source/WebCore/Headers.cmake
  4. +47 −32 Source/WebCore/PlatformAppleWin.cmake
  5. +24 −7 Source/WebCore/PlatformGTK.cmake
  6. +114 −165 Source/WebCore/PlatformMac.cmake
  7. +1 −1 Source/WebCore/PlatformPlayStation.cmake
  8. +7 −7 Source/WebCore/PlatformWPE.cmake
  9. +39 −174 Source/WebCore/PlatformWin.cmake
  10. +1 −7 Source/WebCore/PlatformWinCairo.cmake
  11. +13 −1 Source/WebCore/platform/Cairo.cmake
  12. +29 −1 Source/WebCore/platform/Curl.cmake
  13. +8 −1 Source/WebCore/platform/FreeType.cmake
  14. +20 −4 Source/WebCore/platform/GStreamer.cmake
  15. +1 −1 Source/WebCore/platform/HolePunch.cmake
  16. +1 −1 Source/WebCore/platform/ImageDecoders.cmake
  17. +32 −0 Source/WebCore/platform/Soup.cmake
  18. +46 −3 Source/WebCore/platform/TextureMapper.cmake
  19. +4 −0 Source/WebKit/CMakeLists.txt
  20. +25 −0 Source/WebKit/ChangeLog
  21. +1 −1 Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.h
  22. +0 −5 Source/WebKit/PlatformWPE.cmake
  23. +0 −1 Source/WebKit/PlatformWin.cmake
  24. +1 −1 Source/WebKit/Scripts/generate-forwarding-headers.pl
  25. +1 −1 Source/WebKit/UIProcess/API/glib/WebKitUserContentFilterStore.cpp
  26. +1 −1 Source/WebKit/UIProcess/API/wpe/WebKitColorPrivate.h
  27. +1 −1 Source/WebKit/UIProcess/WebsiteData/win/WebsiteDataStoreWin.cpp
  28. +1 −1 Source/WebKit/UIProcess/win/PageClientImpl.cpp
  29. +1 −1 Source/WebKitLegacy/CMakeLists.txt
  30. +18 −0 Source/WebKitLegacy/ChangeLog
  31. +0 −1 Source/WebKitLegacy/PlatformWin.cmake
  32. +24 −0 Tools/ChangeLog
  33. +2 −1 Tools/DumpRenderTree/TestNetscapePlugIn/CMakeLists.txt
  34. +1 −1 Tools/DumpRenderTree/TestNetscapePlugIn/ForwardingHeaders/WebKit/npapi.h
  35. +1 −1 Tools/DumpRenderTree/TestNetscapePlugIn/ForwardingHeaders/WebKit/npfunctions.h
  36. +1 −1 Tools/DumpRenderTree/TestNetscapePlugIn/ForwardingHeaders/WebKit/npruntime.h
  37. +4 −1 Tools/TestWebKitAPI/CMakeLists.txt
  38. +0 −1 Tools/TestWebKitAPI/PlatformWin.cmake
  39. +2 −2 Tools/TestWebKitAPI/Tests/WebCore/AbortableTaskQueue.cpp
  40. +1 −1 Tools/TestWebKitAPI/Tests/WebCore/gstreamer/GstMappedBuffer.cpp
  41. +1 −1 Tools/WebKitTestRunner/win/PlatformWebViewWin.cpp
@@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 2.8.12)

include(WebKitCommon)
include(WebCoreMacros.cmake)
include(Headers.cmake)

set_property(DIRECTORY . PROPERTY FOLDER "WebCore")

@@ -15,14 +16,14 @@ list(APPEND WebCore_UNIFIED_SOURCE_LIST_FILES
"Sources.txt"
)

set(WebCore_PRIVATE_INCLUDE_DIRECTORIES
"${CMAKE_BINARY_DIR}"
)

set(WebCore_INCLUDE_DIRECTORIES
"${WebCore_DERIVED_SOURCES_DIR}"
"${JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS_DIR}"
"${PAL_FRAMEWORK_HEADERS_DIR}"
)

set(WebCore_PRIVATE_INCLUDE_DIRECTORIES
"${CMAKE_BINARY_DIR}"
"${WebCore_DERIVED_SOURCES_DIR}"
"${WEBCORE_DIR}"
"${WEBCORE_DIR}/Modules/airplay"
"${WEBCORE_DIR}/Modules/applepay"
@@ -1143,7 +1144,7 @@ else ()
endif ()

if (ENABLE_GAMEPAD)
list(APPEND WebCore_INCLUDE_DIRECTORIES
list(APPEND WebCore_PRIVATE_INCLUDE_DIRECTORIES
"${WEBCORE_DIR}/Modules/gamepad"
)

@@ -1488,7 +1489,7 @@ if (ENABLE_GRAPHICS_CONTEXT_3D)
endif ()
endif ()

list(APPEND WebCore_INCLUDE_DIRECTORIES
list(APPEND WebCore_PRIVATE_INCLUDE_DIRECTORIES
"${ANGLE_FORWARDING_HEADERS_DIR}"
"${WEBCORE_DIR}/platform/graphics/gpu"
)
@@ -1650,39 +1651,39 @@ if (ENABLE_USER_MESSAGE_HANDLERS)
endif ()

if (USE_OPENVR)
list(APPEND WebCore_INCLUDE_DIRECTORIES "${THIRDPARTY_DIR}/openvr/headers")
list(APPEND WebCore_INCLUDE_DIRECTORIES "${WEBCORE_DIR}/platform/vr/openvr")
list(APPEND WebCore_PRIVATE_INCLUDE_DIRECTORIES "${THIRDPARTY_DIR}/openvr/headers")
list(APPEND WebCore_PRIVATE_INCLUDE_DIRECTORIES "${WEBCORE_DIR}/platform/vr/openvr")
list(APPEND WebCore_LIBRARIES openvr_api)
endif ()

if (USE_WOFF2)
list(APPEND WebCore_INCLUDE_DIRECTORIES "${WOFF2DEC_INCLUDE_DIRS}")
list(APPEND WebCore_PRIVATE_INCLUDE_DIRECTORIES "${WOFF2DEC_INCLUDE_DIRS}")
list(APPEND WebCore_LIBRARIES "${WOFF2DEC_LIBRARIES}")
endif ()

if (USE_XDGMIME)
list(APPEND WebCore_INCLUDE_DIRECTORIES "${THIRDPARTY_DIR}/xdgmime/src")
list(APPEND WebCore_PRIVATE_INCLUDE_DIRECTORIES "${THIRDPARTY_DIR}/xdgmime/src")
list(APPEND WebCore_LIBRARIES xdgmime)
endif ()

if (USE_LIBWEBRTC)
list(APPEND WebCore_SYSTEM_INCLUDE_DIRECTORIES "${THIRDPARTY_DIR}/libwebrtc/Source/"
"${THIRDPARTY_DIR}/libwebrtc/Source/webrtc"
"${THIRDPARTY_DIR}/libwebrtc/Source/third_party/abseil-cpp")
list(APPEND WebCore_LIBRARIES webrtc)
list(APPEND WebCore_SOURCES
Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp
Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp
Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp
Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp
Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.cpp
Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp
Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.cpp
Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp
)
list(APPEND WebCore_SYSTEM_INCLUDE_DIRECTORIES "${THIRDPARTY_DIR}/libwebrtc/Source/"
"${THIRDPARTY_DIR}/libwebrtc/Source/webrtc"
"${THIRDPARTY_DIR}/libwebrtc/Source/third_party/abseil-cpp")
list(APPEND WebCore_LIBRARIES webrtc)
list(APPEND WebCore_SOURCES
Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp
Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp
Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp
Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.cpp
Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp
Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.cpp
Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp
Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp
)
endif ()

set(WebCoreTestSupport_INCLUDE_DIRECTORIES
set(WebCoreTestSupport_PRIVATE_INCLUDE_DIRECTORIES
"${WEBCORE_DIR}/platform/mock"
"${WEBCORE_DIR}/testing"
"${WEBCORE_DIR}/testing/js"
@@ -1758,6 +1759,12 @@ set(PAINTWORKLETGLOBALSCOPE_CONSTRUCTORS_FILE ${WebCore_DERIVED_SOURCES_DIR}/Pai
WEBKIT_FRAMEWORK_DECLARE(WebCore)
WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()

WEBKIT_MAKE_FORWARDING_HEADERS(WebCore
TARGET_NAME WebCorePrivateFrameworkHeaders
DESTINATION ${WebCore_PRIVATE_FRAMEWORK_HEADERS_DIR}/WebCore
FILES ${WebCore_PRIVATE_FRAMEWORK_HEADERS}
FLATTENED
)

# Generate CommandLineAPIModuleSource.h
add_custom_command(
@@ -2054,7 +2061,6 @@ list(APPEND WebCore_SOURCES ${WebCore_DERIVED_SOURCES_DIR}/XLinkNames.cpp)
GENERATE_DOM_NAMES(XMLNS ${WEBCORE_DIR}/xml/xmlnsattrs.in)
list(APPEND WebCore_SOURCES ${WebCore_DERIVED_SOURCES_DIR}/XMLNSNames.cpp)


GENERATE_DOM_NAMES(XML ${WEBCORE_DIR}/xml/xmlattrs.in)
list(APPEND WebCore_SOURCES ${WebCore_DERIVED_SOURCES_DIR}/XMLNames.cpp)

@@ -2067,10 +2073,10 @@ if (MSVC)
WEBKIT_ADD_PRECOMPILED_HEADER("WebCorePrefix.h" "WebCorePrefix.cpp" WebCore_SOURCES)
endif ()


WEBKIT_FRAMEWORK(WebCore)

add_dependencies(WebCore WebCoreBindings)
add_dependencies(WebCorePrivateFrameworkHeaders WebCoreBindings)

if (APPLE)
set_target_properties(WebCore PROPERTIES LINK_FLAGS "-sub_library libobjc -umbrella WebKit -allowable_client WebCoreTestSupport -allowable_client WebKit2 -allowable_client WebKitLegacy")
@@ -2100,6 +2106,7 @@ endif ()
add_library(WebCoreTestSupport ${WebCoreTestSupport_LIBRARY_TYPE} ${WebCoreTestSupport_SOURCES})
add_dependencies(WebCoreTestSupport WebCore WebCoreTestSupportBindings)
target_include_directories(WebCoreTestSupport PUBLIC ${WebCoreTestSupport_INCLUDE_DIRECTORIES} ${WebCore_INCLUDE_DIRECTORIES})
target_include_directories(WebCoreTestSupport PRIVATE ${WebCoreTestSupport_PRIVATE_INCLUDE_DIRECTORIES} ${WebCore_PRIVATE_INCLUDE_DIRECTORIES})
target_include_directories(WebCoreTestSupport SYSTEM PUBLIC ${WebCore_SYSTEM_INCLUDE_DIRECTORIES})
target_link_libraries(WebCoreTestSupport ${WebCoreTestSupport_LIBRARIES})

@@ -1,3 +1,41 @@
2019-04-18 Don Olmstead <don.olmstead@sony.com>

[CMake] Make WebCore headers copies
https://bugs.webkit.org/show_bug.cgi?id=182512
<rdar://problem/37510435>

Reviewed by Alex Christensen.

The header copying is moved to a target WebCorePrivateFrameworkHeaders. This target was
originally Windows only but now this is enabled for all CMake based ports.

Enumerated all headers within WebCore that are used for WebKit(Legacy), tools and
tests. Shared headers are within Headers.cmake while port and platform specific headers
are in their respective CMake files. Listing out all headers is preferred because globbing
will break the build whenever a file is added.

All include directories within the WebCore source tree are now PRIVATE. They were
modified to use WebCore_PRIVATE_INCLUDE_DIRECTORIES. They will not propagate to other targets
which will prevent erroneous includes in targets dependent on WebCore.

* CMakeLists.txt:
* Headers.cmake: Added.
* PlatformAppleWin.cmake:
* PlatformGTK.cmake:
* PlatformMac.cmake:
* PlatformPlayStation.cmake:
* PlatformWPE.cmake:
* PlatformWin.cmake:
* PlatformWinCairo.cmake:
* platform/Cairo.cmake:
* platform/Curl.cmake:
* platform/FreeType.cmake:
* platform/GStreamer.cmake:
* platform/HolePunch.cmake:
* platform/ImageDecoders.cmake:
* platform/Soup.cmake: Added.
* platform/TextureMapper.cmake:

2019-04-18 Justin Fan <justin_fan@apple.com>

[Web GPU] Implement API default values

0 comments on commit ed3954e

Please sign in to comment.