Skip to content

Commit 5fb8f0f

Browse files
committed
depends: Do not override CFLAGS when building SQLite with DEBUG=1
The `--enable-debug` configure option for the SQLite package does two things. It adds three preprocessor definitions and overrides CFLAGS with "-g -O0". The latter breaks the user's ability to provide sanitizer and LTO flags.
1 parent 2b0dd88 commit 5fb8f0f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

depends/packages/sqlite.mk

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ $(package)_config_opts_linux=--with-pic
1111
$(package)_config_opts_freebsd=--with-pic
1212
$(package)_config_opts_netbsd=--with-pic
1313
$(package)_config_opts_openbsd=--with-pic
14-
$(package)_config_opts_debug=--enable-debug
14+
# We avoid using `--enable-debug` because it overrides CFLAGS, a behavior we want to prevent.
15+
$(package)_cflags_debug += -g
16+
$(package)_cppflags_debug += -DSQLITE_DEBUG
1517
$(package)_cppflags+=-DSQLITE_DQS=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_OMIT_DEPRECATED
1618
$(package)_cppflags+=-DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_JSON -DSQLITE_LIKE_DOESNT_MATCH_BLOBS
1719
$(package)_cppflags+=-DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_AUTOINIT

0 commit comments

Comments
 (0)