Syphon-Framework icon indicating copy to clipboard operation
Syphon-Framework copied to clipboard

Static library export

Open benkuper opened this issue 2 years ago • 7 comments

Hello, could it be possible to have the xcode project have a static library exporter ? Frameworks are not so nice to work with in some cases (trying to implement Syphon in my juce_sharedtexture custom JUCE module but custom frameworks in relative path inside modules is not so good).

I tried adding a static library exporter but I don't see any exported .a file... is it something possible to add officially ?

thank you

benkuper avatar May 02 '23 19:05 benkuper

We can certainly consider it.

What problems are you having linking the framework?

bangnoise avatar May 02 '23 21:05 bangnoise

Let's say it's way easier to link a static library than a framework in some contexts. I'm using the JUCE framework, and I'm creating a juce custom module. Right now the way juce modules work doesn't allow for custom framework relative path declaration. You can do it from the main project but not from the custom module definition. I also posted on the JUCE forum as it is clearly something to improve on their side as well. But for better integration and ease of use, I think having a static library + single header file would be very handy for people

benkuper avatar May 03 '23 05:05 benkuper

Without more information (or knowledge of JUCE) it's hard to give any advice. Can't you add the necessary -rpath option to the linker command (or Xcode's Runpath Search Paths setting if it's an Xcode project)? An alternative but slightly less practical solution would be to use install_name_tool to make whatever modifications are necessary to your built binaries.

bangnoise avatar May 03 '23 07:05 bangnoise

All of this is possible from the main system. I'm looking to create a module (like a plugin) that would be portable to any project, and wouldn't require developers to modify their compilation settings to have it work. I already have made several plugins using static libraries that work well and that anybody can just use. Right now, JUCE doesn't provide a mean to include custom framework in their custom module system. I think the main fix should come from JUCE, but it's a symptom of different systems handling frameworks or static libs better than the other.

benkuper avatar May 03 '23 08:05 benkuper

Also, I tried modifying the xcode project to output a static lib, it showed build success but could find any .a file anywhere. I'm not very skilled in Xcode stuff, mainly working on Windows.

benkuper avatar May 03 '23 08:05 benkuper

Plugins having to bundle resources is a very common scenario (not just libraries or frameworks, but UI components, data files, etc) - I'm surprised JUCE requires they be a single file.

You could maybe compile the necessary Syphon classes directly into your project if you're really stuck - maybe.

bangnoise avatar May 03 '23 08:05 bangnoise

JUCE doesn't require single file, it's very flexible. It's just a missing spot in the custom juce module development, that not a lot of people create.

Compiling the classes directly in the project was my initial take but it brings a world of pain with class name and types conflicts...

benkuper avatar May 03 '23 08:05 benkuper

I'll close this now as the framework is working quite good and I'll manage in Juce to have custom framework inside custom modules.

benkuper avatar Jul 03 '24 09:07 benkuper