pinterest / PINOperation

Apache License 2.0
103 stars 49 forks source link

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

Closed rcancro closed 2 years ago

rcancro commented 2 years ago

When using Swift Package Manager to integrate PINOperation 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 PINOperation, but the possibility is there)