pinterest / PINCache

Fast, non-deadlocking parallel object cache for iOS, tvOS and OS X
Apache License 2.0
2.66k stars 361 forks source link

Disable asserts in release builds when using Swift Package Manager #313

Closed rcancro closed 2 years ago

rcancro commented 2 years ago

When using Swift Package Manager to integrate PINCache into an app, Xcode does not automatically set NS_BLOCK_ASSERTIONS to 1 when building the package in release. This means that any NSAsserts that are hit in release cause crashes. This appears to only be an issue with ObjC packages.

The change I've made is to Package.swift to set NS_BLOCK_ASSERTIONS to 1 when building in release.

(Note: I didn't actually hit an assert in this PINCache, but the possibility is there)