-
Notifications
You must be signed in to change notification settings - Fork 330
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
Static library will not have any monitor type available #142
Comments
I'm also stuck with this issue: monitors are not detected in statically built fswatch binary (Ubuntu).
by
Notice the |
I had to do something similar for OS X as of commit c7d8949
I changed |
I agree this is complexity that does not pay us back with any meaningful advantage: I'm removing the monitor registration logic. |
It has been closed in |
The way that monitor types are registered will not work with static libraries. The technique of creating a static object and inserting code in its constructor does not work with static libraries because the linker will discard any symbol that is not used, since no symbol from the file that contains the static constructor is used, the linker assumes it is safe to remove the static construtor at all.
In other projects I've noticed that just by injecting a fake dependency to any function of the file that contains the static constructor will force the linker to include the static constructor. But you would lose the conveniency of easily inserting new monitors to the project.
IMHO I don't think auto registrar should be used at all.
The text was updated successfully, but these errors were encountered: