summaryrefslogtreecommitdiffstats
path: root/dom/media/webrtc/third_party_build/webrtc.mozbuild
diff options
context:
space:
mode:
Diffstat (limited to 'dom/media/webrtc/third_party_build/webrtc.mozbuild')
-rw-r--r--dom/media/webrtc/third_party_build/webrtc.mozbuild48
1 files changed, 48 insertions, 0 deletions
diff --git a/dom/media/webrtc/third_party_build/webrtc.mozbuild b/dom/media/webrtc/third_party_build/webrtc.mozbuild
new file mode 100644
index 0000000000..940420e3f8
--- /dev/null
+++ b/dom/media/webrtc/third_party_build/webrtc.mozbuild
@@ -0,0 +1,48 @@
+# -*- 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/.
+
+# This file mimics the defines used by any headers in libwebrtc that get
+# included in Mozilla code.
+# We currently audit these by hand. Searching for the defines upstream is a good
+# start:
+# https://source.chromium.org/search?q=usage:%23if.*def.*%5B%5E_%5D$%20AND%20path:%5C.h%20AND%20path:%5Ethird_party%2Fwebrtc&ss=chromium
+
+if CONFIG["MOZ_WEBRTC"]:
+ DEFINES["HAVE_UINT64_T"] = True
+ DEFINES["WEBRTC_MOZILLA_BUILD"] = True
+ DEFINES["RTC_ENABLE_VP9"] = True
+
+ if CONFIG["OS_TARGET"] != "WINNT":
+ DEFINES["WEBRTC_POSIX"] = True
+ DEFINES["WEBRTC_BUILD_LIBEVENT"] = True
+
+ if CONFIG["OS_TARGET"] == "Linux":
+ DEFINES["WEBRTC_LINUX"] = True
+ if (
+ CONFIG["TARGET_CPU"] == "x86"
+ or CONFIG["TARGET_CPU"] == "x86_64"
+ or CONFIG["TARGET_CPU"] == "arm"
+ or CONFIG["TARGET_CPU"] == "aarch64"
+ or (
+ CONFIG["TARGET_ENDIANNESS"] == "little"
+ and CONFIG["TARGET_CPU"].startswith("mips")
+ )
+ ):
+ DEFINES["WEBRTC_USE_PIPEWIRE"] = True
+ elif CONFIG["OS_TARGET"] == "Darwin":
+ DEFINES["WEBRTC_MAC"] = True
+ elif CONFIG["OS_TARGET"] == "WINNT":
+ DEFINES["WEBRTC_WIN"] = True
+ DEFINES["RTC_ENABLE_WIN_WGC"] = True
+ DEFINES["HAVE_WINSOCK2_H"] = True
+ elif CONFIG["OS_TARGET"] in ("DragonFly", "FreeBSD", "NetBSD", "OpenBSD"):
+ DEFINES["WEBRTC_BSD"] = True
+ elif CONFIG["OS_TARGET"] == "Android":
+ DEFINES["WEBRTC_LINUX"] = True
+ DEFINES["WEBRTC_ANDROID"] = True
+
+ if CONFIG["MOZ_X11"]:
+ DEFINES["WEBRTC_USE_X11"] = True