File: BUILD.gn

package info (click to toggle)
chromium 139.0.7258.127-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 6,122,068 kB
  • sloc: cpp: 35,100,771; ansic: 7,163,530; javascript: 4,103,002; python: 1,436,920; asm: 946,517; xml: 746,709; pascal: 187,653; perl: 88,691; sh: 88,436; objc: 79,953; sql: 51,488; cs: 44,583; fortran: 24,137; makefile: 22,147; tcl: 15,277; php: 13,980; yacc: 8,984; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (182 lines) | stat: -rw-r--r-- 6,593 bytes parent folder | download | duplicates (3)
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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
# Copyright 2016 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//remoting/build/config/remoting_build.gni")
import("//remoting/host/installer/credits.gni")
import("//remoting/host/installer/win/generate_clsids.gni")
import("//remoting/host/installer/win/wix_path.gni")
import("//third_party/icu/config.gni")

remoting_credits("credits") {
  gn_target = "//remoting/host/installer/win:remoting_me2me_host_archive"
}

action("remoting_me2me_host_archive") {
  script = "//remoting/host/installer/build-installer-archive.py"

  sources = [
    # Used by build-installer-archive.py.
    "//build/zip_helpers.py",
  ]

  deps = [
    ":credits",
    "//remoting/host:remoting_native_messaging_manifests",
    "//remoting/host:remoting_start_host",
    "//remoting/host/crash:crash_tools",
    "//remoting/host/it2me:remote_assistance_host",
    "//remoting/host/it2me:remote_assistance_host_uiaccess",
    "//remoting/host/remote_open_url",
    "//remoting/host/webauthn:remote_webauthn",
    "//remoting/host/win:remoting_core",
    "//remoting/host/win:remoting_desktop",
    "//remoting/host/win:remoting_me2me_host",
    "//remoting/host/win:remoting_native_messaging_host",
    "//third_party/icu:icudata",
  ]

  public_deps = [ "//remoting/host/security_key:remote_security_key" ]

  if (target_cpu == "x86") {
    _output = "$root_out_dir/remoting-me2me-host-$target_os.zip"
  } else {
    _output = "$root_out_dir/remoting-me2me-host-$target_os-unsupported.zip"
  }

  outputs = [ _output ]
  if (is_chrome_branded) {
    _branding = "Chrome"
  } else {
    _branding = "Chromium"
  }

  if (is_official_build) {
    _official_build = "1"
  } else {
    _official_build = "0"
  }

  # Due to GN build issue http://crbug.com/633650, we need to actively set
  # inputs parameter to tell GN to depend on these files. So change to each
  # following files will trigger this target to be rebuilt.
  # TODO(zijiehe): Remove inputs parameter once bug 633650 has been
  # addressed.
  inputs = [
    "$root_out_dir/remote_assistance_host.exe",
    "$root_out_dir/remote_assistance_host_uiaccess.exe",
    "$root_out_dir/remote_open_url.exe",
    "$root_out_dir/remote_security_key.exe",
    "$root_out_dir/remote_webauthn.exe",
    "$root_out_dir/remoting_core.dll",
    "$root_out_dir/remoting_crashpad_handler.exe",
    "$root_out_dir/remoting_desktop.exe",
    "$root_out_dir/remoting_host.exe",
    "$root_out_dir/remoting_native_messaging_host.exe",
    "$root_out_dir/remoting_start_host.exe",
    "$root_gen_dir/remoting/CREDITS.txt",
    "$root_out_dir/remoting/com.google.chrome.remote_assistance.json",
    "$root_out_dir/remoting/com.google.chrome.remote_assistance-firefox.json",
    "$root_out_dir/remoting/com.google.chrome.remote_desktop.json",
    "$root_out_dir/remoting/com.google.chrome.remote_desktop-firefox.json",
    "$root_out_dir/remoting/com.google.chrome.remote_webauthn.json",
  ]
  if (icu_use_data_file) {
    inputs += [ "$root_out_dir/icudtl.dat" ]
  }

  _generated_files = rebase_path(inputs, root_build_dir)
  _generated_files +=
      [ rebase_path("//remoting/resources/chromoting.ico", root_build_dir) ]

  # Inputs that should not be part of _generated_files.
  inputs += [
    "chromoting.wxs",
    "parameters.json",
  ]

  # _generated_dst_files must contain the same files in the same order as
  # _generated_files, otherwise the Windows MSI will not be built correctly.
  _generated_dst_files = [
    "files/remote_assistance_host.exe",
    "files/remote_assistance_host_uiaccess.exe",
    "files/remote_open_url.exe",
    "files/remote_security_key.exe",
    "files/remote_webauthn.exe",
    "files/remoting_core.dll",
    "files/remoting_crashpad_handler.exe",
    "files/remoting_desktop.exe",
    "files/remoting_host.exe",
    "files/remoting_native_messaging_host.exe",
    "files/remoting_start_host.exe",
    "files/CREDITS.txt",
    "files/com.google.chrome.remote_assistance.json",
    "files/com.google.chrome.remote_assistance-firefox.json",
    "files/com.google.chrome.remote_desktop.json",
    "files/com.google.chrome.remote_desktop-firefox.json",
    "files/com.google.chrome.remote_webauthn.json",
  ]
  if (icu_use_data_file) {
    _generated_dst_files += [ "files/icudtl.dat" ]
  }
  _generated_dst_files += [ "files/chromoting.ico" ]

  args = [
           rebase_path("$root_gen_dir/remoting_installation", root_build_dir),
           rebase_path(_output, root_build_dir),
           "--source-file-roots",
           rebase_path("//remoting/host/installer/win", root_build_dir),
           "--source-files",
           rebase_path("//remoting/host/installer/win/chromoting.wxs",
                       root_build_dir),
           rebase_path("//remoting/host/installer/win/parameters.json",
                       root_build_dir),

           # Input files
           "--generated-files",
         ] + _generated_files +
         [
           # Position of files in zip file
           "--generated-files-dst",
         ] + _generated_dst_files +
         [
           # Defs
           "--defs",
           "BRANDING=$_branding",
           "RDP_DESKTOP_SESSION_CLSID={$rdp_desktop_session_clsid}",
           "VERSION=$chrome_version_full",
           "OFFICIAL_BUILD=$_official_build",
         ]
}

# We do not release a 64 bits binary. So to avoid any potential
# misunderstanding, we only build 32 bits MSI file.
# TODO(yuweih): Replace the remoting_wix_path check with is_chrome_branded once
# everyone is able to use their Google machines again, or remove the check
# altogether if we decide to build the MSI with non-official builders.
if (remoting_wix_path != "" && !is_component_build && target_cpu == "x86") {
  # The script uses "ia32" instead of "x86".
  msi_script_arch = "ia32"

  action("remoting_host_installation") {
    deps = [ "//remoting/host:remoting_me2me_host_archive" ]
    script = "//remoting/tools/zip2msi.py"
    outputs = [ "$root_out_dir/chromoting.msi" ]
    args = [
      "--wix_path",
      remoting_wix_path,
      "--intermediate_dir",
      rebase_path("$root_gen_dir/remoting_installation", root_build_dir),
      "--target_arch",
      msi_script_arch,
      rebase_path("$root_out_dir/remoting-me2me-host-$current_os.zip",
                  root_build_dir),
      rebase_path(outputs[0], root_build_dir),
    ]
  }
} else {
  group("remoting_host_installation") {
    # We still want to build host archive under other configurations.
    deps = [ "//remoting/host:remoting_me2me_host_archive" ]
  }
}