John Abd-El-Malek | 402a13f | 2019-08-23 07:06:40 | [diff] [blame] | 1 | # Copyright 2019 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 | |
| 5 | import("//build/config/features.gni") |
| 6 | import("//build/config/sanitizers/sanitizers.gni") |
| 7 | import("//build/config/ui.gni") |
| 8 | import("//build/config/win/console_app.gni") |
| 9 | import("//build/config/win/manifest.gni") |
| 10 | import("//gpu/vulkan/features.gni") |
| 11 | import("//media/media_options.gni") |
| 12 | import("//mojo/public/tools/bindings/mojom.gni") |
| 13 | import("//tools/grit/grit_rule.gni") |
| 14 | import("//tools/grit/repack.gni") |
| 15 | import("//tools/v8_context_snapshot/v8_context_snapshot.gni") |
| 16 | if (is_android) { |
| 17 | import("//build/config/android/config.gni") |
| 18 | } else if (is_mac) { |
| 19 | import("//build/config/mac/rules.gni") |
| 20 | import("//build/mac/tweak_info_plist.gni") |
| 21 | import("//content/public/app/mac_helpers.gni") |
| 22 | import("//third_party/icu/config.gni") |
| 23 | import("//ui/gl/features.gni") |
| 24 | import("//v8/gni/v8.gni") |
| 25 | } |
| 26 | |
| 27 | source_set("android_descriptors") { |
| 28 | sources = [ |
| 29 | "browser/android_descriptors.h", |
| 30 | ] |
| 31 | public_deps = [ |
| 32 | "//content/public/common:content_descriptors", |
| 33 | ] |
| 34 | } |
| 35 | |
| 36 | jumbo_static_library("weblayer_lib") { |
| 37 | sources = [ |
John Abd-El-Malek | c0b023c | 2019-08-24 20:46:29 | [diff] [blame] | 38 | "app/content_main_delegate_impl.cc", |
| 39 | "app/content_main_delegate_impl.h", |
| 40 | "app/main.cc", |
| 41 | "browser/browser_controller_impl.cc", |
| 42 | "browser/browser_controller_impl.h", |
| 43 | "browser/browser_main_parts_impl.cc", |
| 44 | "browser/browser_main_parts_impl.h", |
| 45 | "browser/content_browser_client_impl.cc", |
| 46 | "browser/content_browser_client_impl.h", |
| 47 | "browser/navigation_controller_impl.cc", |
| 48 | "browser/navigation_controller_impl.h", |
| 49 | "browser/profile_impl.cc", |
| 50 | "browser/profile_impl.h", |
| 51 | "common/content_client_impl.cc", |
| 52 | "common/content_client_impl.h", |
| 53 | "public/browser_controller.h", |
| 54 | "public/main.h", |
John Abd-El-Malek | 795fbea | 2019-08-23 21:57:31 | [diff] [blame] | 55 | "public/navigation.h", |
John Abd-El-Malek | c0b023c | 2019-08-24 20:46:29 | [diff] [blame] | 56 | "public/navigation_controller.h", |
John Abd-El-Malek | 795fbea | 2019-08-23 21:57:31 | [diff] [blame] | 57 | "public/navigation_observer.h", |
John Abd-El-Malek | c0b023c | 2019-08-24 20:46:29 | [diff] [blame] | 58 | "public/profile.h", |
John Abd-El-Malek | 402a13f | 2019-08-23 07:06:40 | [diff] [blame] | 59 | ] |
| 60 | |
| 61 | configs += [ |
| 62 | "//build/config:precompiled_headers", |
| 63 | |
| 64 | # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. |
| 65 | "//build/config/compiler:no_size_t_to_int_warning", |
| 66 | ] |
| 67 | |
| 68 | public_deps = [ |
| 69 | ":android_descriptors", |
| 70 | ] |
| 71 | deps = [ |
| 72 | "//base", |
| 73 | "//base:base_static", |
| 74 | "//base/third_party/dynamic_annotations", |
| 75 | "//cc", |
| 76 | "//content:resources", |
| 77 | "//content/app/resources", |
| 78 | "//content/app/strings", |
| 79 | "//content/public/app:both", |
Reid Kleckner | 06e12bf | 2019-08-23 20:54:23 | [diff] [blame] | 80 | "//content/public/child:child", |
John Abd-El-Malek | 402a13f | 2019-08-23 07:06:40 | [diff] [blame] | 81 | "//content/public/common", |
| 82 | "//content/public/common:service_names", |
John Abd-El-Malek | 402a13f | 2019-08-23 07:06:40 | [diff] [blame] | 83 | "//net", |
| 84 | "//net:net_resources", |
| 85 | "//sandbox", |
| 86 | "//skia", |
| 87 | "//third_party/icu", |
| 88 | "//ui/base", |
| 89 | "//ui/base/clipboard", |
| 90 | "//ui/base/ime/init", |
| 91 | "//ui/display", |
| 92 | "//ui/events:events_base", |
| 93 | "//ui/gfx", |
| 94 | "//ui/gfx/geometry", |
| 95 | "//ui/gfx/ipc", |
| 96 | "//ui/gfx/ipc/geometry", |
| 97 | "//ui/gfx/ipc/skia", |
| 98 | "//ui/gl", |
| 99 | "//ui/platform_window", |
| 100 | "//url", |
| 101 | "//v8", |
| 102 | ] |
| 103 | |
| 104 | if (enable_vulkan) { |
| 105 | deps += [ "//gpu/vulkan/init" ] |
| 106 | } |
| 107 | if (mojo_media_host == "browser") { |
| 108 | deps += [ |
| 109 | "//media/mojo/mojom:constants", |
| 110 | "//media/mojo/services", |
| 111 | ] |
| 112 | } |
| 113 | |
| 114 | if (is_win) { |
| 115 | deps += [ "//content:sandbox_helper_win" ] |
Reid Kleckner | 06e12bf | 2019-08-23 20:54:23 | [diff] [blame] | 116 | if (win_console_app) { |
| 117 | defines = [ "WIN_CONSOLE_APP" ] |
| 118 | } |
John Abd-El-Malek | 402a13f | 2019-08-23 07:06:40 | [diff] [blame] | 119 | } |
| 120 | |
| 121 | if (is_linux) { |
| 122 | deps += [ |
| 123 | "//build/config/freetype", |
| 124 | "//third_party/fontconfig", |
| 125 | ] |
| 126 | } |
| 127 | |
| 128 | if (is_android) { |
| 129 | deps += [ |
Bo Liu | 7e22c0a | 2019-08-26 21:44:28 | [diff] [blame^] | 130 | ":weblayer_jni", |
John Abd-El-Malek | 402a13f | 2019-08-23 07:06:40 | [diff] [blame] | 131 | "//components/embedder_support/android:view", |
| 132 | "//ui/android", |
| 133 | ] |
| 134 | } |
| 135 | |
| 136 | if (toolkit_views) { |
| 137 | deps += [ "//ui/views" ] |
| 138 | } |
| 139 | |
| 140 | if (use_aura) { |
| 141 | deps += [ |
| 142 | "//ui/aura", |
| 143 | "//ui/events", |
| 144 | "//ui/strings", |
| 145 | "//ui/wm", |
| 146 | ] |
| 147 | } |
| 148 | } |
Bo Liu | 7e22c0a | 2019-08-26 21:44:28 | [diff] [blame^] | 149 | |
John Abd-El-Malek | 402a13f | 2019-08-23 07:06:40 | [diff] [blame] | 150 | # TODO(jam): move weblayer_shell_resources_grit and copy_shell_resources here in |
| 151 | # a way that's shareable? |
Bo Liu | 7e22c0a | 2019-08-26 21:44:28 | [diff] [blame^] | 152 | |
| 153 | if (is_android) { |
| 154 | shared_library("libweblayer") { |
| 155 | sources = [ |
| 156 | "app/jni_onload.cc", |
| 157 | ] |
| 158 | deps = [ |
| 159 | ":weblayer_lib", |
| 160 | "//base", |
| 161 | "//content/public/app:both", |
| 162 | ] |
| 163 | configs -= [ "//build/config/android:hide_all_but_jni_onload" ] |
| 164 | configs += [ "//build/config/android:hide_all_but_jni" ] |
| 165 | } |
| 166 | |
| 167 | generate_jni("weblayer_jni") { |
| 168 | sources = [ |
| 169 | "browser/java/org/chromium/weblayer/BrowserController.java", |
| 170 | "browser/java/org/chromium/weblayer/Profile.java", |
| 171 | ] |
| 172 | } |
| 173 | |
| 174 | android_library("weblayer_java") { |
| 175 | java_files = [ |
| 176 | "browser/java/org/chromium/weblayer/BrowserController.java", |
| 177 | "browser/java/org/chromium/weblayer/Profile.java", |
| 178 | ] |
| 179 | deps = [ |
| 180 | "//base:base_java", |
| 181 | "//content/public/android:content_java", |
| 182 | "//ui/android:ui_java", |
| 183 | ] |
| 184 | } |
| 185 | } |