summaryrefslogtreecommitdiffstats
path: root/dom/media/webrtc/moz.build
blob: cb8e363faa0a24fa4acb978f6857cd148ce112a2 (plain)
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
125
126
127
128
129
130
131
132
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
include("/dom/media/webrtc/third_party_build/webrtc.mozbuild")

with Files("**"):
    BUG_COMPONENT = ("Core", "WebRTC: Audio/Video")

with Files("PeerIdentity.*"):
    BUG_COMPONENT = ("Core", "WebRTC: Signaling")

with Files("common/**"):
    BUG_COMPONENT = ("Core", "WebRTC: Signaling")
with Files("jsep/**"):
    BUG_COMPONENT = ("Core", "WebRTC: Signaling")
with Files("libwebrtcglue/**"):
    BUG_COMPONENT = ("Core", "WebRTC: Signaling")
with Files("transportbridge/**"):
    BUG_COMPONENT = ("Core", "WebRTC: Signaling")
with Files("jsapi/**"):
    BUG_COMPONENT = ("Core", "WebRTC: Signaling")
with Files("sdp/**"):
    BUG_COMPONENT = ("Core", "WebRTC: Signaling")
with Files("third_party_build/**"):
    BUG_COMPONENT = ("Core", "WebRTC")


EXPORTS += [
    "CubebDeviceEnumerator.h",
    "MediaEngine.h",
    "MediaEngineFake.h",
    "MediaEnginePrefs.h",
    "MediaEngineSource.h",
    "MediaTrackConstraints.h",
    "SineWaveGenerator.h",
]

SOURCES += [
    "CubebDeviceEnumerator.cpp",
]

if CONFIG["MOZ_WEBRTC"]:
    EXPORTS += [
        "MediaEngineRemoteVideoSource.h",
        "MediaEngineWebRTC.h",
        "MediaEngineWebRTCAudio.h",
    ]
    EXPORTS.mozilla.dom += ["RTCIdentityProviderRegistrar.h"]
    UNIFIED_SOURCES += [
        "MediaEngineRemoteVideoSource.cpp",
        "MediaEngineWebRTCAudio.cpp",
        "RTCCertificate.cpp",
        "RTCIdentityProviderRegistrar.cpp",
    ]
    # MediaEngineWebRTC.cpp needs to be built separately.
    SOURCES += [
        "MediaEngineWebRTC.cpp",
    ]
    PREPROCESSED_IPDL_SOURCES += [
        "PWebrtcGlobal.ipdl",
    ]
    LOCAL_INCLUDES += [
        "..",
        "/dom/base",
        "/dom/media",
        "/dom/media/webrtc/common",
        "/dom/media/webrtc/common/browser_logging",
        "/media/libyuv/libyuv/include",
        "/third_party/libwebrtc",
        "/third_party/libwebrtc/third_party/abseil-cpp",
    ]

if CONFIG["MOZ_WEBRTC_SIGNALING"]:
    DIRS += [
        "common",
        "jsapi",
        "jsep",
        "libwebrtcglue",
        "sdp",
        "transportbridge",
        "/third_party/libwebrtc",
    ]

    if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
        DIRS += [
            "/third_party/drm/",
            "/third_party/drm/libdrm",
            "/third_party/gbm/",
            "/third_party/gbm/libgbm",
            "/third_party/libepoxy/",
            "/third_party/pipewire/libpipewire",
        ]

    # Avoid warnings from third-party code that we can not modify.
    if CONFIG["CC_TYPE"] == "clang-cl":
        CXXFLAGS += ["-Wno-invalid-source-encoding"]


PREPROCESSED_IPDL_SOURCES += [
    "PMediaTransport.ipdl",
]

UNIFIED_SOURCES += [
    "MediaEngineFake.cpp",
    "MediaEngineSource.cpp",
    "MediaTrackConstraints.cpp",
    "PeerIdentity.cpp",
]

EXPORTS.mozilla += [
    "PeerIdentity.h",
]
EXPORTS.mozilla.dom += [
    "RTCCertificate.h",
]

include("/ipc/chromium/chromium-config.mozbuild")

# Suppress some GCC/clang warnings being treated as errors:
#  - about attributes on forward declarations for types that are already
#    defined, which complains about important MOZ_EXPORT attributes for
#    android API types
CXXFLAGS += [
    "-Wno-error=attributes",
]

FINAL_LIBRARY = "xul"

# Add libFuzzer configuration directives
include("/tools/fuzzing/libfuzzer-config.mozbuild")