Commit fc33e13d authored by Ben Pastene's avatar Ben Pastene Committed by Commit Bot

Rename the is_cros_chrome_sdk global GN variable to is_chromeos_device.

This makes the usage a little more clear, especially in a future world where
(hopefully) no one is running the `cros chrome-sdk` scripts directly, subsequently
making the phrase "cros_chrome_sdk" meaningless.

As we replace/deprecate Simple Chrome, this arg will start showing up in many
build files, so it's important that its purpose is clear in its name.
eg: http://crrev.com/c/1922977/9/ui/events/ozone/BUILD.gn

Bug: 937821
Change-Id: I967aa9498ed04e351b9423bc75939632ad01fd7d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1925330
Commit-Queue: Ben Pastene <bpastene@chromium.org>
Reviewed-by: default avatarDirk Pranke <dpranke@chromium.org>
Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Reviewed-by: default avatarAchuith Bhandarkar <achuith@chromium.org>
Cr-Commit-Position: refs/heads/master@{#720727}
parent 2bb45c61
# Copyright 2019 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.
declare_args() {
cros_board = ""
cros_sdk_version = ""
}
# Ensure that if one is set, the other is as well.
assert(cros_board == "" == (cros_sdk_version == ""))
declare_args() {
# Determines if we're building for a Chrome OS device (or VM) and not just
# linux-chromeos. NOTE: Most test targets in Chrome expect to run under
# linux-chromeos, so some have compile-time asserts that intentionally fail
# when this build flag is set. Build and run the tests for linux-chromeos
# instead.
# https://chromium.googlesource.com/chromium/src/+/master/docs/chromeos_build_instructions.md
# https://chromium.googlesource.com/chromiumos/docs/+/master/simple_chrome_workflow.md
is_chromeos_device = cros_board != ""
}
......@@ -3,13 +3,10 @@
# found in the LICENSE file.
import("//build/config/chrome_build.gni")
import("//build/config/chromeos/args.gni")
assert(is_chromeos)
declare_args() {
cros_board = ""
cros_sdk_version = ""
}
declare_args() {
# Determines if we're running tests on VMs or on devices.
# TODO(crbug.com/866062): Is there a better way to do this?
......@@ -17,18 +14,6 @@ declare_args() {
cros_board == "betty-pi-arc"
}
# Ensure that if one is set, the other is as well.
assert(cros_board == "" == (cros_sdk_version == ""))
# The build is using the Simple Chrome "cros chrome-sdk" to target real hardware
# or a VM, not linux-chromeos.
# NOTE: Most test targets in Chrome expect to run under linux-chromeos, so some
# have compile-time asserts that intentionally fail when this build flag is set.
# Build and run the tests for linux-chromeos instead.
# https://chromium.googlesource.com/chromium/src/+/master/docs/chromeos_build_instructions.md
# https://chromium.googlesource.com/chromiumos/docs/+/master/simple_chrome_workflow.md
is_cros_chrome_sdk = cros_board != ""
# Creates a script at $generated_script that can be used to launch a cros VM
# and optionally run a test within it.
# Args:
......
......@@ -4,18 +4,13 @@
import("//build/config/chrome_build.gni")
import("//build/config/chromecast_build.gni")
import("//build/config/chromeos/args.gni")
import("//build/config/compiler/pgo/pgo.gni")
import("//build/config/sanitizers/sanitizers.gni")
import("//build/toolchain/goma.gni")
import("//build/toolchain/toolchain.gni")
import("//build_overrides/build.gni")
if (is_chromeos) {
import("//build/config/chromeos/rules.gni")
} else {
is_cros_chrome_sdk = false
}
if (is_android) {
import("//build/config/android/abi.gni")
}
......@@ -232,7 +227,7 @@ if (symbol_level == -1) {
# Reduce symbol level when it will cause invalid elf files to be created
# (due to file size). https://crbug.com/648948.
symbol_level = 1
} else if (is_cros_chrome_sdk) {
} else if (is_chromeos_device) {
# Use lower symbol level in Simple Chrome build for faster link time.
# For Simple Chrome, this should take precedence over is_official_build,
# turned on by --internal.
......
......@@ -18,7 +18,7 @@ config("chromeos_implementation") {
buildflag_header("chromeos_buildflags") {
header = "chromeos_buildflags.h"
flags = [ "IS_CROS_CHROME_SDK=$is_cros_chrome_sdk" ]
flags = [ "IS_CHROMEOS_DEVICE=$is_chromeos_device" ]
}
component("chromeos") {
......@@ -207,7 +207,7 @@ test("chromeos_unittests") {
# linux-chromeos). See the following for reference:
# https://chromium.googlesource.com/chromium/src/+/master/docs/chromeos_build_instructions.md
# https://chromium.googlesource.com/chromiumos/docs/+/master/simple_chrome_workflow.md
if (is_cros_chrome_sdk) {
if (is_chromeos_device) {
# This builds a tool that prepares a DUT or VM for testing, which can be
# utilized by wrapping a host-side script test.
generate_runner_script("cros_test_wrapper") {
......
......@@ -8,9 +8,9 @@
#include "chromeos/chromeos_buildflags.h"
#include "mojo/core/embedder/embedder.h"
#if BUILDFLAG(IS_CROS_CHROME_SDK)
#error This test target only builds with linux-chromeos, not cros chrome-sdk.\
See comment in build/config/chromeos/rules.gni.
#if BUILDFLAG(IS_CHROMEOS_DEVICE)
#error This test target only builds with linux-chromeos, not for real ChromeOS\
devices. See comment in build/config/chromeos/args.gni.
#endif
int main(int argc, char** argv) {
......
......@@ -8,9 +8,9 @@
#include "chromeos/chromeos_buildflags.h"
#include "mojo/core/embedder/embedder.h"
#if BUILDFLAG(IS_CROS_CHROME_SDK)
#error This test target only builds with linux-chromeos, not cros chrome-sdk.\
See comment in build/config/chromeos/rules.gni.
#if BUILDFLAG(IS_CHROMEOS_DEVICE)
#error This test target only builds with linux-chromeos, not for real ChromeOS\
devices. See comment in build/config/chromeos/args.gni.
#endif
int main(int argc, char** argv) {
......
......@@ -295,7 +295,7 @@ template("test") {
}
bundle_deps += [ ":$_resources_bundle_data" ]
}
} else if (is_chromeos && is_cros_chrome_sdk) {
} else if (is_chromeos && is_chromeos_device) {
# Building for a cros board (ie: not linux-chromeos).
_gen_runner_target = "${target_name}__runner"
......
......@@ -18,9 +18,9 @@
#include "ui/base/ui_base_paths.h"
#include "ui/gl/test/gl_surface_test_support.h"
#if BUILDFLAG(IS_CROS_CHROME_SDK)
#error This test target only builds with linux-chromeos, not cros chrome-sdk.\
See comment in build/config/chromeos/rules.gni.
#if BUILDFLAG(IS_CHROMEOS_DEVICE)
#error This test target only builds with linux-chromeos, not for real ChromeOS\
devices. See comment in build/config/chromeos/args.gni.
#endif
namespace {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment