Skip to content

Commit

Permalink
ext: compile sqlite with WAL_SYNCHRONOUS=1 and --enable-fts5
Browse files Browse the repository at this point in the history
  • Loading branch information
flavorjones committed Sep 16, 2023
1 parent 21acdca commit 2a161ad
Showing 1 changed file with 6 additions and 1 deletion.
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 2a161ad

Please sign in to comment.