Define NDEBUG for release builds of the SQLCipher C target - #20
Merged
Conversation
SwiftPM does not define NDEBUG for C targets even in release configuration, so sqlite3.c ships with its internal assert()s enabled — SQLite documents roughly a 3x overhead with assertions on. The autoconf and CMake builds of SQLCipher both compile with NDEBUG in production; this brings the SwiftPM build in line, gated on .release so debug builds keep the asserts.
|
Thank you for your pull request and welcome to the Skip community. We require contributors to sign our contributor license agreement (CLA), and we don't seem to have the user(s) @GoodOlClint on file. In order for us to review and merge your code, for each noted user please add your GitHub username to Skip's .clabot file |
Member
|
Great improvement, thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
SwiftPM does not define
NDEBUGfor C targets even in-c releasebuilds, sosqlite3.ccompiles with its internalassert()s enabled — SQLite documents ~3x overhead with assertions on (sqlite.org/compile.html). The autoconf/CMake builds of SQLCipher defineNDEBUGin production; this one-liner brings the SwiftPM build in line, gated on.when(configuration: .release)so debug builds keep the asserts.Verified:
swift build --target SQLCipher(debug) andswift build -c release --target SQLCipherboth green on macOS 15 / Swift 6.1.(Found while adopting swift-sqlcipher as the store engine for a macOS daemon — thanks for maintaining this packaging, it replaced our hand-vendored amalgamation outright.)