[CMake] WEBKIT_MAKE_FORWARDING_HEADERS shouldn't use POST_BUILD to copy generated...
authorHironori.Fujii@sony.com <Hironori.Fujii@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Apr 2019 16:33:02 +0000 (16:33 +0000)
committerHironori.Fujii@sony.com <Hironori.Fujii@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Apr 2019 16:33:02 +0000 (16:33 +0000)
https://bugs.webkit.org/show_bug.cgi?id=182757

Reviewed by Don Olmstead.

.:

Some generated headers need to be exported to its client modules.
Before this change, WEBKIT_MAKE_FORWARDING_HEADERS copies all *.h
files in the directory specified by DERIVED_SOURCE_DIRECTORIES
parameter. The copy operation was triggered by POST_BUILD event.

This caused build dependency issues for Ninja builds. This change
remove the DERIVED_SOURCE_DIRECTORIES parameter. And list all
generated headers explicitly which need to be copied.

* Source/cmake/WebKitMacros.cmake: Removed
DERIVED_SOURCE_DIRECTORIES parameter of
WEBKIT_MAKE_FORWARDING_HEADERS. Accept absolute paths for FILES
parameter.

Source/JavaScriptCore:

* CMakeLists.txt: Do not use DERIVED_SOURCE_DIRECTORIES parameter
of WEBKIT_MAKE_FORWARDING_HEADERS. Added generated headers to
JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS.

Source/WebCore:

No new tests because no behavior changes.

* PlatformWin.cmake: Do not use DERIVED_SOURCE_DIRECTORIES of
WEBKIT_MAKE_FORWARDING_HEADERS. Added
WebCore_PRIVATE_FRAMEWORK_HEADERS.
* WebCoreMacros.cmake (GENERATE_DOM_NAMES): Added
${_namespace}ElementTypeHelpers.h to _outputfiles.

Source/WebKitLegacy:

* PlatformWin.cmake: Do not use DERIVED_SOURCE_DIRECTORIES
parameter of WEBKIT_MAKE_FORWARDING_HEADERS. Added
WebKitLegacyGUID_PRIVATE_FRAMEWORK_HEADERS.

Tools:

* TestWebKitAPI/PlatformGTK.cmake: Removed the workaround of using an intermediate target.
* TestWebKitAPI/PlatformWPE.cmake: Ditto.

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

12 files changed:
ChangeLog
Source/JavaScriptCore/CMakeLists.txt
Source/JavaScriptCore/ChangeLog
Source/WebCore/ChangeLog
Source/WebCore/PlatformWin.cmake
Source/WebCore/WebCoreMacros.cmake
Source/WebKitLegacy/ChangeLog
Source/WebKitLegacy/PlatformWin.cmake
Source/cmake/WebKitMacros.cmake
Tools/ChangeLog
Tools/TestWebKitAPI/PlatformGTK.cmake
Tools/TestWebKitAPI/PlatformWPE.cmake

index e876514..043aebf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,24 @@
+2019-04-02  Fujii Hironori  <Hironori.Fujii@sony.com>
+
+        [CMake] WEBKIT_MAKE_FORWARDING_HEADERS shouldn't use POST_BUILD to copy generated headers
+        https://bugs.webkit.org/show_bug.cgi?id=182757
+
+        Reviewed by Don Olmstead.
+
+        Some generated headers need to be exported to its client modules.
+        Before this change, WEBKIT_MAKE_FORWARDING_HEADERS copies all *.h
+        files in the directory specified by DERIVED_SOURCE_DIRECTORIES
+        parameter. The copy operation was triggered by POST_BUILD event.
+
+        This caused build dependency issues for Ninja builds. This change
+        remove the DERIVED_SOURCE_DIRECTORIES parameter. And list all
+        generated headers explicitly which need to be copied.
+
+        * Source/cmake/WebKitMacros.cmake: Removed
+        DERIVED_SOURCE_DIRECTORIES parameter of
+        WEBKIT_MAKE_FORWARDING_HEADERS. Accept absolute paths for FILES
+        parameter.
+
 2019-04-01  Fujii Hironori  <Hironori.Fujii@sony.com>
 
         [CMake] Remove EXTRA_DIRECTORIES parameter of WEBKIT_MAKE_FORWARDING_HEADERS
