Skip to content

Commit

Permalink
Support configuring compile flags using Elixir config
Browse files Browse the repository at this point in the history
  • Loading branch information
dvic committed Jan 5, 2024
1 parent 5b9891b commit 0690da5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,17 @@ You can enable certain features by doing the following:
export EXQLITE_SYSTEM_CFLAGS=-DSQLITE_ENABLE_DBSTAT_VTAB=1
```

Or you can pass extra environment variables using the Elixir config:

```elixir
config :exqlite,
force_build: true,
make_env: %{
"EXQLITE_SYSTEM_CFLAGS" => "-DSQLITE_ENABLE_DBSTAT_VTAB=1",
"V" => "1"
}
```

### Listing Flags Used For Compilation

If you `export V=1` the flags used for compilation will be output to stdout.
Expand Down
1 change: 1 addition & 0 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ defmodule Exqlite.MixProject do
versions: ["2.15", "2.16", "2.17"],
availability: &target_available_for_nif_version?/2
],
make_env: Application.get_env(:exqlite, :make_env, %{}),
cc_precompiler: cc_precompiler(),
start_permanent: Mix.env() == :prod,
aliases: aliases(),
Expand Down

0 comments on commit 0690da5

Please sign in to comment.