Skip to content
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

Frameworks too ? #52

Open
ThrudTheBarbarian opened this issue Dec 12, 2024 · 1 comment
Open

Frameworks too ? #52

ThrudTheBarbarian opened this issue Dec 12, 2024 · 1 comment

Comments

@ThrudTheBarbarian
Copy link

More of a question than an issue. Is it possible to deal with frameworks ? Or is that a step too far. I’m assuming that with Windows wanting DLLs in the same directory as the executable, it might be a bit difficult…

Just wondering how i should structure my Mac app so it has the best chance of easily being transported over.

@triplef
Copy link
Member

triplef commented Dec 13, 2024

Good question, I think you’re right that a macOS-style framework layout probably won’t work (at least out of the box) because the DLLs won’t be found. I never tried though, if you do please let us know. Also, @rfm do you maybe have any knowledge of what should or won’t work in terms of frameworks on Windows?

You should be able to put the framework DLL next to your .exe though. One thing that I think won’t work is [NSBundle bundleForClass:] in a class that is defined in the framework, although maybe it will look in the Resources/<framework-name> folder (if not that’s probably something that could be fixed).

In our app we just replaced -bundleForClass: with something like [[NSBundle bundleWithPath:[NSBundle.mainBundle pathForResource:@"<framework>" ofType:@"bundle"]] and put an extra framework bundle in Resources/<exe-name>/<framework>.bundle.

In our case we also let CMake build all our (internal) frameworks into the executable (using CMake object libraries for the frameworks), so there’s no extra DLLs to be loaded.

Hope that helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants