From f7c7d784c47179fcdfc77fde3dea8b3d4e4f9308 Mon Sep 17 00:00:00 2001 From: Badlop Date: Tue, 8 Feb 2022 15:38:04 +0100 Subject: [PATCH] Detect debug option, and maybe disable debug_info As explained in https://hexdocs.pm/mix/1.13.2/Mix.Tasks.Compile.Erlang.html > The option :debug_info is always added to the end of it. You can disable that using: > erlc_options: [debug_info: false] --- mix.exs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mix.exs b/mix.exs index a968477bf..ebf8699ba 100644 --- a/mix.exs +++ b/mix.exs @@ -78,7 +78,7 @@ defmodule Ejabberd.MixProject do defp erlc_options do # Use our own includes + includes from all dependencies includes = ["include"] ++ deps_include(["fast_xml", "xmpp", "p1_utils"]) - result = [:debug_info, {:d, :ELIXIR_ENABLED}] ++ + result = [{:d, :ELIXIR_ENABLED}] ++ cond_options() ++ Enum.map(includes, fn (path) -> {:i, path} end) ++ if_version_above('20', [{:d, :DEPRECATED_GET_STACKTRACE}]) ++ @@ -98,6 +98,8 @@ defmodule Ejabberd.MixProject do defp cond_options do for {:true, option} <- [{config(:sip), {:d, :SIP}}, {config(:stun), {:d, :STUN}}, + {config(:debug), :debug_info}, + {not config(:debug), {:debug_info, false}}, {config(:roster_gateway_workaround), {:d, :ROSTER_GATEWAY_WORKAROUND}}, {config(:new_sql_schema), {:d, :NEW_SQL_SCHEMA}} ], do: