summaryrefslogtreecommitdiffstats
path: root/chromium/chrome/updater/BUILD.gn
blob: 6de5b53b6d326562ea5f3560214efa1d2e13107c (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
99
100
101
102
# Copyright 2019 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/chrome_build.gni")
import("//build/config/sanitizers/sanitizers.gni")
import("//build/util/process_version.gni")
import("//testing/test.gni")

group("updater") {
  if (is_win) {
    deps = [
      "//chrome/updater/win",
    ]
  }
  if (is_mac) {
    deps = [
      "//chrome/updater/mac",
    ]
  }
}

# Conditional build is needed, otherwise the analyze script on Linux
# requires all targets and it is going to include the targets below.
if (is_win || is_mac) {
  source_set("common") {
    sources = [
      "configurator.cc",
      "configurator.h",
      "crash_client.cc",
      "crash_client.h",
      "crash_reporter.cc",
      "crash_reporter.h",
      "installer.cc",
      "installer.h",
      "patcher.cc",
      "patcher.h",
      "prefs.cc",
      "prefs.h",
      "unzipper.cc",
      "unzipper.h",
      "updater.cc",
      "updater.h",
      "updater_constants.cc",
      "updater_constants.h",
      "util.cc",
      "util.h",
    ]

    deps = [
      ":version_header",
      "//base",
      "//components/crash/core/common:crash_key",
      "//components/prefs",
      "//components/update_client",
      "//components/version_info",
      "//courgette",
      "//third_party/crashpad/crashpad/client",
      "//third_party/crashpad/crashpad/handler",
      "//third_party/zlib/google:zip",
      "//url",
    ]
  }

  process_version("version_header") {
    sources = [
      "//chrome/VERSION",
      "BRANDING",
    ]
    template_file = "updater_version.h.in"
    output = "$target_gen_dir/updater_version.h"
  }

  source_set("updater_tests") {
    testonly = true

    sources = [
      "updater_unittest.cc",
    ]

    deps = [
      ":common",
      ":updater",
      "//base/test:test_support",
      "//testing/gtest",
    ]

    if (is_win) {
      deps += [ "//chrome/updater/win:updater_tests" ]

      data_deps = [
        "//chrome/updater/win:updater",
      ]
    }

    if (is_mac) {
      data_deps = [
        "//chrome/updater/mac:updater",
      ]
    }
  }
}