imkcat / CatCrypto

An easy way for hashing and encryption.
MIT License
69 stars 13 forks source link

Dynamically generate CommonCrypto module maps #5

Closed rajivshah3 closed 5 years ago

rajivshah3 commented 5 years ago

Added

Added script to dynamically generate CommonCrypto module maps if they don't exist.

This is based on https://stackoverflow.com/a/42852743/3188334

Instead of using pre-created module maps, this script will generate them at build time if needed. Since Xcode 10 includes the module maps for CommonCrypto, these will not be generated if they already exist. Also, dynamically generating the module maps allows users of the library to build with beta versions of Xcode or on CI providers that may have Xcode in a non-standard location, since paths like the one below are no longer hardcoded: https://github.com/ImKcat/CatCrypto/blob/4c3e6b389f80c3fb9d873e039b10cb69dbbde34e/Sources/ModuleMaps/CommonCrypto/iPhoneOS/module.modulemap#L2

This was tested on Xcode 10.2 beta and passes Travis CI tests for Xcode 10, but has not been tested on Xcode 9 (where these module maps are not already included in the SDK)

SimonasA commented 5 years ago

ping @ImKcat Trying to migrate to xcode10.2/swift5 and this seems to solve the problem

imkcat commented 5 years ago

@rajivshah3 Thanks for the contribution.