-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build static library for JavaScriptCore before linking framework #19575
Build static library for JavaScriptCore before linking framework #19575
Conversation
EWS run on previous version of this PR (hash 4ddd321) |
4ddd321
to
52c04d1
Compare
EWS run on previous version of this PR (hash 52c04d1) |
Source/JavaScriptCore/Configurations/Base-JavaScriptCore.xcconfig
Outdated
Show resolved
Hide resolved
Source/JavaScriptCore/Configurations/libJavaScriptCore.xcconfig
Outdated
Show resolved
Hide resolved
52c04d1
to
11c3a5b
Compare
EWS run on previous version of this PR (hash 11c3a5b) |
11c3a5b
to
8478aa3
Compare
Updated PR to include feedback from @emw-apple. |
EWS run on current version of this PR (hash 8478aa3) |
EWS run on previous version of this PR (hash 8478aa3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r+ with a couple fixups. Looks great!
8478aa3
to
999fdfb
Compare
EWS run on current version of this PR (hash 999fdfb) |
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
999fdfb
to
3d73290
Compare
Committed 270226@main (3d73290): https://commits.webkit.org/270226@main Reviewed commits have been landed. Closing PR #19575 and removing active labels. |
3d73290
999fdfb