| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 if (is_win) { | 5 if (is_win) { |
| 6 config_h_dir = "vsprojects" | 6 config_h_dir = "vsprojects" |
| 7 } else { | 7 } else { |
| 8 config_h_dir = "." | 8 config_h_dir = "." |
| 9 } | 9 } |
| 10 | 10 |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 | 258 |
| 259 cflags = protobuf_lite_cflags | 259 cflags = protobuf_lite_cflags |
| 260 | 260 |
| 261 deps = [ | 261 deps = [ |
| 262 ":protobuf_full", | 262 ":protobuf_full", |
| 263 ] | 263 ] |
| 264 deps += [ "//build/config/sanitizers:deps" ] | 264 deps += [ "//build/config/sanitizers:deps" ] |
| 265 } | 265 } |
| 266 } | 266 } |
| 267 | 267 |
| 268 google_python_dir = "$root_out_dir/pyproto/google" |
| 269 |
| 268 copy("copy_google") { | 270 copy("copy_google") { |
| 269 sources = [ | 271 sources = [ |
| 270 "__init__.py", | 272 "__init__.py", |
| 271 ] | 273 ] |
| 272 outputs = [ | 274 outputs = [ |
| 273 "$root_gen_dir/google/{{source_file_part}}", | 275 "$google_python_dir/{{source_file_part}}", |
| 274 ] | 276 ] |
| 275 } | 277 } |
| 276 | 278 |
| 277 copy("copy_google_protobuf") { | 279 copy("copy_google_protobuf") { |
| 278 sources = [ | 280 sources = [ |
| 279 "python/google/protobuf/__init__.py", | 281 "python/google/protobuf/__init__.py", |
| 280 "python/google/protobuf/descriptor.py", | 282 "python/google/protobuf/descriptor.py", |
| 281 "python/google/protobuf/descriptor_database.py", | 283 "python/google/protobuf/descriptor_database.py", |
| 282 "python/google/protobuf/descriptor_pool.py", | 284 "python/google/protobuf/descriptor_pool.py", |
| 283 "python/google/protobuf/message.py", | 285 "python/google/protobuf/message.py", |
| 284 "python/google/protobuf/message_factory.py", | 286 "python/google/protobuf/message_factory.py", |
| 285 "python/google/protobuf/reflection.py", | 287 "python/google/protobuf/reflection.py", |
| 286 "python/google/protobuf/service.py", | 288 "python/google/protobuf/service.py", |
| 287 "python/google/protobuf/service_reflection.py", | 289 "python/google/protobuf/service_reflection.py", |
| 288 "python/google/protobuf/text_format.py", | 290 "python/google/protobuf/text_format.py", |
| 289 | 291 |
| 290 # TODO(ncarter): protoc"s python generator treats | 292 # TODO(ncarter): protoc"s python generator treats |
| 291 # descriptor.proto specially, but it's not possible to trigger | 293 # descriptor.proto specially, but it's not possible to trigger |
| 292 # the special treatment unless you run protoc from ./src/src | 294 # the special treatment unless you run protoc from ./src/src |
| 293 # (the treatment is based on the path to the .proto file | 295 # (the treatment is based on the path to the .proto file |
| 294 # matching a constant exactly). I'm not sure how to convince | 296 # matching a constant exactly). I'm not sure how to convince |
| 295 # gyp to execute a rule from a different directory. Until this | 297 # gyp to execute a rule from a different directory. Until this |
| 296 # is resolved, use a copy of descriptor_pb2.py that I manually | 298 # is resolved, use a copy of descriptor_pb2.py that I manually |
| 297 # generated. | 299 # generated. |
| 298 "descriptor_pb2.py", | 300 "descriptor_pb2.py", |
| 299 ] | 301 ] |
| 300 outputs = [ | 302 outputs = [ |
| 301 "$root_gen_dir/google/protobuf/{{source_file_part}}", | 303 "$google_python_dir/protobuf/{{source_file_part}}", |
| 302 ] | 304 ] |
| 303 } | 305 } |
| 304 | 306 |
| 305 copy("copy_google_protobuf_internal") { | 307 copy("copy_google_protobuf_internal") { |
| 306 sources = [ | 308 sources = [ |
| 307 "python/google/protobuf/internal/__init__.py", | 309 "python/google/protobuf/internal/__init__.py", |
| 308 "python/google/protobuf/internal/api_implementation.py", | 310 "python/google/protobuf/internal/api_implementation.py", |
| 309 "python/google/protobuf/internal/containers.py", | 311 "python/google/protobuf/internal/containers.py", |
| 310 "python/google/protobuf/internal/cpp_message.py", | 312 "python/google/protobuf/internal/cpp_message.py", |
| 311 "python/google/protobuf/internal/decoder.py", | 313 "python/google/protobuf/internal/decoder.py", |
| 312 "python/google/protobuf/internal/encoder.py", | 314 "python/google/protobuf/internal/encoder.py", |
| 313 "python/google/protobuf/internal/enum_type_wrapper.py", | 315 "python/google/protobuf/internal/enum_type_wrapper.py", |
| 314 "python/google/protobuf/internal/generator_test.py", | 316 "python/google/protobuf/internal/generator_test.py", |
| 315 "python/google/protobuf/internal/message_listener.py", | 317 "python/google/protobuf/internal/message_listener.py", |
| 316 "python/google/protobuf/internal/python_message.py", | 318 "python/google/protobuf/internal/python_message.py", |
| 317 "python/google/protobuf/internal/type_checkers.py", | 319 "python/google/protobuf/internal/type_checkers.py", |
| 318 "python/google/protobuf/internal/wire_format.py", | 320 "python/google/protobuf/internal/wire_format.py", |
| 319 ] | 321 ] |
| 320 outputs = [ | 322 outputs = [ |
| 321 "$root_gen_dir/google/protobuf/internal/{{source_file_part}}", | 323 "$google_python_dir/protobuf/internal/{{source_file_part}}", |
| 322 ] | 324 ] |
| 323 } | 325 } |
| 324 | 326 |
| 325 group("py_proto") { | 327 group("py_proto") { |
| 326 public_deps = [ | 328 public_deps = [ |
| 327 ":copy_google", | 329 ":copy_google", |
| 328 ":copy_google_protobuf", | 330 ":copy_google_protobuf", |
| 329 ":copy_google_protobuf_internal", | 331 ":copy_google_protobuf_internal", |
| 330 ] | 332 ] |
| 333 |
| 334 # Targets that depend on this should depend on the copied data files. |
| 335 data = get_target_outputs(":copy_google") |
| 336 data += get_target_outputs(":copy_google_protobuf") |
| 337 data += get_target_outputs(":copy_google_protobuf_internal") |
| 331 } | 338 } |
| OLD | NEW |