OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 { | 5 { |
6 'variables': { | 6 'variables': { |
7 # This library should build cleanly with the extra warnings turned on | 7 # This library should build cleanly with the extra warnings turned on |
8 # for Chromium. | 8 # for Chromium. |
9 'chromium_code': 1, | 9 'chromium_code': 1, |
10 # The root directory for the proto files. | 10 # The root directory for the proto files. |
11 'proto_dir_root': 'files/src', | 11 'proto_dir_root': 'files/src', |
12 # The relative path of the cacheinvalidation proto files from | 12 # The relative path of the cacheinvalidation proto files from |
13 # proto_dir_root. | 13 # proto_dir_root. |
14 # TODO(akalin): Add a RULE_INPUT_DIR predefined variable to gyp so | 14 # TODO(akalin): Add a RULE_INPUT_DIR predefined variable to gyp so |
15 # we don't need this variable. | 15 # we don't need this variable. |
16 # TODO(ghc): Remove v2/ dir and move all files up a level. | 16 # TODO(ghc): Remove v2/ dir and move all files up a level. |
17 'proto_dir_relpath': 'google/cacheinvalidation/v2', | 17 'proto_dir_relpath': 'google/cacheinvalidation/v2', |
| 18 # Where files generated from proto files are put. |
| 19 'protoc_out_dir': '<(SHARED_INTERMEDIATE_DIR)/protoc_out', |
| 20 # The path to the protoc executable. |
| 21 'protoc': '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)protoc<(EXECUTABLE_SUFFIX)', |
18 }, | 22 }, |
19 'targets': [ | 23 'targets': [ |
20 # The rule/action to generate files from the cacheinvalidation proto | 24 # The rule/action to generate files from the cacheinvalidation proto |
21 # files and package them into a static library. | 25 # files. |
22 { | 26 { |
23 'target_name': 'cacheinvalidation_proto', | 27 'target_name': 'cacheinvalidation_proto', |
24 'type': 'static_library', | 28 'type': 'none', |
25 'sources': [ | 29 'sources': [ |
26 '<(proto_dir_root)/<(proto_dir_relpath)/client.proto', | 30 '<(proto_dir_root)/<(proto_dir_relpath)/client.proto', |
27 '<(proto_dir_root)/<(proto_dir_relpath)/client_gateway.proto', | 31 '<(proto_dir_root)/<(proto_dir_relpath)/client_gateway.proto', |
28 '<(proto_dir_root)/<(proto_dir_relpath)/client_protocol.proto', | 32 '<(proto_dir_root)/<(proto_dir_relpath)/client_protocol.proto', |
29 '<(proto_dir_root)/<(proto_dir_relpath)/client_test_internal.proto', | 33 '<(proto_dir_root)/<(proto_dir_relpath)/client_test_internal.proto', |
30 '<(proto_dir_root)/<(proto_dir_relpath)/types.proto', | 34 '<(proto_dir_root)/<(proto_dir_relpath)/types.proto', |
31 ], | 35 ], |
32 'variables': { | 36 # TODO(akalin): This block was copied from the sync_proto target |
33 'proto_in_dir': '<(proto_dir_root)', | 37 # from chrome.gyp. Decomp the shared blocks out somehow. |
34 'proto_out_dir': '', | 38 'rules': [ |
35 'proto_relpath': '<(proto_dir_relpath)/', | 39 { |
36 # This is necessary because these protos import with | 40 'rule_name': 'genproto', |
37 # qualified paths, such as: | 41 'extension': 'proto', |
38 # #import "google/cacheinvalidation/v2/client_protocol.proto" | 42 'inputs': [ |
39 # rather than the more common form of: | 43 '<(protoc)', |
40 # #import "client_protocol.proto" | 44 ], |
41 # NOTE: The trailing slash is required, see build/protoc.gypi | 45 'outputs': [ |
| 46 '<(protoc_out_dir)/<(proto_dir_relpath)/<(RULE_INPUT_ROOT).pb.h', |
| 47 '<(protoc_out_dir)/<(proto_dir_relpath)/<(RULE_INPUT_ROOT).pb.cc', |
| 48 ], |
| 49 'action': [ |
| 50 '<(protoc)', |
| 51 '--proto_path=<(proto_dir_root)', |
| 52 # This path needs to be prefixed by proto_path, so we can't |
| 53 # use RULE_INPUT_PATH (which is an absolute path). |
| 54 '<(proto_dir_root)/<(proto_dir_relpath)/<(RULE_INPUT_NAME)', |
| 55 '--cpp_out=<(protoc_out_dir)', |
| 56 ], |
| 57 'message': 'Generating C++ code from <(RULE_INPUT_PATH)', |
| 58 }, |
| 59 ], |
| 60 'dependencies': [ |
| 61 '../../third_party/protobuf/protobuf.gyp:protoc#host', |
| 62 ], |
| 63 }, |
| 64 # The C++ files generated from the cache invalidation protocol buffers. |
| 65 { |
| 66 'target_name': 'cacheinvalidation_proto_cpp', |
| 67 'type': 'static_library', |
| 68 'sources': [ |
| 69 '<(protoc_out_dir)/<(proto_dir_relpath)/client.pb.h', |
| 70 '<(protoc_out_dir)/<(proto_dir_relpath)/client.pb.cc', |
| 71 '<(protoc_out_dir)/<(proto_dir_relpath)/client_gateway.pb.h', |
| 72 '<(protoc_out_dir)/<(proto_dir_relpath)/client_gateway.pb.cc', |
| 73 '<(protoc_out_dir)/<(proto_dir_relpath)/client_protocol.pb.h', |
| 74 '<(protoc_out_dir)/<(proto_dir_relpath)/client_protocol.pb.cc', |
| 75 '<(protoc_out_dir)/<(proto_dir_relpath)/client_test_internal.pb.h', |
| 76 '<(protoc_out_dir)/<(proto_dir_relpath)/client_test_internal.pb.cc', |
| 77 '<(protoc_out_dir)/<(proto_dir_relpath)/types.pb.h', |
| 78 '<(protoc_out_dir)/<(proto_dir_relpath)/types.pb.cc', |
| 79 ], |
| 80 'dependencies': [ |
| 81 '../../third_party/protobuf/protobuf.gyp:protobuf_lite', |
| 82 'cacheinvalidation_proto', |
| 83 ], |
| 84 'include_dirs': [ |
| 85 '<(protoc_out_dir)', |
| 86 ], |
| 87 'direct_dependent_settings': { |
| 88 'include_dirs': [ |
| 89 '<(protoc_out_dir)', |
| 90 ], |
42 }, | 91 }, |
43 'includes': [ '../../build/protoc.gypi' ], | 92 'export_dependent_settings': [ |
| 93 '../../third_party/protobuf/protobuf.gyp:protobuf_lite', |
| 94 ], |
| 95 # This target exports a hard dependency because it contains generated |
| 96 # header files. |
| 97 'hard_dependency': 1, |
44 }, | 98 }, |
45 # The main cache invalidation library. External clients should depend | 99 # The main cache invalidation library. External clients should depend |
46 # only on this. | 100 # only on this. |
47 { | 101 { |
48 'target_name': 'cacheinvalidation', | 102 'target_name': 'cacheinvalidation', |
49 'type': 'static_library', | 103 'type': 'static_library', |
50 'sources': [ | 104 'sources': [ |
51 'overrides/google/cacheinvalidation/v2/callback.h', | 105 'overrides/google/cacheinvalidation/v2/callback.h', |
52 'overrides/google/cacheinvalidation/v2/gmock.h', | 106 'overrides/google/cacheinvalidation/v2/gmock.h', |
53 'overrides/google/cacheinvalidation/v2/googletest.h', | 107 'overrides/google/cacheinvalidation/v2/googletest.h', |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 'files/src/google/cacheinvalidation/v2/time.h', | 163 'files/src/google/cacheinvalidation/v2/time.h', |
110 'files/src/google/cacheinvalidation/v2/types.h', | 164 'files/src/google/cacheinvalidation/v2/types.h', |
111 ], | 165 ], |
112 'include_dirs': [ | 166 'include_dirs': [ |
113 './overrides', | 167 './overrides', |
114 './files/src', | 168 './files/src', |
115 ], | 169 ], |
116 'dependencies': [ | 170 'dependencies': [ |
117 '../../base/base.gyp:base', | 171 '../../base/base.gyp:base', |
118 'cacheinvalidation_proto', | 172 'cacheinvalidation_proto', |
| 173 'cacheinvalidation_proto_cpp', |
119 ], | 174 ], |
| 175 # This target exports a hard dependency because its include files |
| 176 # include generated header files from cache_invalidation_proto_cpp. |
| 177 'hard_dependency': 1, |
120 'direct_dependent_settings': { | 178 'direct_dependent_settings': { |
121 'include_dirs': [ | 179 'include_dirs': [ |
122 './overrides', | 180 './overrides', |
123 './files/src', | 181 './files/src', |
124 ], | 182 ], |
125 }, | 183 }, |
126 'export_dependent_settings': [ | 184 'export_dependent_settings': [ |
127 '../../base/base.gyp:base', | 185 '../../base/base.gyp:base', |
128 'cacheinvalidation_proto', | 186 'cacheinvalidation_proto_cpp', |
129 ], | 187 ], |
130 }, | 188 }, |
131 # Unittests for the cache invalidation library. | 189 # Unittests for the cache invalidation library. |
132 # TODO(ghc): Write native tests and include them here. | 190 # TODO(ghc): Write native tests and include them here. |
133 { | 191 { |
134 'target_name': 'cacheinvalidation_unittests', | 192 'target_name': 'cacheinvalidation_unittests', |
135 'type': 'executable', | 193 'type': 'executable', |
136 'sources': [ | 194 'sources': [ |
137 '../../base/test/run_all_unittests.cc', | 195 '../../base/test/run_all_unittests.cc', |
138 'files/src/google/cacheinvalidation/v2/test/deterministic-scheduler.cc', | 196 'files/src/google/cacheinvalidation/v2/test/deterministic-scheduler.cc', |
(...skipping 10 matching lines...) Expand all Loading... |
149 '../../base/base.gyp:base', | 207 '../../base/base.gyp:base', |
150 # Needed by run_all_unittests.cc. | 208 # Needed by run_all_unittests.cc. |
151 '../../base/base.gyp:test_support_base', | 209 '../../base/base.gyp:test_support_base', |
152 '../../testing/gmock.gyp:gmock', | 210 '../../testing/gmock.gyp:gmock', |
153 '../../testing/gtest.gyp:gtest', | 211 '../../testing/gtest.gyp:gtest', |
154 'cacheinvalidation', | 212 'cacheinvalidation', |
155 ], | 213 ], |
156 }, | 214 }, |
157 ], | 215 ], |
158 } | 216 } |
OLD | NEW |