summaryrefslogtreecommitdiffstats
path: root/chromium/chrome/app_shim/BUILD.gn
blob: 41d666bbd2414a40bc40d67f320b99ae38628c69 (plain)
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
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/config/mac/rules.gni")
import("//build/mac/tweak_info_plist.gni")
import("//build/util/branding.gni")

# This is the part of the shim process compiled into Chrome. It runs only
# in the shim process, after the shim finds and loads the Chrome
# Framework bundle.
source_set("app_shim") {
  sources = [
    "../app/chrome_crash_reporter_client.h",
    "app_shim_controller.h",
    "app_shim_controller.mm",
    "app_shim_delegate.h",
    "app_shim_delegate.mm",
    "chrome_main_app_mode_mac.mm",
  ]

  deps = [
    "//chrome:strings",
    "//chrome/app:command_ids",
    "//chrome/browser/ui",
    "//chrome/common",
    "//chrome/common:mojo_bindings",
    "//components/crash/content/app",
    "//components/remote_cocoa/app_shim",
    "//content/public/browser",
    "//ipc",
    "//mojo/core/embedder",
    "//ui/accelerated_widget_mac",
    "//ui/base",
  ]
}

tweak_info_plist("tweak_app_mode_loader_plist") {
  info_plist = "app_mode-Info.plist"
  args = [
    "--breakpad=0",
    "--keystone=0",
    "--scm=0",
  ]
}

mac_info_plist("app_mode_loader_plist") {
  info_plist_target = ":tweak_app_mode_loader_plist"

  executable_name = "app_mode_loader"

  extra_substitutions = [
    "APP_MODE_APP_BUNDLE_ID=$chrome_mac_bundle_id.app.@APP_MODE_SHORTCUT_ID@",
  ]
}

bundle_data("app_mode_loader_plist_bundle_data") {
  sources = get_target_outputs(":app_mode_loader_plist")

  outputs = [
    "{{bundle_resources_dir}}/app_mode-Info.plist",
  ]

  public_deps = [
    ":app_mode_loader_plist",
  ]
}

executable("app_mode_loader") {
  configs += [ "//build/config/compiler:wexit_time_destructors" ]

  sources = [
    "app_mode_loader_mac.mm",
  ]

  if (is_component_build) {
    # Loaders are installed to ~/Applications. In a component build, include
    # the absolute path to the out dir in their library search path so that
    # their components are found at launch.
    ldflags = [
      "-rpath",
      rebase_path(root_out_dir),
    ]
  }

  deps = [
    "//base",
    "//chrome/common:app_mode_app_support",
    "//chrome/common:constants",
    "//chrome/common:non_code_constants",
  ]

  libs = [
    "AppKit.framework",
    "CoreFoundation.framework",
    "Foundation.framework",
  ]
}