Skip to content

Define NDEBUG for release builds of the SQLCipher C target - #20

Merged
marcprux merged 1 commit into
skiptools:mainfrom
GoodOlClint:ndebug-release
Jul 30, 2026
Merged

Define NDEBUG for release builds of the SQLCipher C target#20
marcprux merged 1 commit into
skiptools:mainfrom
GoodOlClint:ndebug-release

Conversation

@GoodOlClint

Copy link
Copy Markdown
Contributor

SwiftPM does not define NDEBUG for C targets even in -c release builds, so sqlite3.c compiles with its internal assert()s enabled — SQLite documents ~3x overhead with assertions on (sqlite.org/compile.html). The autoconf/CMake builds of SQLCipher define NDEBUG in 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) and swift build -c release --target SQLCipher both 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.)

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.
@cla-bot

cla-bot Bot commented Jul 30, 2026

Copy link
Copy Markdown

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

@marcprux
marcprux merged commit 232d8d3 into skiptools:main Jul 30, 2026
5 of 6 checks passed
@marcprux

Copy link
Copy Markdown
Member

Great improvement, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants