summaryrefslogtreecommitdiff
path: root/chromium/device/gamepad/public/cpp/BUILD.gn
blob: aff9913b94e1f354ec9d5a39a15d08c559027d95 (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
# Copyright 2017 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.

# This target contains only those files that are shared by the Device Gamepad
# implementation and all Device Gamepad clients, including Blink. Add a file
# here only if it meets the following constraints:
# (1) It is *necessary* to use the file to consume Device Gamepad (the
# current files define structs that are used as a consistent interpretation of
# shared memory by the Device Gamepad and its clients).
# (2) The file has no dependencies on the STL or Chromium code and will not
# grow them over time (the current files are POD structs and will necessarily
# stay that way due to their above-described purpose).
# Consult {platform-architecture-dev, services-dev}@chromium.org in the case
# of any uncertainty.
component("shared_with_blink") {
  sources = [
    "gamepad.cc",
    "gamepad.h",
    "gamepads.cc",
    "gamepads.h",
  ]

  # Do not add deps here per the above comment.
  defines = [ "IS_GAMEPAD_PUBLIC_IMPL" ]
  public_deps = [ "//base" ]
}

# Normally typemap traits sources should be build directly into mojom targets
# via the typemap file. This target is for typemapped types whose
# traits are shared between chromium and blink variants.
component("shared_typemap_traits") {
  output_name = "gamepad_shared_typemap_traits"

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

  defines = [ "IS_GAMEPAD_SHARED_TRAITS_IMPL" ]

  public_deps = [
    ":shared_with_blink",
    "//base",
    "//device/gamepad/public/mojom:mojom_shared",
  ]
}

static_library("switches") {
  sources = [
    "gamepad_features.cc",
    "gamepad_features.h",
    "gamepad_switches.cc",
    "gamepad_switches.h",
  ]

  public_deps = [ "//base" ]
}