Avi Drissman | 73a09d1 | 2022-09-08 20:33:38 | [diff] [blame] | 1 | # Copyright 2018 The Chromium Authors |
Marcin Simonides | 2f14ea1 | 2018-01-23 20:30:03 | [diff] [blame] | 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
Nico Weber | 897593f | 2019-07-25 23:17:55 | [diff] [blame] | 5 | import("//build/buildflag_header.gni") |
mark a. foltz | e185ab2fa | 2023-11-06 21:21:20 | [diff] [blame] | 6 | import("//build/config/cast.gni") |
Nico Weber | 897593f | 2019-07-25 23:17:55 | [diff] [blame] | 7 | import("//build/config/chrome_build.gni") |
Hidehiko Abe | 9c499c2 | 2020-09-03 18:10:33 | [diff] [blame] | 8 | import("//build/config/chromeos/args.gni") |
James Cook | 26d2712 | 2020-06-26 19:57:07 | [diff] [blame] | 9 | import("//build/config/chromeos/ui_mode.gni") |
Dave Tapuska | 70065a6 | 2023-02-01 21:58:18 | [diff] [blame] | 10 | import("//build/config/features.gni") |
Sven Zheng | ba9e62b | 2022-07-11 23:45:51 | [diff] [blame] | 11 | import("//build/util/process_version.gni") |
Michael Achenbach | bd038af | 2022-07-25 11:56:13 | [diff] [blame] | 12 | import("//build_overrides/build.gni") |
Nico Weber | 897593f | 2019-07-25 23:17:55 | [diff] [blame] | 13 | |
Sylvain Defresne | 86bce6f4 | 2024-02-13 13:04:36 | [diff] [blame^] | 14 | if (is_ios) { |
| 15 | import("//build/config/ios/ios_sdk.gni") |
| 16 | } |
| 17 | |
Marcin Simonides | 2f14ea1 | 2018-01-23 20:30:03 | [diff] [blame] | 18 | source_set("buildflag_header_h") { |
Nico Weber | 4782d7368 | 2020-01-14 04:52:17 | [diff] [blame] | 19 | sources = [ "buildflag.h" ] |
Marcin Simonides | 2f14ea1 | 2018-01-23 20:30:03 | [diff] [blame] | 20 | } |
Nico Weber | 897593f | 2019-07-25 23:17:55 | [diff] [blame] | 21 | |
| 22 | buildflag_header("branding_buildflags") { |
| 23 | header = "branding_buildflags.h" |
| 24 | |
Nico Weber | 0cc7112 | 2019-07-29 17:30:40 | [diff] [blame] | 25 | if (is_chrome_branded) { |
| 26 | flags = [ |
| 27 | "CHROMIUM_BRANDING=0", |
| 28 | "GOOGLE_CHROME_BRANDING=1", |
| 29 | ] |
| 30 | } else { |
| 31 | flags = [ |
| 32 | "CHROMIUM_BRANDING=1", |
| 33 | "GOOGLE_CHROME_BRANDING=0", |
| 34 | ] |
| 35 | } |
Thiago Perrotta | 02d1347 | 2023-08-31 17:03:09 | [diff] [blame] | 36 | |
| 37 | if (is_chrome_for_testing) { |
| 38 | assert(!is_chrome_branded, |
| 39 | "`is_chrome_for_testing` is incompatible with `is_chrome_branded`") |
| 40 | |
| 41 | flags += [ "CHROME_FOR_TESTING=1" ] |
| 42 | } else { |
| 43 | flags += [ "CHROME_FOR_TESTING=0" ] |
| 44 | } |
| 45 | |
| 46 | # Note: `GOOGLE_CHROME_FOR_TESTING_BRANDING` and `CHROMIUM_BRANDING` are not |
| 47 | # mutually exclusive. |
| 48 | if (is_chrome_for_testing_branded) { |
| 49 | assert(is_chrome_for_testing, |
| 50 | "`is_chrome_for_testing_branded` requires `is_chrome_for_testing`") |
| 51 | |
| 52 | flags += [ "GOOGLE_CHROME_FOR_TESTING_BRANDING=1" ] |
| 53 | } else { |
| 54 | flags += [ "GOOGLE_CHROME_FOR_TESTING_BRANDING=0" ] |
| 55 | } |
Nico Weber | 897593f | 2019-07-25 23:17:55 | [diff] [blame] | 56 | } |
Michael Spang | 8a06334 | 2019-12-06 22:54:33 | [diff] [blame] | 57 | |
Dave Tapuska | 70065a6 | 2023-02-01 21:58:18 | [diff] [blame] | 58 | buildflag_header("blink_buildflags") { |
| 59 | header = "blink_buildflags.h" |
| 60 | flags = [ "USE_BLINK=$use_blink" ] |
| 61 | } |
| 62 | |
Michael Spang | 8a06334 | 2019-12-06 22:54:33 | [diff] [blame] | 63 | buildflag_header("chromecast_buildflags") { |
| 64 | header = "chromecast_buildflags.h" |
| 65 | |
Ryan Keane | af3ac0f | 2022-05-02 18:40:08 | [diff] [blame] | 66 | flags = [ |
Ryan Keane | af3ac0f | 2022-05-02 18:40:08 | [diff] [blame] | 67 | "IS_CASTOS=$is_castos", |
Ryan Keane | 16a2559 | 2022-06-02 23:52:52 | [diff] [blame] | 68 | "IS_CAST_ANDROID=$is_cast_android", |
| 69 | "ENABLE_CAST_RECEIVER=$enable_cast_receiver", |
Ryan Keane | af3ac0f | 2022-05-02 18:40:08 | [diff] [blame] | 70 | ] |
Michael Spang | 8a06334 | 2019-12-06 22:54:33 | [diff] [blame] | 71 | } |
James Cook | 26d2712 | 2020-06-26 19:57:07 | [diff] [blame] | 72 | |
Hidehiko Abe | 7c68f58 | 2020-09-03 15:47:25 | [diff] [blame] | 73 | buildflag_header("chromeos_buildflags") { |
| 74 | header = "chromeos_buildflags.h" |
James Cook | 26d2712 | 2020-06-26 19:57:07 | [diff] [blame] | 75 | |
Hidehiko Abe | 9c499c2 | 2020-09-03 18:10:33 | [diff] [blame] | 76 | flags = [ |
| 77 | "IS_CHROMEOS_DEVICE=$is_chromeos_device", |
Yuta Hijikata | 2431a91 | 2020-10-28 15:49:48 | [diff] [blame] | 78 | |
Yuta Hijikata | 2431a91 | 2020-10-28 15:49:48 | [diff] [blame] | 79 | "IS_CHROMEOS_LACROS=$is_chromeos_lacros", |
| 80 | "IS_CHROMEOS_ASH=$is_chromeos_ash", |
xiangdong kong | be3f6d4 | 2021-10-05 03:14:40 | [diff] [blame] | 81 | "IS_CHROMEOS_WITH_HW_DETAILS=$is_chromeos_with_hw_details", |
Richard Chui | 57f6b26 | 2022-02-15 01:21:36 | [diff] [blame] | 82 | "IS_REVEN=$is_reven", |
Hidehiko Abe | 9c499c2 | 2020-09-03 18:10:33 | [diff] [blame] | 83 | ] |
James Cook | 26d2712 | 2020-06-26 19:57:07 | [diff] [blame] | 84 | } |
Sven Zheng | ba9e62b | 2022-07-11 23:45:51 | [diff] [blame] | 85 | |
Andrew Grieve | 5cec639 | 2023-09-06 14:46:01 | [diff] [blame] | 86 | buildflag_header("robolectric_buildflags") { |
| 87 | header = "robolectric_buildflags.h" |
| 88 | flags = [ "IS_ROBOLECTRIC=$is_robolectric" ] |
| 89 | } |
| 90 | |
Sylvain Defresne | 86bce6f4 | 2024-02-13 13:04:36 | [diff] [blame^] | 91 | buildflag_header("ios_buildflags") { |
| 92 | header = "ios_buildflags.h" |
| 93 | _is_ios_app_extension = is_ios && ios_is_app_extension |
| 94 | flags = [ "IS_IOS_APP_EXTENSION=$_is_ios_app_extension" ] |
| 95 | } |
| 96 | |
Michael Achenbach | bd038af | 2022-07-25 11:56:13 | [diff] [blame] | 97 | if (build_with_chromium) { |
| 98 | group("gold_common_pytype") { |
| 99 | testonly = true |
Brian Sheedy | 0bf7f82 | 2022-07-21 17:44:43 | [diff] [blame] | 100 | |
Michael Achenbach | bd038af | 2022-07-25 11:56:13 | [diff] [blame] | 101 | data = [ "//build/skia_gold_common/" ] |
Brian Sheedy | 0bf7f82 | 2022-07-21 17:44:43 | [diff] [blame] | 102 | |
Michael Achenbach | bd038af | 2022-07-25 11:56:13 | [diff] [blame] | 103 | data_deps = [ "//testing:pytype_dependencies" ] |
| 104 | } |
Brian Sheedy | 0bf7f82 | 2022-07-21 17:44:43 | [diff] [blame] | 105 | } |
| 106 | |
Sven Zheng | ba9e62b | 2022-07-11 23:45:51 | [diff] [blame] | 107 | if (is_chromeos) { |
| 108 | process_version("version_metadata") { |
| 109 | sources = [ "//chrome/VERSION" ] |
| 110 | |
| 111 | template_file = "metadata.json.in" |
| 112 | output = "$root_out_dir/metadata.json" |
| 113 | process_only = true |
| 114 | } |
| 115 | } |