From 0690da5081a03033038bd6a2c3b02123157e9fde Mon Sep 17 00:00:00 2001 From: dvic Date: Fri, 5 Jan 2024 13:01:59 +0100 Subject: [PATCH] Support configuring compile flags using Elixir config --- README.md | 11 +++++++++++ mix.exs | 1 + 2 files changed, 12 insertions(+) diff --git a/README.md b/README.md index 9f0e042..5dacb50 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/mix.exs b/mix.exs index db79d94..57ae8b8 100644 --- a/mix.exs +++ b/mix.exs @@ -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(),