Skip to content

Commit

Permalink
Elixir: Fix compiling ejabberd as a dependency (4128)
Browse files Browse the repository at this point in the history
  • Loading branch information
badlop committed Dec 25, 2023
1 parent f976440 commit a7d0ce7
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,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"])
includes = ["include", deps_include()]
result = [{:d, :ELIXIR_ENABLED}] ++
cond_options() ++
Enum.map(includes, fn (path) -> {:i, path} end) ++
Expand Down Expand Up @@ -118,16 +118,15 @@ defmodule Ejabberd.MixProject do
++ cond_deps()
end

defp deps_include(deps) do
base = if Mix.Project.umbrella?() do
defp deps_include() do
if Mix.Project.umbrella?() do
"../../deps"
else
case Mix.Project.deps_paths()[:ejabberd] do
nil -> "deps"
_ -> ".."
end
end
Enum.map(deps, fn dep -> base<>"/#{dep}/include" end)
end

defp cond_deps do
Expand Down

0 comments on commit a7d0ce7

Please sign in to comment.