[Webkit-unassigned] [Bug 240297] [CMake][VS] PrivateHeaders/WebCore/WebCoreJSBuiltinInternals.h is not updated in incremental build

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed May 11 23:18:30 PDT 2022


https://bugs.webkit.org/show_bug.cgi?id=240297

--- Comment #2 from Fujii Hironori <Hironori.Fujii at sony.com> ---
1.
${WebCore_DERIVED_SOURCES_DIR}/WebCoreJSBuiltinInternals.h is generated by this add_custom_command.
https://github.com/WebKit/WebKit/blob/992f5b028f19101857ea6590c3f75bb41f543a65/Source/WebCore/CMakeLists.txt#L2375-L2383

2.
${WebCore_DERIVED_SOURCES_DIR}/WebCoreJSBuiltinInternals.h is added to WebCore_SOURCES.
https://github.com/WebKit/WebKit/blob/992f5b028f19101857ea6590c3f75bb41f543a65/Source/WebCore/CMakeLists.txt#L2388

3.
${WebCore_DERIVED_SOURCES_DIR}/WebCoreJSBuiltinInternals.h is added to WebCore_PRIVATE_FRAMEWORK_HEADERS.
https://github.com/WebKit/WebKit/blob/992f5b028f19101857ea6590c3f75bb41f543a65/Source/WebCore/Headers.cmake#L2116

4.
${WebCore_PRIVATE_FRAMEWORK_HEADERS} are copied to ${WebCore_PRIVATE_FRAMEWORK_HEADERS_DIR}/WebCore directory in WebCore_CopyPrivateHeaders target by this WEBKIT_COPY_FILES.
https://github.com/WebKit/WebKit/blob/992f5b028f19101857ea6590c3f75bb41f543a65/Source/WebCore/CMakeLists.txt#L2438-L2442

5.
WebCore_CopyPrivateHeaders target has a dependency to WebCore target.
https://github.com/WebKit/WebKit/blob/992f5b028f19101857ea6590c3f75bb41f543a65/Source/WebCore/CMakeLists.txt#L2449

6.
WEBKIT_COPY_FILES uses add_custom_command to copy files. It specifies the file as MAIN_DEPENDENCY.
https://github.com/WebKit/WebKit/blob/992f5b028f19101857ea6590c3f75bb41f543a65/Source/cmake/WebKitMacros.cmake#L473

7.
MAIN_DEPENDENCY suggests to Visual Studio generators where to hang the custom command.
https://cmake.org/cmake/help/latest/command/add_custom_command.html

8.
In this case, copying command of ${WebCore_DERIVED_SOURCES_DIR}/WebCoreJSBuiltinInternals.h is attached to the file itself.

9.
${WebCore_DERIVED_SOURCES_DIR}/WebCoreJSBuiltinInternals.h is included into both WebCore.vcxproj and WebCore_CopyPrivateHeaders.vcxproj due to (2) and (3).

10.
If a source file attached with a custom command is belong to multiple vcxproj, CMake VS generator generates the build rule only in the least-dependent vcxproj.
https://gitlab.kitware.com/cmake/cmake/-/commit/f59c33a763ba1483129f0e721bc2394bb7442876

11.
In this case, WebCore.vcxproj is the least-dependent target due to (5).
So, the copying command is in WebCore.vcxproj.

12.
If both generate-js-builtins.py command and the copying command are in WebCore.vcxproj, they don't work as expected.
I don't know the reason.

In the WIP patch, ${WebCore_DERIVED_SOURCES_DIR}/WebCoreJSBuiltinInternals.h isn't added to WebCore_SOURCES.
Then, the copying command is generated in WebCore_CopyPrivateHeaders.vcxproj. It works.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220512/e4255e53/attachment-0001.htm>


More information about the webkit-unassigned mailing list