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

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.