-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmix.exs
90 lines (82 loc) · 2.19 KB
/
mix.exs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
defmodule Exrdkafka.MixProject do
use Mix.Project
@version "0.1.0"
@github_url "https://github.com/jsvitolo/exrdkafka"
def project do
[
app: :exrdkafka,
version: @version,
elixir: "~> 1.14",
start_permanent: Mix.env() == :prod,
deps: deps(),
# Configuração do elixir_make
compilers: [:elixir_make] ++ Mix.compilers(),
make_clean: ["clean"],
make_targets: ["all"],
make_cwd: ".",
make_env: %{"MIX_ENV" => "#{Mix.env()}"},
# Configuração para pré-compilação
make_precompiler: {:nif, CCPrecompiler},
make_precompiler_url: "#{@github_url}/releases/download/v#{@version}/@{artefact_filename}",
make_precompiler_filename: "exrdkafka_nif",
make_precompiler_priv_paths: ["exrdkafka_nif.*"],
# Configuração do cc_precompiler
cc_precompile: [
compilers: %{
{:unix, :linux} => %{
"x86_64-linux-gnu" => "x86_64-linux-gnu-",
"aarch64-linux-gnu" => "aarch64-linux-gnu-",
},
{:unix, :darwin} => %{
"x86_64-apple-darwin" => {
"gcc",
"g++",
"<%= cc %> -arch x86_64",
"<%= cxx %> -arch x86_64"
},
"aarch64-apple-darwin" => {
"gcc",
"g++",
"<%= cc %> -arch arm64",
"<%= cxx %> -arch arm64"
}
},
{:win32, :nt} => %{
"x86_64-windows-msvc" => {"cl", "cl"}
}
}
]
]
end
def application do
[
extra_applications: [:logger],
mod: {Exrdkafka.Application, []}
]
end
defp deps do
[
{:esq, "~> 2.0"},
{:jason, "~> 1.4"},
{:elixir_make, "~> 0.8", runtime: false},
{:cc_precompiler, "~> 0.1.0", runtime: false, github: "cocoa-xu/cc_precompiler"}
]
end
def package do
[
files: [
"lib",
"c_src",
"Makefile",
"mix.exs",
"README.md",
"LICENSE",
"checksum.exs",
"VERSION"
],
description: "Elixir Kafka client NIF for librdkafka",
licenses: ["MIT"],
links: %{"GitHub" => @github_url}
]
end
end