Bug 1824170: Reduce our opportunities for merge conflicts around pipewire build config. r=mjf,ng,webrtc-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D173588
This commit is contained in:
Byron Campen 2023-03-28 13:15:36 +00:00
parent 7511950acd
commit f0d6d76a43
11 changed files with 267 additions and 44 deletions

View file

@ -288,10 +288,9 @@ if (rtc_include_tests) {
}
}
if (!build_with_mozilla) {
if (is_linux || is_chromeos) {
if (rtc_use_pipewire) {
defines = [ "WEBRTC_USE_PIPEWIRE" ]
if (!build_with_mozilla) {
pkg_config("gio") {
packages = [
"gio-2.0",
@ -305,9 +304,7 @@ if (is_linux || is_chromeos) {
ignore_libs = true
}
}
}
if (!build_with_mozilla) {
pkg_config("gbm") {
packages = [ "gbm" ]
}
@ -321,12 +318,10 @@ if (!build_with_mozilla) {
pkg_config("libdrm") {
packages = [ "libdrm" ]
}
}
if (!rtc_link_pipewire) {
# When libpipewire is not directly linked, use stubs to allow for dlopening of
# the binary.
if (!build_with_mozilla) {
generate_stubs("pipewire_stubs") {
configs = [
"../../:common_config",
@ -344,13 +339,10 @@ if (!build_with_mozilla) {
macro_deps = [ "../../rtc_base/system:no_cfi_icall" ]
}
}
}
}
config("pipewire_config") {
if (!build_with_mozilla) {
defines = [ "WEBRTC_USE_PIPEWIRE" ]
}
defines = [ "WEBRTC_USE_PIPEWIRE" ]
if (!rtc_link_pipewire) {
defines += [ "WEBRTC_DLOPEN_PIPEWIRE" ]
}
@ -364,11 +356,11 @@ if (!build_with_mozilla) {
}
}
}
} # !build_with_mozilla
rtc_library("desktop_capture") {
visibility = [ "*" ]
defines = []
include_dirs = []
deps = []
public_configs = [ ":x11_config" ]
sources = [
@ -603,11 +595,6 @@ rtc_library("desktop_capture") {
}
deps += [ "//third_party/libyuv" ]
if (build_with_mozilla) {
include_dirs += [
"/third_party/pipewire",
]
}
if (use_desktop_capture_differ_sse2) {
deps += [ ":desktop_capture_differ_sse2" ]
@ -642,18 +629,11 @@ rtc_library("desktop_capture") {
]
if (build_with_mozilla) {
include_dirs += [
"/gfx/angle/checkout/include",
"/third_party/drm/drm",
"/third_party/drm/drm/include",
"/third_party/drm/drm/include/libdrm",
"/third_party/drm/libdrm",
"/third_party/gbm/gbm",
"/third_party/libepoxy/libepoxy/include",
]
}
if (!build_with_mozilla) {
deps += ["//third_party/pipewire",
"//third_party/drm",
"//third_party/gbm",
"//third_party/libepoxy"]
} else { # build_with_mozilla else !build_with_mozilla
configs += [
":gio",
":pipewire",
@ -662,27 +642,13 @@ rtc_library("desktop_capture") {
":epoxy",
":libdrm",
]
}
if (!rtc_link_pipewire) {
if (!build_with_mozilla) {
deps += [ ":pipewire_stubs" ]
}
if (!build_with_mozilla) {
configs += [
":gio",
":pipewire",
]
} else {
defines += [ "WEBRTC_USE_PIPEWIRE" ]
include_dirs += [ "/third_party/pipewire" ]
}
}
if (!build_with_mozilla) {
public_configs += [ ":pipewire_config" ]
}
public_configs += [ ":pipewire_config" ]
} # !build_with_mozilla
deps += [ "../../rtc_base:sanitizer" ]
}

View file

@ -0,0 +1,30 @@
# -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
# vim: set ts=8 sts=2 et sw=2 tw=80:
#
# Copyright 2023 Mozilla Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("../../webrtc.gni")
config("drm_include_config") {
include_dirs = [
"/third_party/drm/drm",
"/third_party/drm/drm/include",
"/third_party/drm/drm/include/libdrm",
]
}
rtc_library("drm") {
public_configs = [ ":drm_include_config" ]
}

View file

@ -0,0 +1,23 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
* vim: set ts=8 sts=2 et sw=2 tw=80:
*
* Copyright 2023 Mozilla Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
// This is a trampoline header meant to redirect from where libwebrtc code
// expects third_party headers to where those headers exist in the Mozilla
// Firefox repository.
#include "drm.h"

View file

@ -0,0 +1,23 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
* vim: set ts=8 sts=2 et sw=2 tw=80:
*
* Copyright 2023 Mozilla Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
// This is a trampoline header meant to redirect from where libwebrtc code
// expects third_party headers to where those headers exist in the Mozilla
// Firefox repository.
#include "libdrm/drm_fourcc.h"

View file

@ -0,0 +1,23 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
* vim: set ts=8 sts=2 et sw=2 tw=80:
*
* Copyright 2023 Mozilla Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
// This is a trampoline header meant to redirect from where libwebrtc code
// expects third_party headers to where those headers exist in the Mozilla
// Firefox repository.
#include "xf86drm.h"

View file

@ -0,0 +1,29 @@
# -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
# vim: set ts=8 sts=2 et sw=2 tw=80:
#
# Copyright 2023 Mozilla Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("../../webrtc.gni")
config("gbm_include_config") {
include_dirs = [
"/third_party/gbm/gbm",
]
}
rtc_library("gbm") {
public_configs = [ ":gbm_include_config" ]
}

View file

@ -0,0 +1,23 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
* vim: set ts=8 sts=2 et sw=2 tw=80:
*
* Copyright 2023 Mozilla Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
// This is a trampoline header meant to redirect from where libwebrtc code
// expects third_party headers to where those headers exist in the Mozilla
// Firefox repository.
#include "gbm.h"

View file

@ -0,0 +1,31 @@
# -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
# vim: set ts=8 sts=2 et sw=2 tw=80:
#
# Copyright 2023 Mozilla Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("../../webrtc.gni")
config("libepoxy_include_config") {
include_dirs = [
"/third_party/libepoxy/libepoxy/include",
"/gfx/angle/checkout/include"
]
}
rtc_library("libepoxy") {
public_configs = [ ":libepoxy_include_config" ]
}

View file

@ -0,0 +1,23 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
* vim: set ts=8 sts=2 et sw=2 tw=80:
*
* Copyright 2023 Mozilla Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
// This is a trampoline header meant to redirect from where libwebrtc code
// expects third_party headers to where those headers exist in the Mozilla
// Firefox repository.
#include "epoxy/egl.h"

View file

@ -0,0 +1,29 @@
# -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
# vim: set ts=8 sts=2 et sw=2 tw=80:
#
# Copyright 2023 Mozilla Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("../../webrtc.gni")
config("pipewire_include_config") {
defines = [ "WEBRTC_USE_PIPEWIRE" ]
include_dirs = [
"/third_party/pipewire",
]
}
rtc_library("pipewire") {
public_configs = [ ":pipewire_include_config" ]
}

View file

@ -0,0 +1,23 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
* vim: set ts=8 sts=2 et sw=2 tw=80:
*
* Copyright 2023 Mozilla Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
// This is a trampoline header meant to redirect from where libwebrtc code
// expects third_party headers to where those headers exist in the Mozilla
// Firefox repository.
#include "pipewire/pipewire.h"