Ignore:
Timestamp:
Mar 9, 2021, 11:36:26 PM (4 years ago)
Author:
[email protected]
Message:

GLib JSC API headers should only include other GLib JSC API headers
https://bugs.webkit.org/show_bug.cgi?id=222803

Reviewed by Michael Catanzaro.

.:

GTK and WPE both build the JavaScriptCore GLib API. However they diverged with their CMake
variable names for the directory containing jsc. Declare a single variable for that
directory, DERIVED_SOURCES_JAVASCRIPTCORE_GLIB_DIR, that is shared between GLib ports.

Remove the GLIB_API_DIR variant which will just be replaced with
${DERIVED_SOURCES_JAVASCRIPTCORE_GLIB_DIR}/jsc in the CMake code.

  • Source/cmake/OptionsGTK.cmake:
  • Source/cmake/OptionsWPE.cmake:

Source/JavaScriptCore:

A number of private GLib JSC headers are directly including private JavaScriptCore headers.
To get this to compile ${FORWARDING_HEADERS_DIR}/JavaScriptCore was added to the list of
includes in targets that needed the JSC headers. This is incorrect because they are being
distributed in different directories.

The private JSC headers being used were replaced with forward declarations. The source
files were then updated accordingly.

Also the include directories that contained the <jsc/Foo.h> headers were added to
JavaScriptCore_INTERFACE_INCLUDE_DIRECTORIES so they're properly propagated to dependants.

  • API/glib/JSCClassPrivate.h:
  • API/glib/JSCContext.cpp:
  • API/glib/JSCContextPrivate.h:
  • API/glib/JSCVirtualMachine.cpp:
  • API/glib/JSCVirtualMachinePrivate.h:
  • API/glib/JSCWrapperMap.cpp:
  • GLib.cmake:
  • PlatformGTK.cmake:

Source/WebKit:

Update the includes and include directories.

  • PlatformGTK.cmake:
  • PlatformWPE.cmake:
  • WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMNode.cpp:
  • WebProcess/InjectedBundle/API/glib/WebKitFrame.cpp:

Tools:

Update the includes and include directories.

  • MiniBrowser/wpe/CMakeLists.txt:
  • TestWebKitAPI/PlatformGTK.cmake:
  • TestWebKitAPI/PlatformWPE.cmake:
  • TestWebKitAPI/Tests/JavaScriptCore/glib/TestJSC.cpp:
  • TestWebKitAPI/glib/PlatformGTK.cmake:
  • TestWebKitAPI/glib/PlatformWPE.cmake:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/GLib.cmake

    r273836 r274201  
    11file(MAKE_DIRECTORY ${FORWARDING_HEADERS_DIR}/JavaScriptCore/glib)
    2 file(MAKE_DIRECTORY ${DERIVED_SOURCES_JAVASCRIPCORE_GLIB_API_DIR})
     2file(MAKE_DIRECTORY ${DERIVED_SOURCES_JAVASCRIPTCORE_GLIB_DIR}/jsc)
    33
    44list(APPEND JavaScriptCore_SOURCES
     
    1919list(APPEND JavaScriptCore_PRIVATE_INCLUDE_DIRECTORIES
    2020    "${FORWARDING_HEADERS_DIR}/JavaScriptCore/glib"
    21     "${DERIVED_SOURCES_JAVASCRIPCORE_GLIB_API_DIR}"
     21    "${DERIVED_SOURCES_JAVASCRIPTCORE_GLIB_DIR}/jsc"
    2222    "${JAVASCRIPTCORE_DIR}/API/glib"
    2323)
    2424
     25list(APPEND JavaScriptCore_INTERFACE_INCLUDE_DIRECTORIES
     26    "${FORWARDING_HEADERS_DIR}/JavaScriptCore/glib"
     27    "${DERIVED_SOURCES_JAVASCRIPTCORE_GLIB_DIR}"
     28)
     29
    2530set(JavaScriptCore_INSTALLED_HEADERS
    26     ${DERIVED_SOURCES_JAVASCRIPCORE_GLIB_API_DIR}/JSCVersion.h
     31    ${DERIVED_SOURCES_JAVASCRIPTCORE_GLIB_DIR}/jsc/JSCVersion.h
    2732    ${JAVASCRIPTCORE_DIR}/API/glib/JSCAutocleanups.h
    2833    ${JAVASCRIPTCORE_DIR}/API/glib/JSCClass.h
     
    3742)
    3843
    39 configure_file(API/glib/JSCVersion.h.in ${DERIVED_SOURCES_JAVASCRIPCORE_GLIB_API_DIR}/JSCVersion.h)
     44configure_file(API/glib/JSCVersion.h.in ${DERIVED_SOURCES_JAVASCRIPTCORE_GLIB_DIR}/jsc/JSCVersion.h)
    4045
    4146# These symbolic link allows includes like #include <jsc/jsc.h> which simulates installed headers.
Note: See TracChangeset for help on using the changeset viewer.