Summary: | [CMake] WebKit should link to WebCore as a PRIVATE library if WebCore is a static library | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Fujii Hironori <Hironori.Fujii> | ||||||||||||||||||||
Component: | WebKit2 | Assignee: | Fujii Hironori <Hironori.Fujii> | ||||||||||||||||||||
Status: | RESOLVED FIXED | ||||||||||||||||||||||
Severity: | Normal | CC: | achristensen, annulen, bfulgham, don.olmstead, mcatanzaro, pvollan, webkit-bug-importer | ||||||||||||||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||||||||||||||
Version: | WebKit Nightly Build | ||||||||||||||||||||||
Hardware: | Unspecified | ||||||||||||||||||||||
OS: | Unspecified | ||||||||||||||||||||||
Bug Depends on: | |||||||||||||||||||||||
Bug Blocks: | 174003 | ||||||||||||||||||||||
Attachments: |
|
Description
Fujii Hironori
2018-03-28 23:48:24 PDT
Created attachment 336754 [details]
WIP patch
This patch doen't work for ports using generate-forwarding-headers.pl.
Because generate-forwarding-headers.pl creates forwarding headers only for headers included by WebKit2.
Then, include paths should contain all WebCore directories.
Created attachment 336762 [details]
WIP patch
Created attachment 336836 [details]
WIP patch
Created attachment 336840 [details]
Patch
Let's see what Konstantin thinks. This change is wrong for cases when WebCore is built as SHARED library, because all users of WebKit need to link WebCore as well Created attachment 336969 [details]
Patch
Comment on attachment 336969 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=336969&action=review > Source/WebCore/CMakeLists.txt:1994 > + target_link_libraries(WebCore PUBLIC ANGLESupport) ANGLESupport must be PRIVATE > Source/WebKit/PlatformGTK.cmake:461 > +list(APPEND WebKit_PRIVATE_LIBRARIES There is no real need for new variable - just add 'PUBLIC' and 'PRIVATE' keywords to WebKit_LIBRARIES. Comment on attachment 336969 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=336969&action=review >> Source/WebCore/CMakeLists.txt:1994 >> + target_link_libraries(WebCore PUBLIC ANGLESupport) > > ANGLESupport must be PRIVATE No. I tried PRIVATE, but I got compilation errors. I'll attach the error message for the records, tomorrow. >> Source/WebKit/PlatformGTK.cmake:461 >> +list(APPEND WebKit_PRIVATE_LIBRARIES > > There is no real need for new variable - just add 'PUBLIC' and 'PRIVATE' keywords to WebKit_LIBRARIES. I think I need to switch back to PUBLIC again. > list(APPEND WebKit_PRIVATE_LIBRARIES PRIVATE WebCore PUBLIC) I'll remake the patch. Comment on attachment 336969 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=336969&action=review >>> Source/WebCore/CMakeLists.txt:1994 >>> + target_link_libraries(WebCore PUBLIC ANGLESupport) >> >> ANGLESupport must be PRIVATE > > No. > I tried PRIVATE, but I got compilation errors. I'll attach the error message for the records, tomorrow. Ah, that's because of include directories. Same problem as what you are doing with WebCoreHeaderInterface Comment on attachment 336969 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=336969&action=review >>> Source/WebKit/PlatformGTK.cmake:461 >>> +list(APPEND WebKit_PRIVATE_LIBRARIES >> >> There is no real need for new variable - just add 'PUBLIC' and 'PRIVATE' keywords to WebKit_LIBRARIES. > > I think I need to switch back to PUBLIC again. GTK port is using ADD_WHOLE_ARCHIVE_TO_LIBRARIES. https://trac.webkit.org/browser/webkit/trunk/Source/WebKit/PlatformGTK.cmake?rev=228590#L668 Do you think I should modify ADD_WHOLE_ARCHIVE_TO_LIBRARIES to remove PUBLIC and PRIVATE keywords? Comment on attachment 336969 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=336969&action=review >>>> Source/WebCore/CMakeLists.txt:1994 >>>> + target_link_libraries(WebCore PUBLIC ANGLESupport) >>> >>> ANGLESupport must be PRIVATE >> >> No. >> I tried PRIVATE, but I got compilation errors. I'll attach the error message for the records, tomorrow. > > Ah, that's because of include directories. Same problem as what you are doing with WebCoreHeaderInterface I tried again and no problem happens today. I'll make ANGLESupport PRIVATE. Created attachment 337050 [details]
Patch
Created attachment 337138 [details]
Patch
Hi Konstantin, I addressed the review feedbacks. Could you review again? Comment on attachment 337138 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=337138&action=review > Source/WebKit/CMakeLists.txt:726 > + set(WebKit_LIBRARIES WebCoreHeaderInterface PRIVATE WebCore PUBLIC) While this line is syntactically correct, I think we should write such code like set(WebKit_LIBRARIES PUBLIC WebCoreHeaderInterface PRIVATE WebCore ) i.e. all libraries/targets have their "access specifiers" in front of them, instead of providing access specifier for unknown follow-up list Created attachment 337327 [details]
Patch
Comment on attachment 337327 [details]
Patch
Thank you for the review, Konstantin. I did it.
Comment on attachment 337327 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=337327&action=review > Source/WebKit/PlatformGTK.cmake:463 > + PRIVATE ${GTK_UNIX_PRINT_LIBRARIES} Don't repeat PRIVATE list(APPEND WebKit_LIBRARIES PRIVATE A B C PUBLIC ... ) Created attachment 337354 [details]
Patch
Committed r230385: <https://trac.webkit.org/changeset/230385> |