[webkit-dev] OSX: Linking to custom build resorts to system version...

Dan Bernstein mitz at apple.com
Sat Nov 28 19:39:07 PST 2015

> On Nov 11, 2015, at 2:06 AM, Nikolay Tsenkov <nikolay at tsenkov.net> wrote:
> Hello,
> First of all, thanks for the awesome OSS software that WebKit is!
> I need some help with linking to a fresh build of WebKit.framework on OS X:
>  - I am building a modified version of WebKit.framework (my changes are in WebCore and WebKit projects) on OS X 10.11, but I am not able to use that framework in another project - somehow the project always resorts to the default system WebKit.framework.
> Setup:
>  - OS X 10.11.0 (just saw there is 10.11.1 available, but haven’t installed it yet)
>  - System Integrity Protection (SIP) disabled (I couldn’t build when ON)
> Changes:
>  - (Gist) I am making a version of the WebView (the legacy one, the single-process model) which can be used in DAW plugin, exposing API for rendering the audio, settings the sampling rate, not rendering to the audio hardware directly, etc.
>  - (Specific)
> 	 - (WebCore) -Replaced- AudioDestinationMac with AudioDestinationDaw;
> 	 - (WebCore) -Add- DawStateSingleton which exposes the custom destination node to the WebView;
> 	 - (WebKit) -Modify- WebView to include a new constructor and couple of new methods:
> - (instancetype)initWithFrame:(NSRect)frame samplingRate:(float)samplingRate frameName:(NSString *)frameName groupName:(NSString *)groupName;
> - (void)setDawSamplingRate:(float)samplingRate;
> - (void)renderAudio:(int) numberOfFrames bufferList:(AudioBufferList*) bufferList;
> In a new project, I am trying to use the new WebView. If I don’t link to WebKit.framework, of course, the build fails because it can’t find the framework. But if I link to the custom build (the WebView header is the new one, I’ve checked) in run time the app breaks with “-[WebView initWithFrame:samplingRate:frameName:groupName:]: unrecognized selector sent to instance” from which I infer it’s using the system version of the WebView.
> I’ve tried to inspect how the MiniBrowser project correctly is referring to the new build, but I don’t see how the linking is happening…
> Could someone help me out with this?
> Please, accept my apologies, if there is something simple that I’ve missed.

The most common way to get your executable to pick up your custom built WebKit instead of the system WebKit is to have your executable run with the DYLD_FRAMEWORK_PATH environment variable set to the the path where your built frameworks are. The run-webkit-app script in Tools/Scripts does this. Or if you’re running your up from within Xcode you can set the environment variable for the Run action in the scheme editor. There are a few other ways to get the environment variable set, and some other ways to get your program to pick up your framework, but I think the above should give you a good start.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-dev/attachments/20151128/71d57bbf/attachment.html>

More information about the webkit-dev mailing list