Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

darwin: remove CoreFoundation dependency #898

Closed
wants to merge 1 commit into from
Closed

darwin: remove CoreFoundation dependency #898

wants to merge 1 commit into from

Conversation

bnoordhuis
Copy link
Contributor

Load the required symbols at run-time rather than linking against the
CoreFoundation (and CoreServices and ApplicationServices) frameworks
at build time.

Should make integration easier for people that bundle libuv with their
own projects because they no longer have to replicate magic -framework
incantations in their top-level build system.

Suggested reviewer: @indutny

Load the required symbols at run-time rather than linking against the
CoreFoundation (and CoreServices and ApplicationServices) frameworks
at build time.

Should make integration easier for people that bundle libuv with their
own projects because they no longer have to replicate magic -framework
incantations in their top-level build system.
@@ -94,6 +95,47 @@ struct uv__fsevents_event_s {
static void* uv__cf_loop_runner(void* arg);
static int uv__cf_loop_signal(uv_loop_t* loop, uv_fs_event_t* handle);

/* Lazy-loaded by uv__fsevents_global_init(). */
static CFArrayRef (*pCFArrayCreate)(CFAllocatorRef,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest moving this and other stuff to another file and including it in files that are using it. Though, you'll need to make them extern in order to do this. Will visibility hidden work for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it works and yes, the thought had crossed my mind. The thing is that darwin-proctitle.c also needs ApplicationServices. I'll think about it.

@bnoordhuis
Copy link
Contributor Author

I've landed this as-is for now in d48168a. I couldn't really come up with something that was significantly better than the approach in this PR, in particular because I don't want to load ApplicationServices unless absolutely necessary. I'll entertain patches. :-)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants