Convert dynamic library project to loadable bundle?

Hi!

I've been trying for days without any success to convert a JUCE dynamic library project into a loadable bundle format.

I changed the Mach-O type to "bundle", but XCode complains with "-bundle flag cannot be used with -dynamiclib", and I cannot find any way to change this manually anywhere.

Any suggestion?

Thanks!

We've never looked into how bundles work or how they're created - since juce focuses on cross-platform stuff, it's not really on our roadmap to support something so specific. But if you research it further and find any simple changes to the introjucer that would make it possible, then do let us know.

To turn a library into a bundle I think the following should work:

To the extra linker flags add:
-bundle

To the Custom Xcode flags of each configuration add:
MACH_O_TYPE=mh_bundle,DYLIB_COMPATIBILITY_VERSION="",DYLIB_CURRENT_VERSION="",WRAPPER_EXTENSION=bundle,DYLIB_INSTALL_NAME_BASE="",GENERATE_PKGINFO_FILE=YES,LD_DYLIB_INSTALL_NAME="",EXECUTABLE_EXTENSION="",PACKAGE_TYPE=com.apple.package-type.wrapper


This isn't perfect as the xcode project will still show the icon as a library, and it won't link to the correct product. However I think you could approach it from a different angle, given that a plug-in is a bundle you could start with an audio plug-in and work backwords. Disable all the plug-in formats and use the Custom Xcode flags to set things to a more normal state, i.e. no need for all the rez stuff etc. Have a browse through the build settings in Xcode to see what you don't need.