From f264e70a4738c23b2851a036c33808aff7e74fdc Mon Sep 17 00:00:00 2001 From: Hidehiko Abe Date: Thu, 10 Sep 2020 18:10:11 +0900 Subject: [PATCH] Expand is_linux to is_linux || is_chromeos. Currently is_linux is set to true on Chrome OS build, but it is planned to be set false. This CL is the preparation to keep the compatibility. Bug: chromium:1110266 Test: Build locally. Change-Id: Ic79a202b0b3baeff157955cd03a07556bfb958a8 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/183860 Reviewed-by: Mirko Bonadei Commit-Queue: Hidehiko Abe Cr-Commit-Position: refs/heads/master@{#32073} --- BUILD.gn | 2 +- audio/BUILD.gn | 2 +- examples/BUILD.gn | 6 +++--- modules/audio_coding/BUILD.gn | 2 +- modules/audio_device/BUILD.gn | 4 ++-- modules/desktop_capture/BUILD.gn | 6 +++--- modules/video_capture/BUILD.gn | 6 +++--- rtc_base/BUILD.gn | 2 +- system_wrappers/BUILD.gn | 2 +- test/BUILD.gn | 6 +++--- webrtc.gni | 2 +- 11 files changed, 20 insertions(+), 20 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index d6a19e67c9..443a4ff190 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -173,7 +173,7 @@ config("common_inherited_config") { "WEBRTC_IOS", ] } - if (is_linux) { + if (is_linux || is_chromeos) { defines += [ "WEBRTC_LINUX" ] } if (is_mac) { diff --git a/audio/BUILD.gn b/audio/BUILD.gn index 78f6affe84..aca0df0ded 100644 --- a/audio/BUILD.gn +++ b/audio/BUILD.gn @@ -254,7 +254,7 @@ if (rtc_include_tests) { data += [ "${root_out_dir}/low_bandwidth_audio_test" ] } - if (is_linux || is_android) { + if (is_linux || is_chromeos || is_android) { data += [ "../tools_webrtc/audio_quality/linux/PolqaOem64", "../tools_webrtc/audio_quality/linux/pesq", diff --git a/examples/BUILD.gn b/examples/BUILD.gn index 822f194c95..557e31fce5 100644 --- a/examples/BUILD.gn +++ b/examples/BUILD.gn @@ -45,7 +45,7 @@ group("examples") { deps += [ ":AppRTCMobile" ] } - if (is_linux || is_win) { + if (is_linux || is_chromeos || is_win) { deps += [ ":peerconnection_server", ":stunserver", @@ -647,7 +647,7 @@ if (is_ios || (is_mac && target_cpu != "x86")) { } } -if (is_linux || is_win) { +if (is_linux || is_chromeos || is_win) { rtc_executable("peerconnection_client") { testonly = true sources = [ @@ -691,7 +691,7 @@ if (is_linux || is_win) { configs += [ "//build/config/win:windowed" ] deps += [ "../media:rtc_media_base" ] } - if (is_linux) { + if (is_linux || is_chromeos) { sources += [ "peerconnection/client/linux/main.cc", "peerconnection/client/linux/main_wnd.cc", diff --git a/modules/audio_coding/BUILD.gn b/modules/audio_coding/BUILD.gn index 55795397fe..33540333f5 100644 --- a/modules/audio_coding/BUILD.gn +++ b/modules/audio_coding/BUILD.gn @@ -483,7 +483,7 @@ rtc_library("isac_c") { "codecs/isac/main/source/transform.c", ] - if (is_linux) { + if (is_linux || is_chromeos) { libs = [ "m" ] } diff --git a/modules/audio_device/BUILD.gn b/modules/audio_device/BUILD.gn index d610639314..819a8668e3 100644 --- a/modules/audio_device/BUILD.gn +++ b/modules/audio_device/BUILD.gn @@ -263,7 +263,7 @@ rtc_library("audio_device_impl") { if (rtc_use_dummy_audio_file_devices) { defines += [ "WEBRTC_DUMMY_FILE_DEVICES" ] } else { - if (is_linux) { + if (is_linux || is_chromeos) { sources += [ "linux/alsasymboltable_linux.cc", "linux/alsasymboltable_linux.h", @@ -393,7 +393,7 @@ if (rtc_include_tests) { "../utility", ] absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ] - if (is_linux || is_mac || is_win) { + if (is_linux || is_chromeos || is_mac || is_win) { sources += [ "audio_device_unittest.cc" ] } if (is_win) { diff --git a/modules/desktop_capture/BUILD.gn b/modules/desktop_capture/BUILD.gn index 1cba946601..eb57a465dd 100644 --- a/modules/desktop_capture/BUILD.gn +++ b/modules/desktop_capture/BUILD.gn @@ -140,7 +140,7 @@ if (rtc_include_tests) { "screen_drawer.h", ] - if (is_linux) { + if (is_linux || is_chromeos) { sources += [ "screen_drawer_linux.cc" ] } @@ -186,7 +186,7 @@ if (rtc_include_tests) { } } -if (is_linux) { +if (is_linux || is_chromeos) { if (rtc_use_pipewire) { pkg_config("gio") { packages = [ @@ -357,7 +357,7 @@ rtc_library("desktop_capture_generic") { "window_capturer_linux.cc", ] - if (build_with_mozilla && is_linux) { + if (build_with_mozilla && (is_linux || is_chromeos)) { sources += [ "app_capturer_linux.cc", "linux/app_capturer_x11.cc", diff --git a/modules/video_capture/BUILD.gn b/modules/video_capture/BUILD.gn index 741d6e21b4..9822981e24 100644 --- a/modules/video_capture/BUILD.gn +++ b/modules/video_capture/BUILD.gn @@ -56,7 +56,7 @@ if (!build_with_chromium) { "../../system_wrappers", ] - if (is_linux) { + if (is_linux || is_chromeos) { sources = [ "linux/device_info_linux.cc", "linux/device_info_linux.h", @@ -113,13 +113,13 @@ if (!build_with_chromium) { rtc_test("video_capture_tests") { sources = [ "test/video_capture_unittest.cc" ] ldflags = [] - if (is_linux || is_mac) { + if (is_linux || is_chromeos || is_mac) { ldflags += [ "-lpthread", "-lm", ] } - if (is_linux) { + if (is_linux || is_chromeos) { ldflags += [ "-lrt", "-lXext", diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn index 61886a6afb..a4dab2d654 100644 --- a/rtc_base/BUILD.gn +++ b/rtc_base/BUILD.gn @@ -966,7 +966,7 @@ rtc_library("rtc_base") { deps += [ "system:cocoa_threading" ] } - if (is_linux) { + if (is_linux || is_chromeos) { libs += [ "dl", "rt", diff --git a/system_wrappers/BUILD.gn b/system_wrappers/BUILD.gn index 97c09f5850..7b6d1566ce 100644 --- a/system_wrappers/BUILD.gn +++ b/system_wrappers/BUILD.gn @@ -57,7 +57,7 @@ rtc_library("system_wrappers") { libs += [ "log" ] } - if (is_linux) { + if (is_linux || is_chromeos) { if (!build_with_chromium) { sources += [ "source/cpu_features_linux.cc" ] } diff --git a/test/BUILD.gn b/test/BUILD.gn index 8e1fbc3f4b..549596f8d7 100644 --- a/test/BUILD.gn +++ b/test/BUILD.gn @@ -966,17 +966,17 @@ rtc_library("test_renderer_generic") { ] deps += [ "../api:scoped_refptr" ] } - if (!(is_linux && rtc_use_x11) && !is_mac && !is_win) { + if (!((is_linux || is_chromeos) && rtc_use_x11) && !is_mac && !is_win) { sources += [ "null_platform_renderer.cc" ] } - if ((is_linux && rtc_use_x11) || is_mac) { + if (((is_linux || is_chromeos) && rtc_use_x11) || is_mac) { sources += [ "gl/gl_renderer.cc", "gl/gl_renderer.h", ] } - if (is_linux && rtc_use_x11) { + if ((is_linux || is_chromeos) && rtc_use_x11) { sources += [ "linux/glx_renderer.cc", "linux/glx_renderer.h", diff --git a/webrtc.gni b/webrtc.gni index 17a66f974c..420fb7f10d 100644 --- a/webrtc.gni +++ b/webrtc.gni @@ -279,7 +279,7 @@ rtc_opus_dir = "//third_party/opus" # Desktop capturer is supported only on Windows, OSX and Linux. rtc_desktop_capture_supported = (is_win && current_os != "winuwp") || is_mac || - (is_linux && (rtc_use_x11_extensions || rtc_use_pipewire)) + ((is_linux || is_chromeos) && (rtc_use_x11_extensions || rtc_use_pipewire)) ############################################################################### # Templates