jamescook | 6211792 | 2014-10-20 14:35:11 | [diff] [blame] | 1 | # Copyright 2014 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 | |
rockot | 466cf20 | 2015-02-13 23:03:36 | [diff] [blame] | 5 | import("//extensions/shell/app_shell.gni") |
| 6 | |
brettw | ded2632 | 2014-11-06 06:39:59 | [diff] [blame] | 7 | # Technically, this directory should not depend on files from src/chrome, but |
| 8 | # that's where the VERSION file is. This should probably all be moved to |
| 9 | # src/build. |
| 10 | import("//chrome/version.gni") |
rockot | 466cf20 | 2015-02-13 23:03:36 | [diff] [blame] | 11 | import("//testing/test.gni") |
jamescook | 6211792 | 2014-10-20 14:35:11 | [diff] [blame] | 12 | import("//tools/grit/grit_rule.gni") |
| 13 | |
thestig | da556af | 2014-11-01 00:51:31 | [diff] [blame] | 14 | assert(enable_extensions) |
| 15 | |
jamescook | 6211792 | 2014-10-20 14:35:11 | [diff] [blame] | 16 | grit("resources") { |
| 17 | source = "app_shell_resources.grd" |
| 18 | outputs = [ |
| 19 | "grit/app_shell_resources.h", |
| 20 | "app_shell_resources.pak", |
| 21 | ] |
| 22 | } |
mukai | a3cb150 | 2014-10-29 06:43:08 | [diff] [blame] | 23 | |
| 24 | source_set("app_shell_lib") { |
jamescook | bbbff42 | 2014-12-02 22:03:53 | [diff] [blame] | 25 | # TODO(jamescook): investigate and get rid of test dependencies. This library |
| 26 | # is testonly because it depends on testonly libraries, namely |
| 27 | # //content/shell:content_shell_lib. See http://crbug.com/438283 |
mukai | a3cb150 | 2014-10-29 06:43:08 | [diff] [blame] | 28 | testonly = true |
| 29 | deps = [ |
| 30 | ":resources", |
| 31 | ":version_header", |
| 32 | "//base", |
jamescook | bbbff42 | 2014-12-02 22:03:53 | [diff] [blame] | 33 | "//base:prefs", |
dgozman | f720015 | 2015-04-22 17:48:21 | [diff] [blame] | 34 | "//components/devtools_discovery", |
dgozman | 102fee9 | 2015-04-20 15:45:46 | [diff] [blame] | 35 | "//components/devtools_http_handler", |
fsamuel | af5bf6d | 2015-05-28 16:29:54 | [diff] [blame] | 36 | "//components/guest_view/browser", |
| 37 | "//components/guest_view/common", |
| 38 | "//components/guest_view/renderer", |
mukai | a3cb150 | 2014-10-29 06:43:08 | [diff] [blame] | 39 | "//components/pref_registry", |
sorin | 39eab2f | 2015-01-06 01:09:08 | [diff] [blame] | 40 | "//components/update_client", |
mukai | a3cb150 | 2014-10-29 06:43:08 | [diff] [blame] | 41 | "//components/user_prefs", |
| 42 | "//components/web_cache/renderer", |
| 43 | "//content", |
| 44 | "//content/shell:content_shell_lib", |
| 45 | "//device/core", |
| 46 | "//device/hid", |
| 47 | "//extensions/common/api", |
| 48 | "//extensions/common/api:api_registration", |
| 49 | "//extensions/browser", |
| 50 | "//extensions/common", |
| 51 | "//extensions/renderer", |
| 52 | "//extensions/shell/common/api", |
| 53 | "//extensions/shell/common/api:api_registration", |
rockot | 3813023 | 2014-11-06 18:50:01 | [diff] [blame] | 54 | "//extensions/utility", |
mukai | a3cb150 | 2014-10-29 06:43:08 | [diff] [blame] | 55 | "//extensions:extensions_resources", |
| 56 | "//extensions:shell_and_test_pak", |
mukai | a3cb150 | 2014-10-29 06:43:08 | [diff] [blame] | 57 | "//mojo/environment:chromium", |
| 58 | "//skia", |
| 59 | "//third_party/WebKit/public:blink", |
blundell | 70fb547 | 2015-01-19 17:18:33 | [diff] [blame] | 60 | "//third_party/mojo/src/mojo/edk/system", |
spang | 1c36fac | 2015-02-05 19:55:12 | [diff] [blame] | 61 | "//ui/base", |
| 62 | "//ui/base/ime", |
mukai | a3cb150 | 2014-10-29 06:43:08 | [diff] [blame] | 63 | "//v8", |
| 64 | ] |
rockot | 466cf20 | 2015-02-13 23:03:36 | [diff] [blame] | 65 | |
| 66 | sources = rebase_path(app_shell_gypi_values.app_shell_lib_sources, |
| 67 | ".", |
| 68 | "//extensions/shell") |
| 69 | |
| 70 | if (use_aura) { |
| 71 | deps += [ "//ui/wm" ] |
| 72 | |
| 73 | aura_sources = rebase_path(app_shell_gypi_values.app_shell_lib_sources_aura, |
| 74 | ".", |
| 75 | "//extensions/shell") |
| 76 | sources += aura_sources |
| 77 | } |
| 78 | |
mukai | a3cb150 | 2014-10-29 06:43:08 | [diff] [blame] | 79 | if (is_chromeos) { |
| 80 | deps += [ |
| 81 | "//chromeos", |
| 82 | "//ui/chromeos:ui_chromeos", |
| 83 | "//ui/display", |
| 84 | ] |
rockot | 466cf20 | 2015-02-13 23:03:36 | [diff] [blame] | 85 | chromeos_sources = |
| 86 | rebase_path(app_shell_gypi_values.app_shell_lib_sources_chromeos, |
| 87 | ".", |
| 88 | "//extensions/shell") |
| 89 | sources += chromeos_sources |
| 90 | } |
| 91 | |
| 92 | # TODO(GYP): Enable this when //components/nacl GN is done. See |
| 93 | # http://crbug.com/430602 |
| 94 | if (false) { |
| 95 | if (enable_nacl) { |
| 96 | if (is_linux) { |
| 97 | deps += [ "//components/nacl:nacl_helper" ] |
| 98 | } |
| 99 | deps += [ |
| 100 | "//components/nacl", |
| 101 | "//components/nacl:browser", |
| 102 | "//components/nacl:common", |
| 103 | "//components/nacl:renderer", |
| 104 | "//components/nacl:switches", |
| 105 | ] |
| 106 | nacl_sources = |
| 107 | rebase_path(app_shell_gypi_values.app_shell_lib_sources_nacl, |
| 108 | ".", |
| 109 | "//extensions/shell") |
| 110 | sources += nacl_sources |
| 111 | } |
mukai | a3cb150 | 2014-10-29 06:43:08 | [diff] [blame] | 112 | } |
dpranke | 6065cf7 | 2015-02-26 03:30:58 | [diff] [blame] | 113 | |
| 114 | if (enable_nacl) { |
| 115 | sources += [ |
| 116 | "browser/shell_nacl_browser_delegate.cc", |
| 117 | "browser/shell_nacl_browser_delegate.h", |
| 118 | ] |
| 119 | |
| 120 | deps += [ |
| 121 | "//components/nacl", |
| 122 | "//components/nacl:nacl_browser", |
| 123 | "//components/nacl:nacl_common", |
| 124 | "//components/nacl:nacl_renderer", |
| 125 | "//components/nacl:nacl_switches", |
| 126 | "//components/nacl/renderer/plugin:nacl_trusted_plugin", |
| 127 | ] |
| 128 | |
| 129 | if (is_linux) { |
| 130 | deps += [ "//components/nacl:nacl_helper" ] |
| 131 | } |
| 132 | } |
mukai | a3cb150 | 2014-10-29 06:43:08 | [diff] [blame] | 133 | } |
| 134 | |
brettw | 4897a61 | 2015-03-02 23:13:15 | [diff] [blame] | 135 | if (!(is_chromeos && !use_ozone)) { |
brettw | ded2632 | 2014-11-06 06:39:59 | [diff] [blame] | 136 | executable("app_shell") { |
dpranke | 6fc75b3 | 2014-11-04 00:04:03 | [diff] [blame] | 137 | # testonly because :app_shell_lib is testonly. See :app_shell_lib comment. |
| 138 | testonly = true |
rockot | 466cf20 | 2015-02-13 23:03:36 | [diff] [blame] | 139 | sources = rebase_path(app_shell_gypi_values.app_shell_sources, |
| 140 | ".", |
| 141 | "//extensions/shell") |
brettw | ded2632 | 2014-11-06 06:39:59 | [diff] [blame] | 142 | deps = [ |
| 143 | ":app_shell_lib", |
| 144 | "//extensions:shell_and_test_pak", |
| 145 | ] |
vchigrin | 61944ae | 2015-01-30 23:51:32 | [diff] [blame] | 146 | |
| 147 | if (is_win) { |
| 148 | configs += [ "//build/config/win:windowed" ] |
| 149 | configs -= [ "//build/config/win:console" ] |
rockot | 466cf20 | 2015-02-13 23:03:36 | [diff] [blame] | 150 | deps += [ "//base/allocator" ] |
vchigrin | 61944ae | 2015-01-30 23:51:32 | [diff] [blame] | 151 | } |
rockot | 466cf20 | 2015-02-13 23:03:36 | [diff] [blame] | 152 | |
| 153 | if (is_mac) { |
| 154 | # TODO(GYP): Mac bundling |
| 155 | } |
| 156 | } |
| 157 | } |
| 158 | |
| 159 | test("app_shell_unittests") { |
| 160 | sources = rebase_path(app_shell_gypi_values.app_shell_unittests_sources, |
| 161 | ".", |
| 162 | "//extensions/shell") |
| 163 | |
| 164 | deps = [ |
| 165 | ":app_shell_lib", |
| 166 | "//base", |
| 167 | "//base/test:test_support", |
| 168 | "//content/test:test_support", |
| 169 | "//extensions:shell_and_test_pak", |
| 170 | "//extensions:test_support", |
| 171 | "//testing/gtest", |
| 172 | ] |
| 173 | |
| 174 | if (use_aura) { |
| 175 | deps += [ "//ui/aura:test_support" ] |
| 176 | |
| 177 | aura_sources = |
| 178 | rebase_path(app_shell_gypi_values.app_shell_unittests_sources_aura, |
| 179 | ".", |
| 180 | "//extensions/shell") |
| 181 | sources += aura_sources |
| 182 | } |
| 183 | |
| 184 | if (is_chromeos) { |
| 185 | deps += [ "//chromeos:test_support_without_gmock" ] |
| 186 | |
| 187 | chromeos_sources = |
| 188 | rebase_path(app_shell_gypi_values.app_shell_unittests_sources_chromeos, |
| 189 | ".", |
| 190 | "//extensions/shell") |
| 191 | sources += chromeos_sources |
| 192 | } |
| 193 | |
| 194 | # TODO(GYP): Enable this when //components/nacl GN is done. |
| 195 | if (false) { |
| 196 | if (use_nacl) { |
| 197 | nacl_sources = |
| 198 | rebase_path(app_shell_gypi_values.app_shell_unittests_sources_nacl, |
| 199 | ".", |
| 200 | "//extensions/shell") |
| 201 | sources += nacl_sources |
| 202 | } |
| 203 | } |
| 204 | |
| 205 | if (is_win) { |
| 206 | deps += [ "//base/allocator" ] |
brettw | ded2632 | 2014-11-06 06:39:59 | [diff] [blame] | 207 | } |
mukai | a3cb150 | 2014-10-29 06:43:08 | [diff] [blame] | 208 | } |
| 209 | |
brettw | ded2632 | 2014-11-06 06:39:59 | [diff] [blame] | 210 | process_version("version_header") { |
brettw | 70d2f6e | 2015-02-25 18:46:53 | [diff] [blame] | 211 | template_file = "common/version.h.in" |
brettw | ded2632 | 2014-11-06 06:39:59 | [diff] [blame] | 212 | output = "$target_gen_dir/common/version.h" |
mukai | a3cb150 | 2014-10-29 06:43:08 | [diff] [blame] | 213 | } |