BUILD.gn 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  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. import("//build/config/features.gni")
  5. import("//build/config/sanitizers/sanitizers.gni")
  6. import("//build/config/ui.gni")
  7. import("//build/config/win/console_app.gni")
  8. import("//build/config/win/manifest.gni")
  9. import("//tools/grit/grit_rule.gni")
  10. import("//tools/grit/repack.gni")
  11. import("//tools/v8_context_snapshot/v8_context_snapshot.gni")
  12. if (is_android) {
  13. import("//build/config/android/config.gni")
  14. }
  15. static_library("weblayer_shell_lib") {
  16. testonly = true
  17. sources = [
  18. "app/shell_main_params.cc",
  19. "app/shell_main_params.h",
  20. "browser/shell.cc",
  21. "browser/shell.h",
  22. "common/shell_switches.cc",
  23. "common/shell_switches.h",
  24. ]
  25. if (is_android) {
  26. sources += [ "browser/shell_android.cc" ]
  27. }
  28. configs += [ "//build/config:precompiled_headers" ]
  29. public_deps = [ "//weblayer:weblayer_lib" ]
  30. deps = [
  31. ":resources",
  32. "//base",
  33. "//base:base_static",
  34. "//base/third_party/dynamic_annotations",
  35. "//net",
  36. "//net:net_resources",
  37. "//sandbox",
  38. "//skia",
  39. "//third_party/icu",
  40. "//ui/base",
  41. "//ui/base/clipboard",
  42. "//ui/base/ime/init",
  43. "//ui/display",
  44. "//ui/events:events_base",
  45. "//ui/gfx",
  46. "//ui/gfx/geometry",
  47. "//ui/gfx/ipc",
  48. "//ui/gfx/ipc/geometry",
  49. "//ui/gfx/ipc/skia",
  50. "//ui/gl",
  51. "//ui/platform_window",
  52. "//url",
  53. "//v8",
  54. "//weblayer:resources",
  55. ]
  56. if (is_linux || is_chromeos) {
  57. deps += [
  58. "//third_party/fontconfig",
  59. "//ui/gfx:test_support",
  60. ]
  61. }
  62. if (is_android) {
  63. deps += [ "//ui/android" ]
  64. }
  65. if (toolkit_views) {
  66. deps += [ "//ui/views" ]
  67. }
  68. if (use_aura) {
  69. deps += [
  70. "//ui/aura",
  71. "//ui/aura:test_support",
  72. "//ui/events",
  73. "//ui/strings",
  74. "//ui/wm",
  75. ]
  76. if (toolkit_views) {
  77. sources += [ "browser/shell_views.cc" ]
  78. deps += [
  79. "//ui/color:color_headers",
  80. "//ui/native_theme",
  81. "//ui/resources",
  82. "//ui/views:test_support",
  83. "//ui/views/controls/webview",
  84. "//ui/wm:test_support",
  85. ]
  86. }
  87. }
  88. if (is_linux || is_chromeos) {
  89. deps += [ "//build/config/freetype" ]
  90. }
  91. }
  92. grit("weblayer_shell_resources_grit") {
  93. testonly = true
  94. # External code should depend on ":resources" instead.
  95. visibility = [ ":*" ]
  96. source = "shell_resources.grd"
  97. outputs = [
  98. "grit/shell_resources.h",
  99. "weblayer_shell_resources.pak",
  100. ]
  101. }
  102. copy("copy_shell_resources") {
  103. testonly = true
  104. sources = [ "$target_gen_dir/weblayer_shell_resources.pak" ]
  105. outputs = [ "$root_out_dir/weblayer_shell_resources.pak" ]
  106. public_deps = [ ":weblayer_shell_resources_grit" ]
  107. }
  108. group("resources") {
  109. testonly = true
  110. public_deps = [ ":copy_shell_resources" ]
  111. }
  112. repack("shell_pak") {
  113. testonly = true
  114. sources = [ "$root_gen_dir/weblayer/shell/weblayer_shell_resources.pak" ]
  115. deps = [ ":resources" ]
  116. output = "$root_out_dir/weblayer_shell.pak"
  117. }
  118. repack("support_pak") {
  119. testonly = true
  120. sources = [
  121. "$root_gen_dir/components/components_resources.pak",
  122. "$root_gen_dir/components/components_resources_100_percent.pak",
  123. "$root_gen_dir/components/strings/components_chromium_strings_en-US.pak",
  124. "$root_gen_dir/components/strings/components_locale_settings_en-US.pak",
  125. "$root_gen_dir/components/strings/components_strings_en-US.pak",
  126. "$root_gen_dir/content/content_resources.pak",
  127. "$root_gen_dir/content/dev_ui_content_resources.pak",
  128. "$root_gen_dir/mojo/public/js/mojo_bindings_resources.pak",
  129. "$root_gen_dir/net/net_resources.pak",
  130. "$root_gen_dir/third_party/blink/public/resources/blink_resources.pak",
  131. "$root_gen_dir/third_party/blink/public/resources/blink_scaled_resources_100_percent.pak",
  132. "$root_gen_dir/third_party/blink/public/strings/blink_strings_en-US.pak",
  133. "$root_gen_dir/ui/resources/ui_resources_100_percent.pak",
  134. "$root_gen_dir/ui/resources/webui_generated_resources.pak",
  135. "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak",
  136. "$root_gen_dir/ui/strings/ax_strings_en-US.pak",
  137. "$root_gen_dir/ui/strings/ui_strings_en-US.pak",
  138. "$root_gen_dir/weblayer/weblayer_resources.pak",
  139. ]
  140. deps = [
  141. "//components/resources",
  142. "//components/strings",
  143. "//content:content_resources",
  144. "//content:dev_ui_content_resources",
  145. "//mojo/public/js:resources",
  146. "//net:net_resources",
  147. "//third_party/blink/public:resources",
  148. "//third_party/blink/public:scaled_resources_100_percent",
  149. "//third_party/blink/public/strings",
  150. "//ui/resources",
  151. "//ui/strings",
  152. "//weblayer:resources",
  153. ]
  154. if (toolkit_views) {
  155. deps += [ "//ui/views/resources" ]
  156. sources +=
  157. [ "$root_gen_dir/ui/views/resources/views_resources_100_percent.pak" ]
  158. }
  159. if (is_android) {
  160. deps += [ "//ui/android:ui_java_resources" ]
  161. } else {
  162. deps += [ "//content/browser/tracing:resources" ]
  163. sources += [ "$root_gen_dir/content/browser/tracing/tracing_resources.pak" ]
  164. }
  165. output = "$root_out_dir/weblayer_support.pak"
  166. }
  167. repack("pak") {
  168. testonly = true
  169. sources = [
  170. "$root_out_dir/weblayer_shell.pak",
  171. "$root_out_dir/weblayer_support.pak",
  172. ]
  173. deps = [
  174. ":shell_pak",
  175. ":support_pak",
  176. ]
  177. output = "$root_out_dir/weblayer.pak"
  178. }
  179. if (is_android) {
  180. group("weblayer_shell") {
  181. testonly = true
  182. deps = [ "//weblayer/shell/android:weblayer_shell_apk" ]
  183. }
  184. group("weblayer_support") {
  185. testonly = true
  186. deps = [ "//weblayer/shell/android:weblayer_support_apk" ]
  187. }
  188. } else {
  189. executable("weblayer_shell") {
  190. testonly = true
  191. sources = [ "app/shell_main.cc" ]
  192. if (is_win) {
  193. sources += [ "app/shell.rc" ]
  194. }
  195. defines = []
  196. deps = [
  197. ":weblayer_shell_lib",
  198. "//base",
  199. "//build/win:default_exe_manifest",
  200. "//net",
  201. ]
  202. data_deps = [
  203. ":pak",
  204. "//tools/v8_context_snapshot:v8_context_snapshot",
  205. ]
  206. if (is_win) {
  207. deps += [ "//sandbox" ]
  208. if (win_console_app) {
  209. defines += [ "WIN_CONSOLE_APP" ]
  210. } else {
  211. # Set /SUBSYSTEM:WINDOWS unless a console build has been requested.
  212. configs -= [ "//build/config/win:console" ]
  213. configs += [ "//build/config/win:windowed" ]
  214. }
  215. data_deps +=
  216. [ "//third_party/crashpad/crashpad/handler:crashpad_handler" ]
  217. }
  218. if ((is_linux || is_chromeos) && !is_component_build) {
  219. # Set rpath to find our own libfreetype even in a non-component build.
  220. configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
  221. }
  222. }
  223. }