prashantv | 4025129 | 2015-04-21 21:54:22 | [diff] [blame] | 1 | # Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
slan | 93f59d1d | 2015-11-13 17:46:49 | [diff] [blame] | 5 | import("//build/config/chromecast_build.gni") |
Stephen Lanham | 3c2131cd | 2017-04-28 01:13:41 | [diff] [blame] | 6 | import("//build/config/locales.gni") |
Albert Chaulk | 3ae73b1 | 2018-01-17 18:34:34 | [diff] [blame] | 7 | import("//extensions/features/features.gni") |
slan | 93f59d1d | 2015-11-13 17:46:49 | [diff] [blame] | 8 | |
slan | 77bdc2e6 | 2015-09-21 17:56:26 | [diff] [blame] | 9 | # This args block should contain arguments used within the //chromecast |
| 10 | # directory. Arguments which are used in other Chrome components should |
| 11 | # be instead declared in //build/config/chromecast_build.gni. |
prashantv | 4025129 | 2015-04-21 21:54:22 | [diff] [blame] | 12 | declare_args() { |
slan | 77bdc2e6 | 2015-09-21 17:56:26 | [diff] [blame] | 13 | # chromecast_branding is used to include or exclude Google-branded components. |
| 14 | # Set it to "public" for a Chromium build. |
yucliu | 48ba4153 | 2015-07-30 21:09:08 | [diff] [blame] | 15 | chromecast_branding = "public" |
prashantv | 4025129 | 2015-04-21 21:54:22 | [diff] [blame] | 16 | |
slan | c7957aae | 2016-05-09 22:25:59 | [diff] [blame] | 17 | # The incremental build number. The Cast automated builders will set this |
| 18 | # value to indicate the buildset. Note: The default value should be greater |
| 19 | # than any value the builder may assign to prevent attempted automatic updates |
| 20 | # when the default value is used. |
| 21 | cast_build_incremental = "999999" |
bshaya | 1ba19b6 | 2016-08-04 18:50:42 | [diff] [blame] | 22 | |
| 23 | # If true, IS_CAST_DEBUG_BUILD() will evaluate to 1 in version.h. Otherwise, |
| 24 | # it will evaluate to 0. Overriding this when is_debug=false is useful for |
| 25 | # doing engineering builds. |
| 26 | cast_is_debug = is_debug |
gfhuang | 79ceb4f | 2016-09-07 06:43:03 | [diff] [blame] | 27 | |
thoren | 9540c6d | 2017-05-22 20:07:04 | [diff] [blame] | 28 | if (is_android) { |
| 29 | # If true, run receiver apps in an Android service instead of an activity. |
| 30 | display_web_contents_in_service = is_cast_audio_only |
| 31 | } |
| 32 | |
gfhuang | 79ceb4f | 2016-09-07 06:43:03 | [diff] [blame] | 33 | # If true, Chromecast WebUI resources are included in a build. |
| 34 | # TODO(antz): default to false for audio-only builds, might need further |
| 35 | # clean up (b/27119303) |
| 36 | enable_chromecast_webui = !is_cast_audio_only && !is_android |
kmackay | 3801f1a | 2017-03-15 01:24:32 | [diff] [blame] | 37 | |
| 38 | # Set true to enable assistant features. |
| 39 | enable_assistant = false |
jameswest | a0889df | 2017-06-06 02:53:46 | [diff] [blame] | 40 | |
| 41 | # Set to true on devices that support multizone. Only indicates that the |
| 42 | # device supports multizone. The command line flag --enable-multizone must |
| 43 | # still be used to enable multizone. |
| 44 | supports_multizone = is_cast_audio_only && !is_cast_desktop_build |
Bryan Henry | 35001f81 | 2017-06-13 08:17:07 | [diff] [blame] | 45 | |
Yves Arrouye | c4785f3 | 2017-07-12 02:48:07 | [diff] [blame] | 46 | # Set to true for builds targeting ARC. |
| 47 | is_android_arc = false |
| 48 | |
Bryan Henry | 35001f81 | 2017-06-13 08:17:07 | [diff] [blame] | 49 | # Set true for builds targeting Android Things. |
| 50 | is_android_things = false |
Aidan Wolter | 247e39e | 2017-09-12 19:29:13 | [diff] [blame] | 51 | |
| 52 | # Set to true to start music apps in headless mode. |
| 53 | enable_headless_music_mode = false |
Aidan Wolter | 63fb79e | 2017-11-11 00:56:57 | [diff] [blame] | 54 | |
| 55 | # Set to true to keep Android activities alive when they are moved to the |
| 56 | # background. |
| 57 | enable_background_activities = false |
Steve Fung | db75c69 | 2017-11-21 03:43:05 | [diff] [blame] | 58 | |
Zhiheng Vincent Li | 7b37d58 | 2018-01-24 03:44:54 | [diff] [blame] | 59 | # Set to true to use CastWebContentsFragment instead of CastWebContentsActivity |
| 60 | # to run cast receiver app. |
| 61 | # TODO(thoren) merge this flag with display_web_contents_in_service |
| 62 | enable_cast_fragment = false |
| 63 | |
Steve Fung | db75c69 | 2017-11-21 03:43:05 | [diff] [blame] | 64 | # Set the number of lines for LogcatExtractor to send. |
| 65 | logcat_extractor_size = 512 |
Sandeep Vijayasekar | 4ddbad7 | 2018-01-25 02:20:11 | [diff] [blame] | 66 | |
| 67 | if (is_android) { |
| 68 | # Set to true to get logcat from a remote service |
| 69 | # If false, will only get the logs of the app. |
| 70 | use_remote_service_logcat = false |
| 71 | |
| 72 | # Set the package name and class path for the component which will provide device logs |
| 73 | # Values defined in eureka-internal |
| 74 | # These values are unused if use_remote_service_logcat is false |
| 75 | device_logs_provider_package = "" |
| 76 | device_logs_provider_class = "" |
| 77 | } |
slan | c7957aae | 2016-05-09 22:25:59 | [diff] [blame] | 78 | } |
| 79 | |
sanfin | 459cccff | 2016-05-12 22:26:44 | [diff] [blame] | 80 | declare_args() { |
Chris Kuiper | 23393ec | 2017-09-23 01:36:29 | [diff] [blame] | 81 | enable_volume_tables_access = |
| 82 | is_android_things && chromecast_branding != "public" |
Nat Jeffries | 8db5596 | 2017-07-21 23:41:22 | [diff] [blame] | 83 | } |
| 84 | |
| 85 | declare_args() { |
sanfin | 459cccff | 2016-05-12 22:26:44 | [diff] [blame] | 86 | # Use Playready CDMs for internal non-desktop builds. |
| 87 | use_playready = !is_cast_desktop_build && chromecast_branding != "public" |
| 88 | } |
| 89 | |
slan | c7957aae | 2016-05-09 22:25:59 | [diff] [blame] | 90 | # This is the release version, which takes the form <major>.<minor>. Internal |
| 91 | # builds will read the value from an internal file containing this value as a |
| 92 | # string. Public builds, lacking this file, will set a dummy value. |
| 93 | if (chromecast_branding == "public") { |
| 94 | cast_build_release = "eng." + getenv("USER") |
| 95 | } else { |
| 96 | cast_build_release = |
| 97 | read_file("//chromecast/internal/build/cast_build_release", "trim string") |
prashantv | 4025129 | 2015-04-21 21:54:22 | [diff] [blame] | 98 | } |
Stephen Lanham | 3c2131cd | 2017-04-28 01:13:41 | [diff] [blame] | 99 | |
| 100 | # All locales supported by Cast builds. This provides a single point of |
| 101 | # reference for all GN files referencing a locales list. |locales| is declared |
| 102 | # in //build/config/locales.gni. |
| 103 | cast_locales = locales |
Stephen Lanham | bd37862 | 2017-07-20 14:29:39 | [diff] [blame] | 104 | |
Albert Chaulk | e9b35dc | 2018-02-14 23:47:28 | [diff] [blame^] | 105 | enable_chromecast_extensions = enable_extensions |
Albert Chaulk | 3ae73b1 | 2018-01-17 18:34:34 | [diff] [blame] | 106 | |
Stephen Lanham | bd37862 | 2017-07-20 14:29:39 | [diff] [blame] | 107 | # These templates are a temporary fix fo link libc++ into shared libraries and |
| 108 | # executables. These should be removed as soon as crbug.com/746091 is resolved. |
Stephen Lanham | 4ad698a8 | 2017-07-25 21:24:51 | [diff] [blame] | 109 | foreach(target_type, |
| 110 | [ |
| 111 | "executable", |
| 112 | "shared_library", |
| 113 | "loadable_module", |
Bailey Forrest | 635cecc | 2017-11-01 01:09:40 | [diff] [blame] | 114 | "source_set", |
Stephen Lanham | 4ad698a8 | 2017-07-25 21:24:51 | [diff] [blame] | 115 | ]) { |
| 116 | template("cast_${target_type}") { |
| 117 | target(target_type, target_name) { |
| 118 | forward_variables_from(invoker, "*") |
Bailey Forrest | 635cecc | 2017-11-01 01:09:40 | [diff] [blame] | 119 | |
| 120 | configs += [ "//chromecast:cast_config" ] |
| 121 | |
Stephen Lanham | 4ad698a8 | 2017-07-25 21:24:51 | [diff] [blame] | 122 | if (!defined(deps)) { |
| 123 | deps = [] |
| 124 | } |
Bailey Forrest | 635cecc | 2017-11-01 01:09:40 | [diff] [blame] | 125 | |
| 126 | if (target_type != "source_set") { |
| 127 | deps += [ "//build/config:exe_and_shlib_deps" ] |
| 128 | } |
Stephen Lanham | bd37862 | 2017-07-20 14:29:39 | [diff] [blame] | 129 | } |
Stephen Lanham | bd37862 | 2017-07-20 14:29:39 | [diff] [blame] | 130 | } |
| 131 | } |
| 132 | |
Stephen Lanham | 4ad698a8 | 2017-07-25 21:24:51 | [diff] [blame] | 133 | # Set the defaults for each target. The defaults for these target wrappers |
| 134 | # should match their unwrapped counterparts in BUILDCONFIG.gn. The variables |
| 135 | # referenced below are declared in BUILDCONFIG.gn. |
| 136 | set_defaults("cast_executable") { |
| 137 | configs = default_executable_configs |
| 138 | } |
| 139 | |
| 140 | set_defaults("cast_shared_library") { |
| 141 | configs = default_shared_library_configs |
Doug Horn | 37635f0 | 2017-07-28 03:12:58 | [diff] [blame] | 142 | if (is_android) { |
| 143 | configs -= [ "//build/config/android:hide_all_but_jni_onload" ] |
| 144 | } |
Stephen Lanham | 4ad698a8 | 2017-07-25 21:24:51 | [diff] [blame] | 145 | } |
| 146 | |
| 147 | set_defaults("cast_loadable_module") { |
| 148 | configs = default_shared_library_configs |
| 149 | if (is_android) { |
| 150 | configs -= [ "//build/config/android:hide_all_but_jni_onload" ] |
Stephen Lanham | bd37862 | 2017-07-20 14:29:39 | [diff] [blame] | 151 | } |
| 152 | } |
Bailey Forrest | 635cecc | 2017-11-01 01:09:40 | [diff] [blame] | 153 | |
| 154 | set_defaults("cast_source_set") { |
| 155 | configs = default_compiler_configs |
| 156 | } |