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)', | |
22 }, | 18 }, |
23 'targets': [ | 19 'targets': [ |
24 # The rule/action to generate files from the cacheinvalidation proto | 20 # The rule/action to generate files from the cacheinvalidation proto |
25 # files. | 21 # files and package them into a static library. |
26 { | 22 { |
27 'target_name': 'cacheinvalidation_proto', | 23 'target_name': 'cacheinvalidation_proto', |
28 'type': 'none', | 24 'type': 'static_library', |
29 'sources': [ | 25 'sources': [ |
30 '<(proto_dir_root)/<(proto_dir_relpath)/client.proto', | 26 '<(proto_dir_root)/<(proto_dir_relpath)/client.proto', |
31 '<(proto_dir_root)/<(proto_dir_relpath)/client_gateway.proto', | 27 '<(proto_dir_root)/<(proto_dir_relpath)/client_gateway.proto', |
32 '<(proto_dir_root)/<(proto_dir_relpath)/client_protocol.proto', | 28 '<(proto_dir_root)/<(proto_dir_relpath)/client_protocol.proto', |
33 '<(proto_dir_root)/<(proto_dir_relpath)/client_test_internal.proto', | 29 '<(proto_dir_root)/<(proto_dir_relpath)/client_test_internal.proto', |
34 '<(proto_dir_root)/<(proto_dir_relpath)/types.proto', | 30 '<(proto_dir_root)/<(proto_dir_relpath)/types.proto', |
35 ], | 31 ], |
36 # TODO(akalin): This block was copied from the sync_proto target | 32 'variables': { |
37 # from chrome.gyp. Decomp the shared blocks out somehow. | 33 'proto_in_dir': '<(proto_dir_root)', |
38 'rules': [ | 34 'proto_out_dir': '', |
39 { | 35 'proto_relpath': '<(proto_dir_relpath)/', |
40 'rule_name': 'genproto', | 36 # This is necessary because these protos import with |
41 'extension': 'proto', | 37 # qualified paths, such as: |
42 'inputs': [ | 38 # #import "google/cacheinvalidation/v2/client_protocol.proto" |
43 '<(protoc)', | 39 # rather than the more common form of: |
44 ], | 40 # #import "client_protocol.proto" |
45 'outputs': [ | 41 # NOTE: The trailing slash is required, see build/protoc.gypi |
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 ], | |
91 }, | 42 }, |
92 'export_dependent_settings': [ | 43 'includes': [ '../../build/protoc.gypi' ], |
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, | |
98 }, | 44 }, |
99 # The main cache invalidation library. External clients should depend | 45 # The main cache invalidation library. External clients should depend |
100 # only on this. | 46 # only on this. |
101 { | 47 { |
102 'target_name': 'cacheinvalidation', | 48 'target_name': 'cacheinvalidation', |
103 'type': 'static_library', | 49 'type': 'static_library', |
104 'sources': [ | 50 'sources': [ |
105 'overrides/google/cacheinvalidation/v2/callback.h', | 51 'overrides/google/cacheinvalidation/v2/callback.h', |
106 'overrides/google/cacheinvalidation/v2/gmock.h', | 52 'overrides/google/cacheinvalidation/v2/gmock.h', |
107 'overrides/google/cacheinvalidation/v2/googletest.h', | 53 'overrides/google/cacheinvalidation/v2/googletest.h', |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 'files/src/google/cacheinvalidation/v2/time.h', | 109 'files/src/google/cacheinvalidation/v2/time.h', |
164 'files/src/google/cacheinvalidation/v2/types.h', | 110 'files/src/google/cacheinvalidation/v2/types.h', |
165 ], | 111 ], |
166 'include_dirs': [ | 112 'include_dirs': [ |
167 './overrides', | 113 './overrides', |
168 './files/src', | 114 './files/src', |
169 ], | 115 ], |
170 'dependencies': [ | 116 'dependencies': [ |
171 '../../base/base.gyp:base', | 117 '../../base/base.gyp:base', |
172 'cacheinvalidation_proto', | 118 'cacheinvalidation_proto', |
173 'cacheinvalidation_proto_cpp', | |
174 ], | 119 ], |
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, | |
178 'direct_dependent_settings': { | 120 'direct_dependent_settings': { |
179 'include_dirs': [ | 121 'include_dirs': [ |
180 './overrides', | 122 './overrides', |
181 './files/src', | 123 './files/src', |
182 ], | 124 ], |
183 }, | 125 }, |
184 'export_dependent_settings': [ | 126 'export_dependent_settings': [ |
185 '../../base/base.gyp:base', | 127 '../../base/base.gyp:base', |
186 'cacheinvalidation_proto_cpp', | 128 'cacheinvalidation_proto', |
187 ], | 129 ], |
188 }, | 130 }, |
189 # Unittests for the cache invalidation library. | 131 # Unittests for the cache invalidation library. |
190 # TODO(ghc): Write native tests and include them here. | 132 # TODO(ghc): Write native tests and include them here. |
191 { | 133 { |
192 'target_name': 'cacheinvalidation_unittests', | 134 'target_name': 'cacheinvalidation_unittests', |
193 'type': 'executable', | 135 'type': 'executable', |
194 'sources': [ | 136 'sources': [ |
195 '../../base/test/run_all_unittests.cc', | 137 '../../base/test/run_all_unittests.cc', |
196 'files/src/google/cacheinvalidation/v2/test/deterministic-scheduler.cc', | 138 'files/src/google/cacheinvalidation/v2/test/deterministic-scheduler.cc', |
(...skipping 10 matching lines...) Expand all Loading... |
207 '../../base/base.gyp:base', | 149 '../../base/base.gyp:base', |
208 # Needed by run_all_unittests.cc. | 150 # Needed by run_all_unittests.cc. |
209 '../../base/base.gyp:test_support_base', | 151 '../../base/base.gyp:test_support_base', |
210 '../../testing/gmock.gyp:gmock', | 152 '../../testing/gmock.gyp:gmock', |
211 '../../testing/gtest.gyp:gtest', | 153 '../../testing/gtest.gyp:gtest', |
212 'cacheinvalidation', | 154 'cacheinvalidation', |
213 ], | 155 ], |
214 }, | 156 }, |
215 ], | 157 ], |
216 } | 158 } |
OLD | NEW |