OLD | NEW |
1 # Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2009 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 'conditions': [ | 6 'conditions': [ |
7 ['OS!="win"', { | 7 ['OS!="win"', { |
8 'variables': { | 8 'variables': { |
9 'config_h_dir': | 9 'config_h_dir': |
10 '.', # crafted for gcc/linux. | 10 '.', # crafted for gcc/linux. |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 ], | 71 ], |
72 'include_dirs': [ | 72 'include_dirs': [ |
73 '<(config_h_dir)', | 73 '<(config_h_dir)', |
74 'src/src', | 74 'src/src', |
75 ], | 75 ], |
76 # This macro must be defined to suppress the use of dynamic_cast<>, | 76 # This macro must be defined to suppress the use of dynamic_cast<>, |
77 # which requires RTTI. | 77 # which requires RTTI. |
78 'defines': [ | 78 'defines': [ |
79 'GOOGLE_PROTOBUF_NO_RTTI', | 79 'GOOGLE_PROTOBUF_NO_RTTI', |
80 ], | 80 ], |
| 81 |
81 'direct_dependent_settings': { | 82 'direct_dependent_settings': { |
82 'include_dirs': [ | 83 'include_dirs': [ |
83 '<(config_h_dir)', | 84 '<(config_h_dir)', |
84 'src/src', | 85 'src/src', |
85 ], | 86 ], |
86 'defines': [ | 87 'defines': [ |
87 'GOOGLE_PROTOBUF_NO_RTTI', | 88 'GOOGLE_PROTOBUF_NO_RTTI', |
88 ], | 89 ], |
89 }, | 90 }, |
90 }, | 91 }, |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 'src/src/google/protobuf/compiler/main.cc', | 212 'src/src/google/protobuf/compiler/main.cc', |
212 ], | 213 ], |
213 'dependencies': [ | 214 'dependencies': [ |
214 'protobuf', | 215 'protobuf', |
215 ], | 216 ], |
216 'include_dirs': [ | 217 'include_dirs': [ |
217 '<(config_h_dir)', | 218 '<(config_h_dir)', |
218 'src/src', | 219 'src/src', |
219 ], | 220 ], |
220 }, | 221 }, |
| 222 { |
| 223 # Generate the python module needed by all protoc-generated Python code. |
| 224 'target_name': 'py_proto', |
| 225 'type': 'none', |
| 226 'copies': [ |
| 227 { |
| 228 'destination': '<(PRODUCT_DIR)/pyproto/google/', |
| 229 'files': [ |
| 230 # google/ module gets an empty __init__.py. |
| 231 '__init__.py', |
| 232 ], |
| 233 }, |
| 234 { |
| 235 'destination': '<(PRODUCT_DIR)/pyproto/google/protobuf', |
| 236 'files': [ |
| 237 'src/python/google/protobuf/__init__.py', |
| 238 'src/python/google/protobuf/descriptor.py', |
| 239 'src/python/google/protobuf/message.py', |
| 240 'src/python/google/protobuf/reflection.py', |
| 241 'src/python/google/protobuf/service.py', |
| 242 'src/python/google/protobuf/service_reflection.py', |
| 243 'src/python/google/protobuf/text_format.py', |
| 244 |
| 245 # TODO(ncarter): protoc's python generator treats descriptor.proto |
| 246 # specially, but it's not possible to trigger the special treatment |
| 247 # unless you run protoc from ./src/src (the treatment is based |
| 248 # on the path to the .proto file matching a constant exactly). |
| 249 # I'm not sure how to convince gyp to execute a rule from a |
| 250 # different directory. Until this is resolved, use a copy of |
| 251 # descriptor_pb2.py that I manually generated. |
| 252 'descriptor_pb2.py', |
| 253 ], |
| 254 }, |
| 255 { |
| 256 'destination': '<(PRODUCT_DIR)/pyproto/google/protobuf/internal', |
| 257 'files': [ |
| 258 'src/python/google/protobuf/internal/__init__.py', |
| 259 'src/python/google/protobuf/internal/containers.py', |
| 260 'src/python/google/protobuf/internal/decoder.py', |
| 261 'src/python/google/protobuf/internal/encoder.py', |
| 262 'src/python/google/protobuf/internal/generator_test.py', |
| 263 'src/python/google/protobuf/internal/message_listener.py', |
| 264 'src/python/google/protobuf/internal/type_checkers.py', |
| 265 'src/python/google/protobuf/internal/wire_format.py', |
| 266 ], |
| 267 }, |
| 268 ], |
| 269 # # We can't generate a proper descriptor_pb2.py -- see earlier comment. |
| 270 # 'rules': [ |
| 271 # { |
| 272 # 'rule_name': 'genproto', |
| 273 # 'extension': 'proto', |
| 274 # 'inputs': [ |
| 275 # '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)protoc<(EXECUTABLE_SUFFIX)', |
| 276 # ], |
| 277 # 'variables': { |
| 278 # # The protoc compiler requires a proto_path argument with the |
| 279 # # directory containing the .proto file. |
| 280 # 'rule_input_relpath': 'src/src/google/protobuf', |
| 281 # }, |
| 282 # 'outputs': [ |
| 283 # '<(PRODUCT_DIR)/pyproto/google/protobuf/<(RULE_INPUT_ROOT)_pb2.py'
, |
| 284 # ], |
| 285 # 'action': [ |
| 286 # '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)protoc<(EXECUTABLE_SUFFIX)', |
| 287 # '-I./src/src', |
| 288 # '-I./src', |
| 289 # '--python_out=<(PRODUCT_DIR)/pyproto/google/protobuf', |
| 290 # 'google/protobuf/descriptor.proto', |
| 291 # ], |
| 292 # 'message': 'Generating Python code from <(RULE_INPUT_PATH)', |
| 293 # }, |
| 294 # ], |
| 295 # 'dependencies': [ |
| 296 # 'protoc#host', |
| 297 # ], |
| 298 # 'sources': [ |
| 299 # 'src/src/google/protobuf/descriptor.proto', |
| 300 # ], |
| 301 }, |
221 ], | 302 ], |
222 } | 303 } |
223 | 304 |
224 # Local Variables: | 305 # Local Variables: |
225 # tab-width:2 | 306 # tab-width:2 |
226 # indent-tabs-mode:nil | 307 # indent-tabs-mode:nil |
227 # End: | 308 # End: |
228 # vim: set expandtab tabstop=2 shiftwidth=2: | 309 # vim: set expandtab tabstop=2 shiftwidth=2: |
OLD | NEW |