1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144
|
# Copyright 2018 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/buildflag_header.gni")
import("//build/config/cast.gni")
import("//build/config/chrome_build.gni")
import("//build/config/chromeos/args.gni")
import("//build/config/features.gni")
import("//build/util/process_version.gni")
import("//build_overrides/build.gni")
if (is_ios) {
import("//build/config/ios/ios_sdk.gni")
}
source_set("buildflag_header_h") {
sources = [ "buildflag.h" ]
}
buildflag_header("branding_buildflags") {
header = "branding_buildflags.h"
if (is_chrome_branded) {
flags = [
"CHROMIUM_BRANDING=false",
"GOOGLE_CHROME_BRANDING=true",
]
} else {
flags = [
"CHROMIUM_BRANDING=true",
"GOOGLE_CHROME_BRANDING=false",
]
}
if (is_chrome_for_testing) {
assert(!is_chrome_branded,
"`is_chrome_for_testing` is incompatible with `is_chrome_branded`")
flags += [ "CHROME_FOR_TESTING=true" ]
} else {
flags += [ "CHROME_FOR_TESTING=false" ]
}
# Note: `GOOGLE_CHROME_FOR_TESTING_BRANDING` and `CHROMIUM_BRANDING` are not
# mutually exclusive.
if (is_chrome_for_testing_branded) {
assert(is_chrome_for_testing,
"`is_chrome_for_testing_branded` requires `is_chrome_for_testing`")
flags += [ "GOOGLE_CHROME_FOR_TESTING_BRANDING=true" ]
} else {
flags += [ "GOOGLE_CHROME_FOR_TESTING_BRANDING=false" ]
}
flags += [ "ENABLE_BUILTIN_SEARCH_PROVIDER_ASSETS=$enable_builtin_search_provider_assets" ]
}
buildflag_header("blink_buildflags") {
header = "blink_buildflags.h"
flags = [ "USE_BLINK=$use_blink" ]
}
buildflag_header("chromecast_buildflags") {
header = "chromecast_buildflags.h"
flags = [
"IS_CASTOS=$is_castos",
"IS_CAST_ANDROID=$is_cast_android",
"ENABLE_CAST_RECEIVER=$enable_cast_receiver",
]
}
buildflag_header("chromeos_buildflags") {
header = "chromeos_buildflags.h"
flags = [
"IS_CHROMEOS_DEVICE=$is_chromeos_device",
# TODO(b:354842935): Remove once all the occurrence of IS_CHROMEOS_ASH is
# removed from cc files.
"IS_CHROMEOS_ASH=$is_chromeos",
"IS_CHROMEOS_WITH_HW_DETAILS=$is_chromeos_with_hw_details",
"IS_REVEN=$is_reven",
]
}
buildflag_header("robolectric_buildflags") {
header = "robolectric_buildflags.h"
flags = [ "IS_ROBOLECTRIC=$is_robolectric" ]
}
buildflag_header("ios_buildflags") {
header = "ios_buildflags.h"
_is_ios_app_extension = is_ios && ios_is_app_extension
flags = [ "IS_IOS_APP_EXTENSION=$_is_ios_app_extension" ]
}
#
# NOTE: IS_DESKTOP_ANDROID should be used sparingly.
#
# General Recommendation:
# Avoid using this build time flag whenever possible. Rely on runtime
# detection of features such as:
# - Large screen availability
# - Input modalities (e.g., touch, keyboard, mouse)
# - Relevant Android system flags.
#
# DO:
# - Use this flag ONLY for features with substantial binary size impact,
# such as DevTools or Extensions, which contain significant code and
# resource sizes.
#
# DON'T:
# - Use this flag to enable feature flags or experiments.
# - Use this flag in code shared with Android WebView.
# Restrict its usage to the //chrome code directory whenever possible.
#
# If you're unsure please reach out to is-android-desktop-help@google.com
#
buildflag_header("android_buildflags") {
header = "android_buildflags.h"
flags = [ "IS_DESKTOP_ANDROID=$is_desktop_android" ]
}
if (build_with_chromium) {
group("gold_common_pytype") {
testonly = true
data = [ "//build/skia_gold_common/" ]
data_deps = [ "//testing:pytype_dependencies" ]
}
}
if (is_chromeos) {
process_version("version_metadata") {
sources = [ "//chrome/VERSION" ]
template_file = "metadata.json.in"
output = "$root_out_dir/metadata.json"
process_only = true
}
}
|