summaryrefslogtreecommitdiffstats
path: root/third_party/libwebrtc/build/config/posix/BUILD.gn
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /third_party/libwebrtc/build/config/posix/BUILD.gn
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/libwebrtc/build/config/posix/BUILD.gn')
-rw-r--r--third_party/libwebrtc/build/config/posix/BUILD.gn59
1 files changed, 59 insertions, 0 deletions
diff --git a/third_party/libwebrtc/build/config/posix/BUILD.gn b/third_party/libwebrtc/build/config/posix/BUILD.gn
new file mode 100644
index 0000000000..a49254f019
--- /dev/null
+++ b/third_party/libwebrtc/build/config/posix/BUILD.gn
@@ -0,0 +1,59 @@
+# Copyright 2015 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import("//build/config/sysroot.gni")
+
+# This build configuration is used by both Fuchsia and POSIX systems.
+assert(is_posix || is_fuchsia)
+
+group("posix") {
+ visibility = [ "//:optimize_gn_gen" ]
+}
+
+# This is included by reference in the //build/config/compiler:runtime_library
+# config that is applied to all targets. It is here to separate out the logic
+# that is Posix-only. Please see that target for advice on what should go in
+# :runtime_library vs. :compiler.
+config("runtime_library") {
+ asmflags = []
+ cflags = []
+ cflags_c = []
+ cflags_cc = []
+ cflags_objc = []
+ cflags_objcc = []
+ defines = []
+ ldflags = []
+
+ if (!is_apple && sysroot != "") {
+ # Pass the sysroot to all C compiler variants, the assembler, and linker.
+ sysroot_flags = [ "--sysroot=" + rebase_path(sysroot, root_build_dir) ]
+ if (is_linux || is_chromeos) {
+ # This is here so that all files get recompiled after a sysroot roll and
+ # when turning the sysroot on or off. (defines are passed via the command
+ # line, and build system rebuilds things when their commandline
+ # changes). Nothing should ever read this define.
+ sysroot_hash =
+ exec_script("//build/linux/sysroot_scripts/install-sysroot.py",
+ [ "--print-hash=$target_cpu" ],
+ "trim string",
+ [ "//build/linux/sysroot_scripts/sysroots.json" ])
+ defines += [ "CR_SYSROOT_HASH=$sysroot_hash" ]
+ }
+ asmflags += sysroot_flags
+ ldflags += sysroot_flags
+
+ # When use_custom_libcxx=true, some -isystem flags get passed to
+ # cflags_cc to set up libc++ include paths. We want to make sure
+ # the sysroot includes take lower precendence than the libc++
+ # ones, so they must appear later in the command line. However,
+ # the gn reference states "These variant-specific versions of
+ # cflags* will be appended on the compiler command line after
+ # 'cflags'." Because of this, we must set the sysroot flags for
+ # all cflags variants instead of using 'cflags' directly.
+ cflags_c += sysroot_flags
+ cflags_cc += sysroot_flags
+ cflags_objc += sysroot_flags
+ cflags_objcc += sysroot_flags
+ }
+}