Summary: | [CMake][VS] PrivateHeaders/WebCore/WebCoreJSBuiltinInternals.h is not updated in incremental build | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Fujii Hironori <Hironori.Fujii> | ||||||
Component: | CMake | Assignee: | Fujii Hironori <Hironori.Fujii> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | annulen, don.olmstead, ews-watchlist, gyuyoung.kim, pangle, ryuan.choi, sergio | ||||||
Priority: | P2 | ||||||||
Version: | WebKit Nightly Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Attachments: |
|
Description
Fujii Hironori
2022-05-10 23:24:33 PDT
Created attachment 459144 [details]
WIP patch
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. Created attachment 459271 [details]
Patch
Committed r294273 (250619@main): <https://commits.webkit.org/250619@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 459271 [details]. |