3

I have a private pod written on top of CommonCrypto which explicitly relies on CommonCrypto. Headers have types declared by CommonCrypto like:

#include <CommonCrypto/CommonDigest.h>

typedef CC_SHA256_CTX qwer_digest_evp;

Since CC_SHA256_CTX is declared in CommonCrypto, I can't simply move the header import into implementation file.

I use cocoapods to integrate this pod into my project, and tried the below post install hook, but it didn't work (picked from SO ).

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      target.build_settings(config.name)['CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES'] = 'YES'
    end
  end
end
Ayush Goel
  • 3,134
  • 27
  • 36

1 Answers1

0

An effective option might be to build a module version of CommonCrypto (maybe with added CocoaPods magic). This can be done by following the steps in the answer to Importing CommonCrypto in a Swift framework. The solution functions just as well with Objective-C or C in your Xcode project.

To quote the answer:

I've added some CocoaPods magic to jjrscott's answer in case you need to use CommonCrypto in your CocoaPods library.

jjrscott
  • 1,386
  • 12
  • 16