Branch: refs/heads/main Home: https://github.com/WebKit/WebKit Commit: 3d732906995061dc7c611017fbc04e3dd344ede5 https://github.com/WebKit/WebKit/commit/3d732906995061dc7c611017fbc04e3dd344ede5 Author: David Kilzer <ddkil...@apple.com> Date: 2023-11-04 (Sat, 04 Nov 2023)
Changed paths: M Source/JavaScriptCore/API/JSWrapperMap.h M Source/JavaScriptCore/API/ObjCCallbackFunction.h M Source/JavaScriptCore/Configurations/Base.xcconfig A Source/JavaScriptCore/Configurations/BaseTarget.xcconfig M Source/JavaScriptCore/Configurations/JSC.xcconfig M Source/JavaScriptCore/Configurations/JavaScriptCore.xcconfig A Source/JavaScriptCore/Configurations/libJavaScriptCore.xcconfig M Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj A Source/JavaScriptCore/JavaScriptCoreFramework.cpp Log Message: ----------- Build static library for JavaScriptCore before linking framework https://bugs.webkit.org/show_bug.cgi?id=263697 <rdar://113641596> Reviewed by Elliott Williams. This change introduces a libJavaScriptCore.a target, which is then used to link JavaScriptCore.framework. By configuring the project to build this way, there is no need to duplicate the list of sources between both targets. When JSC_USE_STATIC_LINKING=YES, the jsc binary is linked to libJavaScriptCore.a instead of to JavaScriptCore.framework. * Source/JavaScriptCore/API/JSWrapperMap.h: * Source/JavaScriptCore/API/ObjCCallbackFunction.h: - Fix header include paths to work with static library. * Source/JavaScriptCore/Configurations/BaseTarget.xcconfig: Copy from Source/JavaScriptCore/Configurations/JSC.xcconfig. - Extract common variables from JavaScriptCore.xcconfig that are shared with libJavaScriptCore.xcconfig. * Source/JavaScriptCore/Configurations/Base.xcconfig: - Extract linker variables from JavaScriptCore.xcconfig that are shared with JSC.xcconfig. - Note that `-fobjc-link-runtime` replaces `-lobjc -framework CoreFoundation -framework Foundation`. * Source/JavaScriptCore/Configurations/JSC.xcconfig: (JSC_USE_STATIC_LINKING): Add. - Set to the same boolean value as ENABLE_LIBFUZZER (which will default to NO), but make it a separate variable to allow this behavior to be overriden via xcodebuild. - Configure OTHER_LDFLAGS to statically link libJavaScriptCore.a when JSC_USE_STATIC_LINKING=YES, else use dynamic linking (default) to JavaScriptCore.framework. * Source/JavaScriptCore/Configurations/JavaScriptCore.xcconfig: - Extract shared variables into BaseTarget.xcconfig. - Move build related variables into libJavaScriptCore.xcconfig. * Source/JavaScriptCore/Configurations/libJavaScriptCore.xcconfig: Add. - Move build-related variables from JavaScriptCore.xcconfig. * Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj: - Add new xcconfig files to project. - Add libJavaScriptCore.a target and use libJavaScriptCore.xcconfig as its base. - Move from JavaScriptCore framework target to libJavaScriptCore target: - Custom Build Rules. - Compile Sources. - Target Dependencies. - Copy Profiling Data build phase script. - Add target dependency on libJavaScriptCore to JavaScriptCore. - Add JavaScriptCoreFramework.cpp source file to JavaScriptCore framework target. - Remove all items from "Link Binary with Libraries" for JavaScriptCore and jsc targets (except libedit.dylib on jsc) since this is handled via OTHER_LDFLAGS in xcconfig files now. * Source/JavaScriptCore/JavaScriptCoreFramework.cpp: Add. - Xcode requires at least one source file to compile to link a framework so create an empty one. Canonical link: https://commits.webkit.org/270226@main _______________________________________________ webkit-changes mailing list webkit-changes@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-changes