Skip to content

Commit

Permalink
Merge pull request #408 from sparklemotion/flavorjones-sqlite-compile…
Browse files Browse the repository at this point in the history
…time-options

ext: compile sqlite with WAL_SYNCHRONOUS=1 and --enable-fts5
  • Loading branch information
flavorjones committed Sep 22, 2023
2 parents 72e609e + fc607a8 commit 7b196ab
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# sqlite3-ruby Changelog

## next / unreleased

### Added

* Compile packaged sqlite3 with additional flags to explicitly enable FTS5, and set synchronous mode to normal when in WAL mode. [#408] (@flavorjones)


## 1.6.6 / 2023-09-12

### Dependencies
Expand Down
7 changes: 6 additions & 1 deletion ext/sqlite3/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,18 @@ def configure_system_libraries

def configure_packaged_libraries
minimal_recipe.tap do |recipe|
recipe.configure_options += ["--enable-shared=no", "--enable-static=yes"]
recipe.configure_options += [
"--enable-shared=no",
"--enable-static=yes",
"--enable-fts5",
]
ENV.to_h.tap do |env|
user_cflags = with_config("sqlite-cflags")
more_cflags = [
"-fPIC", # needed for linking the static library into a shared library
"-O2", # see https://github.com/sparklemotion/sqlite3-ruby/issues/335 for some benchmarks
"-fvisibility=hidden", # see https://github.com/rake-compiler/rake-compiler-dock/issues/87
"-DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1",
]
env["CFLAGS"] = [user_cflags, env["CFLAGS"], more_cflags].flatten.join(" ")
recipe.configure_options += env.select { |k,v| ENV_ALLOWLIST.include?(k) }
Expand Down

0 comments on commit 7b196ab

Please sign in to comment.