Dynamically generate CommonCrypto module maps #5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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)