Skip to content

Commit

Permalink
Rewrite is_linux flag for third_party directory.
Browse files Browse the repository at this point in the history
This migrates is_linux (which is also set for chromeos) to explicitly
include chromeos as is_linux || is_chromeos in preparation for
separating those flags.

Bug: 1110266
Change-Id: I2820ed1b76d5eed10947d5150a392551efef18c3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2326293
Commit-Queue: Sean McAllister <smcallis@google.com>
Reviewed-by: Hidehiko Abe <hidehiko@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@google.com>
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#793605}
  • Loading branch information
smcallis authored and Commit Bot committed Jul 31, 2020
1 parent c22bb09 commit 909c311
Show file tree
Hide file tree
Showing 23 changed files with 43 additions and 43 deletions.
8 changes: 4 additions & 4 deletions third_party/blink/renderer/controller/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jumbo_component("controller") {
"memory_usage_monitor.h",
]

if (is_linux) {
if (is_linux || is_chromeos) {
sources += [
"memory_usage_monitor_posix.cc",
"memory_usage_monitor_posix.h",
Expand Down Expand Up @@ -81,7 +81,7 @@ jumbo_component("controller") {

# HighestPmfReporter depends on MemoryUsageMonitor and MemoryUsageMonitor
# depends on platform specific code. Explicitly specify supported platforms.
if (is_linux || is_win || is_android || is_mac) {
if (is_linux || is_chromeos || is_win || is_android || is_mac) {
sources += [
"highest_pmf_reporter.cc",
"highest_pmf_reporter.h",
Expand Down Expand Up @@ -165,7 +165,7 @@ jumbo_source_set("blink_unittests_sources") {

sources = [ "tests/run_all_tests.cc" ]
sources += bindings_unittest_files
if (is_linux) {
if (is_linux || is_chromeos) {
sources += [ "memory_usage_monitor_posix_test.cc" ]
}
if (is_android) {
Expand All @@ -176,7 +176,7 @@ jumbo_source_set("blink_unittests_sources") {
]
}

if (is_linux || is_android || is_mac || is_win) {
if (is_linux || is_chromeos || is_android || is_mac || is_win) {
sources += [
"highest_pmf_reporter_test.cc",
"memory_usage_monitor_test.cc",
Expand Down
2 changes: 1 addition & 1 deletion third_party/blink/renderer/core/layout/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ blink_core_sources("layout") {
sources += [ "layout_theme_font_provider_default.cc" ]
}

if (is_linux) {
if (is_linux || is_chromeos) {
sources += [
"layout_theme_linux.cc",
"layout_theme_linux.h",
Expand Down
2 changes: 1 addition & 1 deletion third_party/blink/renderer/platform/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2230,7 +2230,7 @@ test("blink_fuzzer_unittests") {

sources = [ "testing/run_all_tests.cc" ]

if (is_linux) {
if (is_linux || is_chromeos) {
deps += [
"//third_party/blink/renderer/platform/scheduler:scheduler_fuzzer_tests",
]
Expand Down
2 changes: 1 addition & 1 deletion third_party/blink/renderer/platform/scheduler/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ jumbo_source_set("scheduler_fuzzer_tests") {
"//third_party/blink/renderer/platform/scheduler:test_support",
]

if (is_linux) {
if (is_linux || is_chromeos) {
sources += [
"test/fuzzer/sequence_manager_fuzzer_processor.cc",
"test/fuzzer/sequence_manager_fuzzer_processor.h",
Expand Down
8 changes: 4 additions & 4 deletions third_party/boringssl/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -72,29 +72,29 @@ if (is_win && !is_msan && current_cpu != "arm64") {
} else if (current_cpu == "x64") {
if (is_mac) {
sources += crypto_sources_mac_x86_64
} else if (is_linux || is_android) {
} else if (is_linux || is_chromeos || is_android) {
sources += crypto_sources_linux_x86_64
} else {
public_configs = [ ":no_asm_config" ]
}
} else if (current_cpu == "x86") {
if (is_mac) {
sources += crypto_sources_mac_x86
} else if (is_linux || is_android) {
} else if (is_linux || is_chromeos || is_android) {
sources += crypto_sources_linux_x86
} else {
public_configs = [ ":no_asm_config" ]
}
} else if (current_cpu == "arm") {
if (is_linux || is_android) {
if (is_linux || is_chromeos || is_android) {
sources += crypto_sources_linux_arm
} else if (is_ios) {
sources += crypto_sources_ios_arm
} else {
public_configs = [ ":no_asm_config" ]
}
} else if (current_cpu == "arm64") {
if (is_linux || is_android) {
if (is_linux || is_chromeos || is_android) {
sources += crypto_sources_linux_aarch64
} else if (is_ios) {
sources += crypto_sources_ios_aarch64
Expand Down
2 changes: 1 addition & 1 deletion third_party/breakpad/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ if (is_mac) {
}
}

if (is_linux || is_android) {
if (is_linux || is_chromeos || is_android) {
if (current_toolchain == host_toolchain) {
executable("symupload") {
sources = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ if (crashpad_is_in_chromium) {
crashpad_is_mac = is_mac
crashpad_is_ios = is_ios
crashpad_is_win = is_win
crashpad_is_linux = is_linux
crashpad_is_linux = is_linux || is_chromeos
crashpad_is_android = is_android
crashpad_is_fuchsia = is_fuchsia

Expand Down
2 changes: 1 addition & 1 deletion third_party/dav1d/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ if (is_win) {
if (is_mac) {
dav1d_copts += [ "-D_DARWIN_C_SOURCE" ]
}
if (is_linux || is_android || current_os == "aix") {
if (is_linux || is_chromeos || is_android || current_os == "aix") {
if (!is_clang) {
dav1d_copts += [ "-D_GNU_SOURCE" ]
}
Expand Down
2 changes: 1 addition & 1 deletion third_party/expat/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import("//testing/libfuzzer/fuzzer_test.gni")
# let's not pull it in twice.
# Chromecast doesn't ship expat as a system library.
# Libfuzzer and AFL need to build library from sources.
if (is_linux && !is_chromecast && !use_fuzzing_engine) {
if ((is_linux || is_chromeos) && !is_chromecast && !use_fuzzing_engine) {
config("expat_config") {
libs = [ "expat" ]
}
Expand Down
2 changes: 1 addition & 1 deletion third_party/fontconfig/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import("//build/config/sanitizers/sanitizers.gni")
import("//third_party/fontconfig/fontconfig.gni")

assert(is_linux)
assert(is_linux || is_chromeos)

if (use_bundled_fontconfig) {
config("fontconfig_config") {
Expand Down
4 changes: 2 additions & 2 deletions third_party/fontconfig/fontconfig.gni
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import("//build/config/chromeos/args.gni")
import("//build/config/features.gni")

assert(is_linux)
assert(is_linux || is_chromeos)

declare_args() {
use_bundled_fontconfig = is_linux && !is_chromeos_device
use_bundled_fontconfig = (is_linux || is_chromeos) && !is_chromeos_device
}
4 changes: 2 additions & 2 deletions third_party/freetype/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,13 @@ source_set("freetype_source") {
]
}

if (is_linux || is_chromecast) {
if (is_linux || is_chromeos || is_chromecast) {
# Needed for content_shell on Linux and Chromecast, since fontconfig
# requires FT_Get_BDF_Property.
sources += [ "src/src/base/ftbdf.c" ]
}

if (is_linux || is_chromecast) {
if (is_linux || is_chromeos || is_chromecast) {
# Needed on Fedora whose libfreetype builds ftsynth.c containing
# FT_GlyphSlot_Embolden, which we need to replace in content_shell if
# we are linking against our own FreeType.
Expand Down
2 changes: 1 addition & 1 deletion third_party/ijar/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# A tool that removes all non-interface-specific parts from a .jar file.

if (is_linux) {
if (is_linux || is_chromeos) {
executable("ijar") {
sources = [
"classfile.cc",
Expand Down
2 changes: 1 addition & 1 deletion third_party/libdrm/BUILD.gn
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright 2016 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.
assert(is_linux)
assert(is_linux || is_chromeos)

config("libdrm_config") {
# TODO(thomasanderson): Remove this hack once
Expand Down
6 changes: 3 additions & 3 deletions third_party/libusb/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ config("libusb_warnings") {
if (is_clang) {
# guid_eq in windows_usb.c is unused.
cflags = [ "-Wno-unused-function" ]
if (is_linux && !use_udev) {
if ((is_linux || is_chromeos) && !use_udev) {
cflags += [ "-Wno-pointer-sign" ]
}
}
Expand Down Expand Up @@ -115,7 +115,7 @@ static_library("libusb") {
]
}

if (is_linux) {
if (is_linux || is_chromeos) {
sources += [
"src/libusb/os/linux_usbfs.c",
"src/libusb/os/linux_usbfs.h",
Expand All @@ -139,7 +139,7 @@ static_library("libusb") {
deps += [ "//build/linux/libudev" ]
}

if (is_linux && !use_udev) {
if ((is_linux || is_chromeos) && !use_udev) {
sources += [ "src/libusb/os/linux_netlink.c" ]
defines += [ "HAVE_LINUX_NETLINK_H" ]
}
Expand Down
4 changes: 2 additions & 2 deletions third_party/libxml/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# Define an "os_include" variable that points at the OS-specific generated
# headers. These were generated by running the configure script offline.
if (is_linux || is_android || is_nacl || is_fuchsia) {
if (is_linux || is_chromeos || is_android || is_nacl || is_fuchsia) {
os_include = "linux"
} else if (is_apple) {
os_include = "mac"
Expand Down Expand Up @@ -66,7 +66,7 @@ config("libxml_warnings") {
# TODO(hans): See if we can fix upstream (http://crbug.com/763944).
"-Wno-enum-compare",
]
} else if (is_linux) {
} else if (is_linux || is_chromeos) {
cflags = [
# gcc spits out a bunch of warnings about passing too many arguments to
# __xmlSimpleError.
Expand Down
2 changes: 1 addition & 1 deletion third_party/libxslt/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ static_library("libxslt") {
public_configs = [ ":libxslt_config" ]

cflags = []
if (is_linux || is_android || is_fuchsia) {
if (is_linux || is_chromeos || is_android || is_fuchsia) {
include_dirs = [ "linux" ]
} else if (is_win) {
include_dirs = [ "win32" ]
Expand Down
2 changes: 1 addition & 1 deletion third_party/minigbm/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import("//build/config/chromecast_build.gni")
import("//build/config/linux/pkg_config.gni")

assert(is_linux)
assert(is_linux || is_chromeos)

declare_args() {
# Controls whether the build should use the version of minigbm library shipped
Expand Down
12 changes: 6 additions & 6 deletions third_party/openh264/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ config("config") {
# is believed to work.
# MSAN builds are flaky with assembler. crbug.com/685168

use_assembler = (is_win || is_linux) &&
use_assembler = (is_win || is_linux || is_chromeos) &&
(current_cpu == "x86" || current_cpu == "x64") && !is_msan

# This IF statement will make the targets visible only on specific builds,
Expand All @@ -55,7 +55,7 @@ if (use_assembler) {
if (!is_component_build) {
if (is_apple) {
asm_defines += [ "WELS_PRIVATE_EXTERN=private_extern" ]
} else if (is_linux || is_android || is_fuchsia) {
} else if (is_linux || is_chromeos || is_android || is_fuchsia) {
asm_defines += [ "WELS_PRIVATE_EXTERN=hidden" ]
}
}
Expand All @@ -74,7 +74,7 @@ if (use_assembler) {
]
} else if (is_win) {
defines += [ "WIN64" ]
} else if (is_linux) {
} else if (is_linux || is_chromeos) {
defines += [ "UNIX64" ]
}
}
Expand All @@ -95,7 +95,7 @@ if (use_assembler) {
]
} else if (is_win) {
defines += [ "WIN64" ]
} else if (is_linux) {
} else if (is_linux || is_chromeos) {
defines += [ "UNIX64" ]
}
}
Expand All @@ -116,12 +116,12 @@ if (use_assembler) {
]
} else if (is_win) {
defines += [ "WIN64" ]
} else if (is_linux) {
} else if (is_linux || is_chromeos) {
defines += [ "UNIX64" ]
}
}
}
} # if (is_win || is_linux)
} # if (is_win || is_linux || is_chromeos)

source_set("common") {
sources = openh264_common_sources
Expand Down
4 changes: 2 additions & 2 deletions third_party/opus/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use_opus_x86_optimization =
# If OPUS Run Time CPU Detections (RTCD) shall be used.
# Based on the conditions in celt/arm/armcpu.c:
# defined(_MSC_VER) || defined(__linux__).
use_opus_arm_rtcd = current_cpu == "arm" && (is_win || is_android || is_linux)
use_opus_arm_rtcd = current_cpu == "arm" && (is_win || is_android || is_linux || is_chromeos)

config("opus_config") {
include_dirs = [ "src/include" ]
Expand Down Expand Up @@ -612,7 +612,7 @@ test("test_opus_padding") {
# Compilation fails on windows due to wstring/string mistmatch.
# This is not worth looking at it since the benchmark is tailored for android.
# It is ok to run it on linux though, for experimentation purpose.
if (is_android || is_linux) {
if (is_android || is_linux || is_chromeos) {
test("opus_tests") {
sources = [ "tests/opus_benchmark.cc" ]

Expand Down
8 changes: 4 additions & 4 deletions third_party/sqlite/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ config("sqlite_warnings") {
]
}
}
if (is_linux) {
if (is_linux || is_chromeos) {
cflags += [
# SQLite doesn't believe in compiler warnings, preferring testing.
# http://www.sqlite.org/faq.html#q17
Expand Down Expand Up @@ -191,7 +191,7 @@ component("chromium_sqlite3") {
}
}

if (is_linux || is_android) {
if (is_linux || is_chromeos || is_android) {
defines += [
# Linux provides fdatasync(), a faster equivalent of fsync().
"fdatasync=fdatasync",
Expand Down Expand Up @@ -270,7 +270,7 @@ component("dev_sqlite3") {
}
}

if (is_linux || is_android) {
if (is_linux || is_chromeos || is_android) {
defines += [
# Linux provides fdatasync(), a faster equivalent of fsync().
"fdatasync=fdatasync",
Expand Down Expand Up @@ -344,7 +344,7 @@ group("sqlite_dev") {
]
}

if (is_win || is_mac || is_linux) {
if (is_win || is_mac || is_linux || is_chromeos) {
executable("sqlite_shell") {
include_dirs = [
# SQLite's shell.c contains an '#include "sqlite3.h", which we want to be
Expand Down
2 changes: 1 addition & 1 deletion third_party/usrsctp/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ static_library("usrsctp") {
"-UINET6",
]

if (is_linux || is_android) {
if (is_linux || is_chromeos || is_android) {
defines += [
"__Userspace_os_Linux",
"_GNU_SOURCE",
Expand Down
2 changes: 1 addition & 1 deletion third_party/widevine/cdm/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ group("cdm") {
# This target exists for tests to depend on that pulls in a runtime dependency
# on the license server.
group("widevine_test_license_server") {
if (bundle_widevine_cdm && is_linux) {
if (bundle_widevine_cdm && (is_linux || is_chromeos)) {
data = [ "//third_party/widevine/test/license_server/" ]
}
}

0 comments on commit 909c311

Please sign in to comment.