summaryrefslogtreecommitdiffstats
path: root/cc/proto/BUILD.gn
blob: 60952ac69469e6a620c6ebd0a95ee7c804f6aa13 (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
# 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("//third_party/protobuf/proto_library.gni")

# Use a group here to allow external targets to depend on "cc/proto" instead of
# cc/proto:cc_proto.  We need a group because other component targets are named
# "proto" which breaks component builds.  A group doesn't have the same issue.
group("proto") {
  public_deps = [
    ":cc_proto",
  ]
}

component("cc_proto") {
  # Only expose the target to the "proto" group.
  visibility = [ ":proto" ]

  public_deps = [
    ":proto_internal",
  ]
}

proto_library("proto_internal") {
  # Only expose the target to the "cc_proto" target.
  visibility = [ ":cc_proto" ]

  sources = [
    # TODO(dtrainor): Move protos to their correct packages once it's possible
    # to include protos from other directories/targets (crbug.com/542423).
    "commit_earlyout_reason.proto",
    "compositor_message.proto",
    "display_item.proto",
    "display_list_recording_source.proto",
    "layer.proto",
    "layer_position_constraint.proto",
    "layer_selection_bound.proto",
    "layer_tree_debug_state.proto",
    "layer_tree_host.proto",
    "layer_tree_settings.proto",
    "managed_memory_policy.proto",
    "memory_allocation.proto",
    "point.proto",
    "point3f.proto",
    "pointf.proto",
    "property_tree.proto",
    "rect.proto",
    "rectf.proto",
    "region.proto",
    "renderer_settings.proto",
    "scroll_offset.proto",
    "size.proto",
    "sizef.proto",
    "skregion.proto",
    "skrrect.proto",
    "skxfermode.proto",
    "transform.proto",
    "vector2df.proto",
  ]

  deps = [
    "//third_party/protobuf:protobuf_lite",
  ]

  cc_generator_options = "dllexport_decl=CC_PROTO_EXPORT:"
  cc_include = "cc/proto/cc_proto_export.h"

  defines = [ "CC_PROTO_IMPLEMENTATION" ]

  # Warn if clang creates exit destructors.
  extra_configs = [ "//build/config/compiler:wexit_time_destructors" ]
}