-
Notifications
You must be signed in to change notification settings - Fork 2
/
bundlex.exs
51 lines (46 loc) · 1.41 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
defmodule Membrane.Agora.BundlexProject do
use Bundlex.Project
def project do
[
natives: natives(Bundlex.get_target())
]
end
defp natives(%{architecture: "x86_64", os: "linux"}) do
unless System.get_env("AGORA_SDK_PRESENT") == "true", do: System.shell("./install.sh")
[
sink: [
sources: ["sink.cpp", "connection_observer.cpp"],
includes: ["agora_sdk/include/"],
libs: ["agora_rtc_sdk", "agora-ffmpeg"],
lib_dirs: ["agora_sdk/"],
deps: [unifex: :unifex],
interface: [:nif],
preprocessor: Unifex,
language: :cpp
],
source: [
sources: [
"source.cpp",
"connection_observer.cpp",
"source/sample_audio_frame_observer.cpp",
"source/sample_video_encoded_frame_observer.cpp",
"source/sample_local_user_observer.cpp"
],
includes: ["agora_sdk/include/"],
libs: ["agora_rtc_sdk", "agora-ffmpeg"],
lib_dirs: ["agora_sdk/"],
deps: [unifex: :unifex],
interface: [:nif],
preprocessor: Unifex,
language: :cpp
]
]
end
defp natives(platform) do
IO.warn("Agora's Server Gateway SDK is unavailable for this target: #{inspect(platform)}")
[
sink: [sources: ["noop.cpp"], interface: [:nif], language: :cpp],
source: [sources: ["noop.cpp"], interface: [:nif], language: :cpp]
]
end
end