Commit be91294
fix(android): let user sqliteFlags override performanceMode defaults
User-supplied sqliteFlags from package.json could not override flags set by
performanceMode on Android. The performance flags went through gradle cFlags
(landing in CMAKE_C_FLAGS, late on the clang command line) while user flags
went through CMake add_definitions (sorted alphabetically, early on the
command line). clang's last-define-wins rule then made the performance
defaults authoritative.
Route both library defaults (performanceMode, fts5, rtree) and user
sqliteFlags through CMake add_compile_options, with defaults declared first
and user flags last. add_compile_options preserves declaration order
(unlike add_definitions, which CMake sorts before emitting), so the user
override is guaranteed to win on the clang command line.
Verified against the example app: with no user flags, -DSQLITE_DQS=0 still
appears; with "sqliteFlags": "-DSQLITE_DQS=3 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=0",
both override flags appear after their defaults in the generated
compile_commands.json.
iOS already had override semantics via the podspec appending sqliteFlags
after optimizedCflags; this aligns Android with iOS behavior.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent e7dd159 commit be91294
3 files changed
Lines changed: 28 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
22 | 30 | | |
23 | 31 | | |
24 | | - | |
25 | | - | |
26 | | - | |
| 32 | + | |
| 33 | + | |
27 | 34 | | |
28 | 35 | | |
29 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
132 | 148 | | |
133 | 149 | | |
134 | 150 | | |
| |||
159 | 175 | | |
160 | 176 | | |
161 | 177 | | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | 178 | | |
172 | 179 | | |
173 | 180 | | |
| |||
192 | 199 | | |
193 | 200 | | |
194 | 201 | | |
| 202 | + | |
195 | 203 | | |
196 | 204 | | |
197 | 205 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
| 83 | + | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| |||
0 commit comments