Frameworks and library dependencies

I have a framework, which depends on a library (GPGME) to do its actual encryption. As a consequence of using this external library, there are header files which have GPGME types in them...


@interface E3Gpgme : NSObject
...
/*****************************************************************************\
|* Call GPGME to sign
\*****************************************************************************/
- (int) signWithMode:(gpgme_sig_mode_t)mode
              userId:(NSString *)signingKeyOrEmail
           srcStream:(E3Stream *)src
           dstStream:(E3Stream *)dst
               error:(NSError **)error;
...
@end

.

This means the E3Gpgme class header file has to #import <gpgme.h> to get those type definitions.

That is then proving problematic because the framework modularisation fails, with <e3gpgme.h> obviously not being a part of the framework, so the project refuses to build.

I can see a few ways around this:

  • Just don't run the modularisation check. That doesn't sound like a fantastic option
  • import the GPGME headers (there's only 2) into the project and bundle them as if they were project ones. Again, not a great option, I don't expect GPGME to change its API but it runs the risk of there being a mismatch in future if the library code itself remains external.

So what's the best-practice for requiring a dependency on a library, not a framework ? Is there a way to copy the library binary into a folder inside the framework folder and make sure you link with that ? Assuming that's the shared library it ought to still be ok for the LGPL licensing...

Is there a better way ? I'm sure I'm not the first person to run into this :)

Frameworks and library dependencies
 
 
Q