1# Copyright 2018 The Chromium Authors 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4 5import("//build/buildflag_header.gni") 6import("//build/config/cast.gni") 7import("//build/config/chrome_build.gni") 8import("//build/config/chromeos/args.gni") 9import("//build/config/chromeos/ui_mode.gni") 10import("//build/config/features.gni") 11import("//build/util/process_version.gni") 12import("//build_overrides/build.gni") 13 14source_set("buildflag_header_h") { 15 sources = [ "buildflag.h" ] 16} 17 18buildflag_header("branding_buildflags") { 19 header = "branding_buildflags.h" 20 21 if (is_chrome_branded) { 22 flags = [ 23 "CHROMIUM_BRANDING=0", 24 "GOOGLE_CHROME_BRANDING=1", 25 ] 26 } else { 27 flags = [ 28 "CHROMIUM_BRANDING=1", 29 "GOOGLE_CHROME_BRANDING=0", 30 ] 31 } 32 33 if (is_chrome_for_testing) { 34 assert(!is_chrome_branded, 35 "`is_chrome_for_testing` is incompatible with `is_chrome_branded`") 36 37 flags += [ "CHROME_FOR_TESTING=1" ] 38 } else { 39 flags += [ "CHROME_FOR_TESTING=0" ] 40 } 41 42 # Note: `GOOGLE_CHROME_FOR_TESTING_BRANDING` and `CHROMIUM_BRANDING` are not 43 # mutually exclusive. 44 if (is_chrome_for_testing_branded) { 45 assert(is_chrome_for_testing, 46 "`is_chrome_for_testing_branded` requires `is_chrome_for_testing`") 47 48 flags += [ "GOOGLE_CHROME_FOR_TESTING_BRANDING=1" ] 49 } else { 50 flags += [ "GOOGLE_CHROME_FOR_TESTING_BRANDING=0" ] 51 } 52} 53 54buildflag_header("blink_buildflags") { 55 header = "blink_buildflags.h" 56 flags = [ "USE_BLINK=$use_blink" ] 57} 58 59buildflag_header("chromecast_buildflags") { 60 header = "chromecast_buildflags.h" 61 62 flags = [ 63 "IS_CASTOS=$is_castos", 64 "IS_CAST_ANDROID=$is_cast_android", 65 "ENABLE_CAST_RECEIVER=$enable_cast_receiver", 66 ] 67} 68 69buildflag_header("chromeos_buildflags") { 70 header = "chromeos_buildflags.h" 71 72 flags = [ 73 "IS_CHROMEOS_DEVICE=$is_chromeos_device", 74 75 "IS_CHROMEOS_LACROS=$is_chromeos_lacros", 76 "IS_CHROMEOS_ASH=$is_chromeos_ash", 77 "IS_CHROMEOS_WITH_HW_DETAILS=$is_chromeos_with_hw_details", 78 "IS_REVEN=$is_reven", 79 ] 80} 81 82buildflag_header("robolectric_buildflags") { 83 header = "robolectric_buildflags.h" 84 flags = [ "IS_ROBOLECTRIC=$is_robolectric" ] 85} 86 87if (build_with_chromium) { 88 group("gold_common_pytype") { 89 testonly = true 90 91 data = [ "//build/skia_gold_common/" ] 92 93 data_deps = [ "//testing:pytype_dependencies" ] 94 } 95} 96 97if (is_chromeos) { 98 process_version("version_metadata") { 99 sources = [ "//chrome/VERSION" ] 100 101 template_file = "metadata.json.in" 102 output = "$root_out_dir/metadata.json" 103 process_only = true 104 } 105} 106