Only link WTF from JavaScriptCore and only link PAL from WebCore in Mac CMake build
Created attachment 427082 [details] Patch
Comment on attachment 427082 [details] Patch I'm. going to try object libraries instead of this.
Object libraries don't seem to work. JavaScriptCore.framework needs to be linked with -force_load libWTF.a which doesn't seem to be able to be done with object libraries.
(In reply to Alex Christensen from comment #3) > Object libraries don't seem to work. JavaScriptCore.framework needs to be > linked with -force_load libWTF.a which doesn't seem to be able to be done > with object libraries. Can you show me what the linker errors are and what the patch looks like? I would expect the WebKit library to build properly but itβs likely there will be problems with the executables around testing.
<rdar://problem/77467972>
Created attachment 439569 [details] Patch
Comment on attachment 439569 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=439569&action=review The _FRAMEWORKS actually computes how to link the frameworks. So in the Mac case if you were linking WTF it would be linked through JavaScriptCore because that's the library that exposes WTF. There may be an issue around making WebCoreTestSupport being SHARED but other than that it SHOULD work properly after you use OBJECT with bmalloc, WTF, PAL. If not then there's a bug in the macro with computing it. > Source/WebKit/CMakeLists.txt:303 > -set(WebKit_FRAMEWORKS > +set(WebKit_PRIVATE_LIBRARIES > JavaScriptCore > - PAL > - WTF > WebCore This change is incorrect. > Source/cmake/OptionsMac.cmake:-113 > set(JavaScriptCore_LIBRARY_TYPE SHARED) > set(WebCore_LIBRARY_TYPE SHARED) > -set(WebCoreTestSupport_LIBRARY_TYPE SHARED) Please modify things so its set(bmalloc_LIBRARY_TYPE OBJECT) set(WTF_LIBRARY_TYPE OBJECT) set(JavaScriptCore_LIBRARY_TYPE SHARED) set(PAL_LIBRARY_TYPE OBJECT) set(WebCore_LIBRARY_TYPE SHARED) > Tools/TestWebKitAPI/CMakeLists.txt:206 > set(TestWebCore_FRAMEWORKS > JavaScriptCore > - PAL > - WTF > - WebCore > + WebKit This change is incorrect.
Yeah, I'm not sure what's going on, but this patch gets it to compile and anything less doesn't. I think it may be CMake linking all of a framework's dependencies when you link the framework unless you use PRIVATE when linking the framework. We will eventually need to change the shared CMakeLists.txt to not link as many things.