-
Notifications
You must be signed in to change notification settings - Fork 8
/
mix.exs
124 lines (116 loc) · 3.04 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
defmodule Beaver.MixProject do
use Mix.Project
def project do
[
app: :beaver,
version: "0.4.1-dev",
elixir: "~> 1.12",
start_permanent: Mix.env() == :prod,
elixirc_paths: elixirc_paths(Mix.env()),
deps: deps(),
description: description(),
docs: docs(),
package: package(),
compilers: [:elixir_make] ++ Mix.compilers()
] ++
[
make_precompiler: {:nif, Kinda.Precompiler},
make_force_build: System.get_env("BEAVER_BUILD_CMAKE") in ["1", "true"],
make_precompiler_url:
System.get_env("BEAVER_ARTEFACT_URL") ||
"https://github.com/beaver-lodge/beaver-prebuilt/releases/download/2024-12-04-0908/@{artefact_filename}",
make_precompiler_nif_versions: [
versions: fn opts ->
target = opts.target
if String.contains?(target, "darwin") do
["2.17"]
else
["2.16", "2.17"]
end
end
],
make_args: ~w{-j},
make_cwd: "native"
]
end
defp description() do
"Beaver, a MLIR Toolkit in Elixir"
end
defp docs() do
[
main: "Beaver",
extras: [
"guides/your-first-beaver-compiler.livemd",
"CONTRIBUTING.md",
"README.md"
],
filter_modules: fn m, _meta ->
name = Atom.to_string(m)
not String.contains?(name, "Beaver.MLIR.CAPI.")
end,
api_reference: false,
groups_for_modules: [
DSL: [
Beaver,
Beaver.Env,
Beaver.Pattern,
Beaver.Slang,
~r"Beaver.Exterior.*",
Beaver.SSA
],
Utils: [
~r"Beaver.Walker.*",
~r"Beaver.Deferred.*",
~r"Beaver.Capturer.*",
~r"Beaver.Pass.*",
~r"Beaver.Printer.*",
~r"Beaver.Composer.*",
~r"Beaver.Sigils.*"
],
ENIF: [
~r"Beaver.ENIF.*"
],
MLIR: [
~r"Beaver.MLIR(?!\.Dialect).*"
],
Dialect: [
~r"Beaver.MLIR.Dialect.*"
],
Native: [
~r"Beaver.Native.*"
]
]
]
end
@external_files __DIR__ |> Path.join("external_files.txt") |> File.read!()
defp package() do
[
licenses: ["Apache-2.0", "MIT"],
links: %{"GitHub" => "https://github.com/beaver-lodge/beaver"},
files: ~w{
lib .formatter.exs mix.exs README*
checksum.exs
external_files.txt
#{@external_files}
}
]
end
def application do
[
mod: {Beaver.Application, []},
extra_applications: [:logger]
]
end
defp elixirc_paths(:dev), do: ~w{lib bench profile}
defp elixirc_paths(:test), do: ~w{lib bench profile test/support}
defp elixirc_paths(_), do: ["lib"]
defp deps do
[
{:elixir_make, "~> 0.4", runtime: false},
{:kinda, "~> 0.9.3"},
{:ex_doc, ">= 0.0.0", only: :dev, runtime: false},
{:benchee, "~> 1.0", only: :dev},
{:credo, "~> 1.7", only: [:dev, :test], runtime: false}
]
end
end