1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45
   46
   47
   48
   49
   50
   51
   52
   53
   54
   55
   56
   57
   58
   59
   60
   61
   62
   63
   64
   65
   66
   67
   68
   69
   70
   71
   72
   73
   74
   75
   76
   77
   78
   79
   80
   81
   82
   83
   84
   85
   86
   87
   88
   89
   90
   91
   92
   93
   94
   95
   96
   97
   98
   99
  100
  101
  102
  103
  104
  105
  106
  107
  108
  109
  110
  111
  112
  113
  114
  115
  116
  117
  118
  119
  120
  121
  122
  123
  124
  125
  126
  127
  128
  129
  130
  131
  132
  133
  134
  135
  136
  137
  138
  139
  140
  141
  142
  143
  144
  145
  146
  147
  148
  149
  150
  151
  152
  153
  154
  155
  156
  157
  158
  159
  160
  161

content / app / BUILD.gn [blame]

# Copyright 2014 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/config/chrome_build.gni")
import("//build/config/chromeos/ui_mode.gni")
import("//build/config/features.gni")
import("//ppapi/buildflags/buildflags.gni")
import("//third_party/tflite/features.gni")

extra_configs = [
  "//build/config/compiler:wexit_time_destructors",
  "//content:content_implementation",
  "//v8:external_startup_data",
]

content_app_deps = [
  "//base",
  "//base:i18n",
  "//content:export",
  "//content:sandbox_helper_win",
  "//content/public/common:common_sources",
  "//crypto",
  "//mojo/core/embedder",
  "//mojo/public/cpp/platform",
  "//ppapi/buildflags",
  "//services/tracing/public/cpp",
  "//ui/base",
  "//ui/gfx",
  "//ui/gfx/geometry",
]

if (is_win) {
  content_app_deps += [ "//sandbox" ]
} else if (is_android) {
  # Many of these are required for JNI registration.
  content_app_deps += [
    "//content/browser",
    "//content/child",
    "//content/public/android:content_app_jni",
    "//device/bluetooth",
    "//device/gamepad",
    "//gpu",
    "//media",
    "//media/capture",
    "//media/midi",
    "//net",
    "//skia",
    "//third_party/cpu_features:ndk_compat",
    "//ui/android",
    "//ui/events",
    "//ui/shell_dialogs",
  ]
}

if (is_ios) {
  content_app_deps += [ "//content/app/ios/appex:child_process_bridge" ]
}

if (enable_ppapi) {
  content_app_deps += [ "//content/ppapi_plugin:ppapi_plugin_sources" ]
}

# Compile content_main_runner_impl.[h, cc] in a separate target to exempt from
# GN header checking without exempting any other source file. These files
# includes headers of all process types and varies significantly per platform
# in between browser and child. Otherwise it would require many "nogncheck"
# annotations that would both be useless and add noise.
source_set("content_main_runner_app") {
  visibility = [ ":app" ]
  check_includes = false

  sources = [
    "content_main_runner_impl.cc",
    "content_main_runner_impl.h",
  ]

  configs += extra_configs
  deps = content_app_deps + [
           "//components/power_monitor",
           "//content/browser",
           "//content/gpu:gpu_sources",
           "//content/public/browser:browser_sources",
           "//content/public/gpu:gpu_sources",
           "//content/public/renderer:renderer_sources",
           "//content/public/utility:utility_sources",
           "//content/renderer",
           "//content/utility",
           "//content/zygote",
           "//third_party/tflite:buildflags",
           "//tools/v8_context_snapshot:buildflags",
         ]
  if (is_chromeos_lacros) {
    deps += [
      "//chromeos/startup",
      "//chromeos/startup:constants",
    ]
  }
  if (build_tflite_with_xnnpack) {
    deps += [ "//third_party/cpuinfo" ]
  }
}

source_set("app") {
  # TODO(thakis): The comment above content_main_runner_app suggests this
  # line shouldn't be here; try removing it.
  check_includes = false

  sources = [
    "content_main.cc",
    "initialize_mojo_core.cc",
    "mojo/mojo_init.cc",
    "mojo/mojo_init.h",
    "mojo_ipc_support.cc",
    "mojo_ipc_support.h",
  ]

  configs += extra_configs
  deps = content_app_deps + [ "//ipc" ]

  public_deps = [ ":content_main_runner_app" ]

  # Only the public target should depend on this. All other targets (even
  # internal content ones) should depend on the public one.
  visibility = [
    ":for_content_tests",  # See top of //content/BUILD.gn for why.
    "//content/public/app:*",
  ]

  if (is_android) {
    sources += [
      "android/content_child_process_service_delegate.cc",
      "android/content_jni_onload.cc",
      "android/content_main_android.cc",
      "android/content_main_android.h",
      "android/library_loader_hooks.cc",
      "android/library_loader_hooks.h",
    ]
    deps += [
      "//mojo/public/java/system:native_support",
      "//ui/gl",
    ]
  }

  if (is_mac) {
    sources += [
      "mac_init.h",
      "mac_init.mm",
    ]

    frameworks = [ "Foundation.framework" ]
  }
}

# See comment at the top of //content/BUILD.gn for how this works.
group("for_content_tests") {
  visibility = [ "//content/test/*" ]
  if (!is_component_build) {
    public_deps = [ ":app" ]
  }
}