-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbundlex.exs
62 lines (58 loc) · 1.55 KB
/
bundlex.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
defmodule Membrane.PortAudio.BundlexProject do
use Bundlex.Project
def project() do
[
natives: natives()
]
end
defp natives() do
[
sink: [
interface: :nif,
deps: [membrane_common_c: [:membrane, :membrane_ringbuffer]],
sources: ["sink.c", "pa_helper.c"],
os_deps: [
portaudio: [
{:precompiled, Membrane.PrecompiledDependencyProvider.get_dependency_url(:portaudio)},
{:pkg_config, "portaudio-2.0"}
]
],
preprocessor: Unifex
],
source: [
interface: :nif,
deps: [membrane_common_c: :membrane],
sources: ["source.c", "pa_helper.c"],
os_deps: [
portaudio: [
{:precompiled, Membrane.PrecompiledDependencyProvider.get_dependency_url(:portaudio)},
{:pkg_config, "portaudio-2.0"}
]
],
preprocessor: Unifex
],
pa_devices: [
interface: :nif,
sources: ["pa_devices.c"],
os_deps: [
portaudio: [
{:precompiled, Membrane.PrecompiledDependencyProvider.get_dependency_url(:portaudio)},
{:pkg_config, "portaudio-2.0"}
]
],
preprocessor: Unifex
]
] ++ os_specific(Bundlex.get_target())
end
defp os_specific(%{os: "darwin" <> _rest}) do
[
osx_permissions: [
interface: :nif,
sources: ["osx_permissions.m"],
libs: ["objc"],
linker_flags: ["-framework AVFoundation"]
]
]
end
defp os_specific(_target), do: []
end