Define erlang macro at compile time in mix.exs

Hi,

I’m trying to build an existing Erlang project using mix.
I use an Erlang macro as a constant in multiple places in the project.
It is defined in my rebar.config as
{erl_opts, [ {d, 'DEFAULT_TIMEOUT', 30000} ]}.

Is it possible to do the same thing with mix?

def project do [erlc_options: [{:d, :DEFAULT_CALL_TIMEOUT, 30000}]] end
works

1 Like