index 7977217..6af11b3 100644 (file)
@@ -399,6 +399,13 @@ set(JavaScriptCore_PUBLIC_FRAMEWORK_HEADERS
 )
 
 set(JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS
+    ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/Bytecodes.h
+    ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSCBuiltins.h
+
+    ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendDispatchers.h
+    ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorFrontendDispatchers.h
+    ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorProtocolObjects.h
+
     API/APICallbackFunction.h
     API/APICast.h
     API/APIUtils.h
@@ -1274,7 +1281,6 @@ WEBKIT_MAKE_FORWARDING_HEADERS(JavaScriptCore
 WEBKIT_MAKE_FORWARDING_HEADERS(JavaScriptCore
     TARGET_NAME JavaScriptCorePrivateForwardingHeaders
     FILES ${JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS}
-    DERIVED_SOURCE_DIRECTORIES ${DERIVED_SOURCES_DIR}/JavaScriptCore ${DERIVED_SOURCES_DIR}/JavaScriptCore/inspector
     FLATTENED
 )
 
index 41b7eb6..d42224f 100644 (file)
@@ -1,3 +1,14 @@
+2019-04-02  Fujii Hironori  <Hironori.Fujii@sony.com>
+
+        [CMake] WEBKIT_MAKE_FORWARDING_HEADERS shouldn't use POST_BUILD to copy generated headers
+        https://bugs.webkit.org/show_bug.cgi?id=182757
+
+        Reviewed by Don Olmstead.
+
+        * CMakeLists.txt: Do not use DERIVED_SOURCE_DIRECTORIES parameter
+        of WEBKIT_MAKE_FORWARDING_HEADERS. Added generated headers to
+        JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS.
+
 2019-04-02  Saam barati  <sbarati@apple.com>
 
         Add a ValueRepReduction phase
index 45d8b8e..efb2c88 100644 (file)
@@ -1,3 +1,18 @@
+2019-04-02  Fujii Hironori  <Hironori.Fujii@sony.com>
+
+        [CMake] WEBKIT_MAKE_FORWARDING_HEADERS shouldn't use POST_BUILD to copy generated headers
+        https://bugs.webkit.org/show_bug.cgi?id=182757
+
+        Reviewed by Don Olmstead.
+
+        No new tests because no behavior changes.
+
+        * PlatformWin.cmake: Do not use DERIVED_SOURCE_DIRECTORIES of
+        WEBKIT_MAKE_FORWARDING_HEADERS. Added
+        WebCore_PRIVATE_FRAMEWORK_HEADERS.
+        * WebCoreMacros.cmake (GENERATE_DOM_NAMES): Added
+        ${_namespace}ElementTypeHelpers.h to _outputfiles.
+
 2019-04-02  Cathie Chen  <cathiechen@igalia.com>
 
         Update the status of ResizeObserver in features.json.
index aae2123..5cc49ca 100644 (file)
@@ -320,12 +320,47 @@ if (WTF_PLATFORM_WIN_CAIRO AND EXISTS ${WEBKIT_LIBRARIES_DIR}/etc/ssl/cert.pem)
     )
 endif ()
 
+set(WebCore_PRIVATE_FRAMEWORK_HEADERS
+    ${DERIVED_SOURCES_WEBCORE_DIR}/CSSPropertyNames.h
+    ${DERIVED_SOURCES_WEBCORE_DIR}/CSSValueKeywords.h
+    ${DERIVED_SOURCES_WEBCORE_DIR}/EventInterfaces.h
+    ${DERIVED_SOURCES_WEBCORE_DIR}/EventTargetInterfaces.h
+    ${DERIVED_SOURCES_WEBCORE_DIR}/HTMLElementTypeHelpers.h
+    ${DERIVED_SOURCES_WEBCORE_DIR}/HTMLNames.h
+    ${DERIVED_SOURCES_WEBCORE_DIR}/HTTPHeaderNames.h
+    ${DERIVED_SOURCES_WEBCORE_DIR}/JSBlob.h
+    ${DERIVED_SOURCES_WEBCORE_DIR}/JSCSSStyleDeclaration.h
+    ${DERIVED_SOURCES_WEBCORE_DIR}/JSDOMBindingInternalsBuiltins.h
+    ${DERIVED_SOURCES_WEBCORE_DIR}/JSDOMWindow.h
+    ${DERIVED_SOURCES_WEBCORE_DIR}/JSDocument.h
+    ${DERIVED_SOURCES_WEBCORE_DIR}/JSElement.h
+    ${DERIVED_SOURCES_WEBCORE_DIR}/JSEventTarget.h
+    ${DERIVED_SOURCES_WEBCORE_DIR}/JSFile.h
+    ${DERIVED_SOURCES_WEBCORE_DIR}/JSHTMLElement.h
+    ${DERIVED_SOURCES_WEBCORE_DIR}/JSNode.h
+    ${DERIVED_SOURCES_WEBCORE_DIR}/JSNotification.h
+    ${DERIVED_SOURCES_WEBCORE_DIR}/JSRange.h
+    ${DERIVED_SOURCES_WEBCORE_DIR}/JSReadableStream.h
+    ${DERIVED_SOURCES_WEBCORE_DIR}/JSReadableStreamDefaultController.h
+    ${DERIVED_SOURCES_WEBCORE_DIR}/RTCPeerConnectionInternalsBuiltins.h
+    ${DERIVED_SOURCES_WEBCORE_DIR}/ReadableByteStreamInternalsBuiltins.h
+    ${DERIVED_SOURCES_WEBCORE_DIR}/ReadableStreamInternalsBuiltins.h
+    ${DERIVED_SOURCES_WEBCORE_DIR}/Settings.h
+    ${DERIVED_SOURCES_WEBCORE_DIR}/StreamInternalsBuiltins.h
+    ${DERIVED_SOURCES_WEBCORE_DIR}/WebCoreJSBuiltinInternals.h
+    ${DERIVED_SOURCES_WEBCORE_DIR}/WebCoreJSBuiltins.h
+    ${DERIVED_SOURCES_WEBCORE_DIR}/WebKitFontFamilyNames.h
+    ${DERIVED_SOURCES_WEBCORE_DIR}/WritableStreamInternalsBuiltins.h
+)
+
 WEBKIT_MAKE_FORWARDING_HEADERS(WebCore
+    FILES ${WebCore_PRIVATE_FRAMEWORK_HEADERS}
     DIRECTORIES ${WebCore_FORWARDING_HEADERS_DIRECTORIES}
-    DERIVED_SOURCE_DIRECTORIES ${DERIVED_SOURCES_WEBCORE_DIR}
     FLATTENED
 )
 
+add_dependencies(WebCoreForwardingHeaders WebCoreBindings)
+
 set(WebCore_OUTPUT_NAME
     WebCore${DEBUG_SUFFIX}
 )
index 2b49e84..9ca32bd 100644 (file)
@@ -220,7 +220,7 @@ macro(GENERATE_DOM_NAMES _namespace _attrs)
 
     if (_tags)
         set(_arguments "${_arguments}" --tags ${_tags} --factory --wrapperFactory)
-        set(_outputfiles "${_outputfiles}" ${DERIVED_SOURCES_WEBCORE_DIR}/${_namespace}ElementFactory.cpp ${DERIVED_SOURCES_WEBCORE_DIR}/${_namespace}ElementFactory.h ${DERIVED_SOURCES_WEBCORE_DIR}/JS${_namespace}ElementWrapperFactory.cpp ${DERIVED_SOURCES_WEBCORE_DIR}/JS${_namespace}ElementWrapperFactory.h)
+        set(_outputfiles "${_outputfiles}" ${DERIVED_SOURCES_WEBCORE_DIR}/${_namespace}ElementFactory.cpp ${DERIVED_SOURCES_WEBCORE_DIR}/${_namespace}ElementFactory.h ${DERIVED_SOURCES_WEBCORE_DIR}/${_namespace}ElementTypeHelpers.h ${DERIVED_SOURCES_WEBCORE_DIR}/JS${_namespace}ElementWrapperFactory.cpp ${DERIVED_SOURCES_WEBCORE_DIR}/JS${_namespace}ElementWrapperFactory.h)
     endif ()
 
     if (_extradef)
index 25fe35b..a50cbdd 100644 (file)
@@ -1,3 +1,14 @@
+2019-04-02  Fujii Hironori  <Hironori.Fujii@sony.com>
+
+        [CMake] WEBKIT_MAKE_FORWARDING_HEADERS shouldn't use POST_BUILD to copy generated headers
+        https://bugs.webkit.org/show_bug.cgi?id=182757
+
+        Reviewed by Don Olmstead.
+
+        * PlatformWin.cmake: Do not use DERIVED_SOURCE_DIRECTORIES
+        parameter of WEBKIT_MAKE_FORWARDING_HEADERS. Added
+        WebKitLegacyGUID_PRIVATE_FRAMEWORK_HEADERS.
+
 2019-03-13  Youenn Fablet  <youenn@apple.com>
 
         Check IDB quota usage through QuotaManager
index c8dab36..dc2d703 100644 (file)
@@ -478,10 +478,16 @@ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${MSVC_RUNTIME_LINKE
 file(MAKE_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
 file(MAKE_DIRECTORY ${DERIVED_SOURCES_WEBKITLEGACY_DIR}/Interfaces)
 
+set(WebKitLegacyGUID_PRIVATE_FRAMEWORK_HEADERS
+    ${DERIVED_SOURCES_WEBKITLEGACY_DIR}/Interfaces/WebKit.h
+
+    win/CFDictionaryPropertyBag.h
+    win/WebKitCOMAPI.h
+)
+
 WEBKIT_MAKE_FORWARDING_HEADERS(WebKitLegacyGUID
     DESTINATION ${FORWARDING_HEADERS_DIR}/WebKitLegacy
-    FILES win/WebKitCOMAPI.h win/CFDictionaryPropertyBag.h
-    DERIVED_SOURCE_DIRECTORIES ${DERIVED_SOURCES_WEBKITLEGACY_DIR}/Interfaces
+    FILES ${WebKitLegacyGUID_PRIVATE_FRAMEWORK_HEADERS}
     FLATTENED
 )
 
index 1cf0436..107cd9b 100644 (file)
@@ -236,7 +236,7 @@ endmacro()
 function(WEBKIT_MAKE_FORWARDING_HEADERS framework)
     set(options FLATTENED)
     set(oneValueArgs DESTINATION TARGET_NAME)
-    set(multiValueArgs DIRECTORIES DERIVED_SOURCE_DIRECTORIES FILES)
+    set(multiValueArgs DIRECTORIES FILES)
     cmake_parse_arguments(opt "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
     set(headers ${opt_FILES})
     if (opt_DESTINATION)
@@ -251,6 +251,11 @@ function(WEBKIT_MAKE_FORWARDING_HEADERS framework)
     endforeach ()
     set(fwd_headers)
     foreach (header IN LISTS headers)
+        if (IS_ABSOLUTE ${header})
+            set(src_header ${header})
+        else ()
+            set(src_header ${CMAKE_CURRENT_SOURCE_DIR}/${header})
+        endif ()
         if (opt_FLATTENED)
             get_filename_component(header_filename ${header} NAME)
             set(fwd_header ${destination}/${header_filename})
@@ -260,7 +265,7 @@ function(WEBKIT_MAKE_FORWARDING_HEADERS framework)
             set(fwd_header ${destination}/${header})
         endif ()
         add_custom_command(OUTPUT ${fwd_header}
-            COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/${header} ${fwd_header}
+            COMMAND ${CMAKE_COMMAND} -E copy ${src_header} ${fwd_header}
             MAIN_DEPENDENCY ${header}
             VERBATIM
         )
@@ -273,27 +278,6 @@ function(WEBKIT_MAKE_FORWARDING_HEADERS framework)
     endif ()
     add_custom_target(${target_name} DEPENDS ${fwd_headers})
     add_dependencies(${framework} ${target_name})
-    if (opt_DERIVED_SOURCE_DIRECTORIES)
-        set(script ${CMAKE_CURRENT_BINARY_DIR}/makeForwardingHeaders.cmake)
-        set(content "")
-        foreach (dir IN LISTS opt_DERIVED_SOURCE_DIRECTORIES)
-            string(CONCAT content ${content}
-                "file(GLOB headers \"${dir}/*.h\")\n"
-                "foreach (header IN LISTS headers)\n"
-                "    get_filename_component(header_filename \${header} NAME)\n"
-                "    execute_process(COMMAND \${CMAKE_COMMAND} -E copy_if_different \${header} ${destination}/\${header_filename} RESULT_VARIABLE result)\n"
-                "    if (NOT \${result} EQUAL 0)\n"
-                "        message(FATAL_ERROR \"Failed to copy \${header}: \${result}\")\n"
-                "    endif ()\n"
-                "endforeach ()\n"
-            )
-        endforeach ()
-        file(WRITE ${script} ${content})
-        add_custom_command(TARGET ${framework} POST_BUILD
-            COMMAND ${CMAKE_COMMAND} -P ${script}
-            VERBATIM
-        )
-    endif ()
 endfunction()
 
 # Helper macros for debugging CMake problems.
index 4131961..5a36610 100644 (file)
@@ -1,3 +1,13 @@
+2019-04-02  Fujii Hironori  <Hironori.Fujii@sony.com>
+
+        [CMake] WEBKIT_MAKE_FORWARDING_HEADERS shouldn't use POST_BUILD to copy generated headers
+        https://bugs.webkit.org/show_bug.cgi?id=182757
+
+        Reviewed by Don Olmstead.
+
+        * TestWebKitAPI/PlatformGTK.cmake: Removed the workaround of using an intermediate target.
+        * TestWebKitAPI/PlatformWPE.cmake: Ditto.
+
 2019-04-01  Jonathan Bedard  <jbedard@apple.com>
 
         run-api-tests: Upload test results
index 8dd0e14..a4f2abd 100644 (file)
@@ -133,10 +133,6 @@ add_test(TestJSC ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/JavaScriptCore/TestJS
 set_tests_properties(TestJSC PROPERTIES TIMEOUT 60)
 set_target_properties(TestJSC PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/JavaScriptCore)
 
-# Add an intermediate target between TestJSC and JavaScriptCore to ensure derived headers are copied into the forwarding header directory.
-add_custom_target(pre-TestJSC DEPENDS JavaScriptCore)
-add_dependencies(TestJSC pre-TestJSC)
-
 if (COMPILER_IS_GCC_OR_CLANG)
     WEBKIT_ADD_TARGET_CXX_FLAGS(TestWebKit -Wno-sign-compare
                                            -Wno-undef
index 26d0e9a..f144308 100644 (file)
@@ -114,10 +114,6 @@ add_dependencies(TestJSC ${TestWebKitAPI_DEPENDENCIES})
 set_tests_properties(TestJSC PROPERTIES TIMEOUT 60)
 set_target_properties(TestJSC PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/JavaScriptCore)
 
-# Add an intermediate target between TestJSC and JavaScriptCore to ensure derived headers are copied into the forwarding header directory.
-add_custom_target(pre-TestJSC DEPENDS JavaScriptCore)
-add_dependencies(TestJSC pre-TestJSC)
-
 if (COMPILER_IS_GCC_OR_CLANG)
     WEBKIT_ADD_TARGET_CXX_FLAGS(TestWebCore -Wno-sign-compare
                                             -Wno-undef