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 | |
| 59 | # Set the number of lines for LogcatExtractor to send. |
| 60 | logcat_extractor_size = 512 |
slan | c7957aae | 2016-05-09 22:25:59 | [diff] [blame] | 61 | } |
| 62 | |
sanfin | 459cccff | 2016-05-12 22:26:44 | [diff] [blame] | 63 | declare_args() { |
Chris Kuiper | 23393ec | 2017-09-23 01:36:29 | [diff] [blame] | 64 | enable_volume_tables_access = |
| 65 | is_android_things && chromecast_branding != "public" |
Nat Jeffries | 8db5596 | 2017-07-21 23:41:22 | [diff] [blame] | 66 | } |
| 67 | |
| 68 | declare_args() { |
sanfin | 459cccff | 2016-05-12 22:26:44 | [diff] [blame] | 69 | # Use Playready CDMs for internal non-desktop builds. |
| 70 | use_playready = !is_cast_desktop_build && chromecast_branding != "public" |
| 71 | } |
| 72 | |
slan | c7957aae | 2016-05-09 22:25:59 | [diff] [blame] | 73 | # This is the release version, which takes the form <major>.<minor>. Internal |
| 74 | # builds will read the value from an internal file containing this value as a |
| 75 | # string. Public builds, lacking this file, will set a dummy value. |
| 76 | if (chromecast_branding == "public") { |
| 77 | cast_build_release = "eng." + getenv("USER") |
| 78 | } else { |
| 79 | cast_build_release = |
| 80 | read_file("//chromecast/internal/build/cast_build_release", "trim string") |
prashantv | 4025129 | 2015-04-21 21:54:22 | [diff] [blame] | 81 | } |
Stephen Lanham | 3c2131cd | 2017-04-28 01:13:41 | [diff] [blame] | 82 | |
| 83 | # All locales supported by Cast builds. This provides a single point of |
| 84 | # reference for all GN files referencing a locales list. |locales| is declared |
| 85 | # in //build/config/locales.gni. |
| 86 | cast_locales = locales |
Stephen Lanham | bd37862 | 2017-07-20 14:29:39 | [diff] [blame] | 87 | |
Albert Chaulk | 3ae73b1 | 2018-01-17 18:34:34 | [diff] [blame^] | 88 | # Currently extensions require use_dbus=true if it is a linux build. |
| 89 | enable_chromecast_extensions = enable_extensions && (!is_linux || use_dbus) |
| 90 | |
Stephen Lanham | bd37862 | 2017-07-20 14:29:39 | [diff] [blame] | 91 | # These templates are a temporary fix fo link libc++ into shared libraries and |
| 92 | # executables. These should be removed as soon as crbug.com/746091 is resolved. |
Stephen Lanham | 4ad698a8 | 2017-07-25 21:24:51 | [diff] [blame] | 93 | foreach(target_type, |
| 94 | [ |
| 95 | "executable", |
| 96 | "shared_library", |
| 97 | "loadable_module", |
Bailey Forrest | 635cecc | 2017-11-01 01:09:40 | [diff] [blame] | 98 | "source_set", |
Stephen Lanham | 4ad698a8 | 2017-07-25 21:24:51 | [diff] [blame] | 99 | ]) { |
| 100 | template("cast_${target_type}") { |
| 101 | target(target_type, target_name) { |
| 102 | forward_variables_from(invoker, "*") |
Bailey Forrest | 635cecc | 2017-11-01 01:09:40 | [diff] [blame] | 103 | |
| 104 | configs += [ "//chromecast:cast_config" ] |
| 105 | |
Stephen Lanham | 4ad698a8 | 2017-07-25 21:24:51 | [diff] [blame] | 106 | if (!defined(deps)) { |
| 107 | deps = [] |
| 108 | } |
Bailey Forrest | 635cecc | 2017-11-01 01:09:40 | [diff] [blame] | 109 | |
| 110 | if (target_type != "source_set") { |
| 111 | deps += [ "//build/config:exe_and_shlib_deps" ] |
| 112 | } |
Stephen Lanham | bd37862 | 2017-07-20 14:29:39 | [diff] [blame] | 113 | } |
Stephen Lanham | bd37862 | 2017-07-20 14:29:39 | [diff] [blame] | 114 | } |
| 115 | } |
| 116 | |
Stephen Lanham | 4ad698a8 | 2017-07-25 21:24:51 | [diff] [blame] | 117 | # Set the defaults for each target. The defaults for these target wrappers |
| 118 | # should match their unwrapped counterparts in BUILDCONFIG.gn. The variables |
| 119 | # referenced below are declared in BUILDCONFIG.gn. |
| 120 | set_defaults("cast_executable") { |
| 121 | configs = default_executable_configs |
| 122 | } |
| 123 | |
| 124 | set_defaults("cast_shared_library") { |
| 125 | configs = default_shared_library_configs |
Doug Horn | 37635f0 | 2017-07-28 03:12:58 | [diff] [blame] | 126 | if (is_android) { |
| 127 | configs -= [ "//build/config/android:hide_all_but_jni_onload" ] |
| 128 | } |
Stephen Lanham | 4ad698a8 | 2017-07-25 21:24:51 | [diff] [blame] | 129 | } |
| 130 | |
| 131 | set_defaults("cast_loadable_module") { |
| 132 | configs = default_shared_library_configs |
| 133 | if (is_android) { |
| 134 | configs -= [ "//build/config/android:hide_all_but_jni_onload" ] |
Stephen Lanham | bd37862 | 2017-07-20 14:29:39 | [diff] [blame] | 135 | } |
| 136 | } |
Bailey Forrest | 635cecc | 2017-11-01 01:09:40 | [diff] [blame] | 137 | |
| 138 | set_defaults("cast_source_set") { |
| 139 | configs = default_compiler_configs |
| 140 | } |