summaryrefslogtreecommitdiffstats
path: root/cloud_print/service/BUILD.gn
blob: c7b73161df91f2cdd94eebb7088d11dbf08afe62 (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
# 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/features.gni")
import("//tools/grit/grit_rule.gni")

config("internal_config") {
  defines = [
    "SECURITY_WIN32",
    "STRICT",
    "_ATL_APARTMENT_THREADED",
    "_ATL_CSTRING_EXPLICIT_CONSTRUCTORS",
    "_ATL_NO_COM_SUPPORT",
    "_ATL_NO_AUTOMATIC_NAMESPACE",
    "_ATL_NO_EXCEPTIONS",
  ]
}

if (is_win && is_clang) {
  # service_controller.h uses DECLARE_REGISTRY_APPID_RESOURCEID, which
  # in msvs2013 returns string literals via a non-const pointer. So
  # disable this warning for now.
  # TODO(thakis): Remove this once we're on 2014,
  # https://connect.microsoft.com/VisualStudio/feedback/details/806376/atl-hindrances-to-adopting-new-strictstrings-conformance-option-in-vs2013
  config("service_warning_config") {
    cflags = [ "-Wno-writable-strings" ]
  }
}

source_set("lib") {
  sources = [
    "service_constants.cc",
    "service_constants.h",
    "service_state.cc",
    "service_state.h",
    "service_switches.cc",
    "service_switches.h",
    "win/chrome_launcher.cc",
    "win/chrome_launcher.h",
    "win/local_security_policy.cc",
    "win/local_security_policy.h",
    "win/service_controller.cc",
    "win/service_controller.h",
    "win/service_listener.cc",
    "win/service_listener.h",
    "win/service_utils.cc",
    "win/service_utils.h",
    "win/setup_listener.cc",
    "win/setup_listener.h",
  ]

  configs += [
    ":internal_config",
    "//build/config/compiler:wexit_time_destructors",
  ]

  deps = [
    ":resources",
    "//base",
    "//base:base_static",
    "//base/third_party/dynamic_annotations",
    "//chrome/common:constants",
    "//cloud_print/common",
    "//components/browser_sync/common",
    "//components/cloud_devices/common",
    "//content/public/common:static_switches",
    "//google_apis",
    "//ipc",
    "//net",
    "//url",
  ]

  if (enable_basic_printing || enable_print_preview) {
    deps += [ "//printing" ]
  }

  if (is_win) {
    deps += [
      "//chrome/common:constants",
      "//chrome/installer/launcher_support",
    ]
  }

  if (is_clang) {
    cflags = [ "-Wno-parentheses" ]
    if (is_win) {
      public_configs = [ ":service_warning_config" ]
    }
  }
}

grit("resources") {
  source = "win/service_resources.grd"
  outputs = [
    "resources.h",
    "service_resources_en.rc",
  ]
}