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 'conditions': [ | 6 'conditions': [ |
7 ['use_system_protobuf==0', { | 7 ['use_system_protobuf==0', { |
8 'conditions': [ | 8 'conditions': [ |
9 ['OS=="win"', { | 9 ['OS=="win"', { |
10 'target_defaults': { | 10 'target_defaults': { |
11 'msvs_disabled_warnings': [ | 11 'msvs_disabled_warnings': [ |
12 4018, # signed/unsigned mismatch in comparison | 12 4018, # signed/unsigned mismatch in comparison |
13 4065, # switch statement contains 'default' but no 'case' labels | 13 4065, # switch statement contains 'default' but no 'case' labels |
14 4146, # unary minus operator applied to unsigned type | 14 4146, # unary minus operator applied to unsigned type |
15 4244, # implicit conversion, possible loss of data | 15 4244, # implicit conversion, possible loss of data |
16 4267, # size_t to int truncation | 16 4267, # size_t to int truncation |
17 4291, # no matching operator delete for a placement new | 17 4291, # no matching operator delete for a placement new |
18 4305, # double to float truncation | 18 4305, # double to float truncation |
19 4355, # 'this' used in base member initializer list | 19 4355, # 'this' used in base member initializer list |
20 4506, # no definition for inline function (protobuf issue #240) | 20 4506, # no definition for inline function (protobuf issue #240) |
21 4715, # not all control paths return a value (fixed in trunk) | 21 4715, # not all control paths return a value (fixed in trunk) |
22 ], | 22 ], |
23 'defines!': [ | 23 'defines!': [ |
24 'WIN32_LEAN_AND_MEAN', # Protobuf defines this itself. | 24 'WIN32_LEAN_AND_MEAN', # Protobuf defines this itself. |
25 ], | 25 ], |
26 }, | 26 }, |
27 }], | 27 }], |
28 ['OS=="ios" and "<(GENERATOR)"=="xcode" and "<(GENERATOR_FLAVOR)"!="ninj
a"', { | |
29 'variables': { | |
30 'ninja_output_dir': 'ninja-protoc', | |
31 'ninja_product_dir': | |
32 '<(DEPTH)/xcodebuild/<(ninja_output_dir)/<(CONFIGURATION_NAME)', | |
33 # Gyp to rerun | |
34 're_run_targets': [ | |
35 'third_party/protobuf/protobuf.gyp', | |
36 ], | |
37 }, | |
38 'targets': [ | |
39 { | |
40 # On iOS, generating protoc is done via two actions: (1) compiling | |
41 # the executable with ninja, and (2) copying the executable into a | |
42 # location that is shared with other projects. These actions are | |
43 # separated into two targets in order to be able to specify that t
he | |
44 # second action should not run until the first action finishes (si
nce | |
45 # the ordering of multiple actions in one target is defined only b
y | |
46 # inputs and outputs, and it's impossible to set correct inputs fo
r | |
47 # the ninja build, so setting all the inputs and outputs isn't an | |
48 # option). The first target is given here; the second target is th
e | |
49 # normal protoc target under the condition that "OS==iOS". | |
50 'target_name': 'compile_protoc', | |
51 'type': 'none', | |
52 'toolsets': ['host'], | |
53 'includes': ['../../build/ios/mac_build.gypi'], | |
54 'actions': [ | |
55 { | |
56 'action_name': 'compile protoc', | |
57 'inputs': [], | |
58 'outputs': [], | |
59 'action': [ | |
60 '<@(ninja_cmd)', | |
61 'protoc', | |
62 ], | |
63 'message': 'Generating the C++ protocol buffers compiler', | |
64 }, | |
65 ], | |
66 }, | |
67 ], | |
68 }], | |
69 ], | 28 ], |
70 'targets': [ | 29 'targets': [ |
71 # The "lite" lib is about 1/7th the size of the heavy lib, | 30 # The "lite" lib is about 1/7th the size of the heavy lib, |
72 # but it doesn't support some of the more exotic features of | 31 # but it doesn't support some of the more exotic features of |
73 # protobufs, like reflection. To generate C++ code that can link | 32 # protobufs, like reflection. To generate C++ code that can link |
74 # against the lite version of the library, add the option line: | 33 # against the lite version of the library, add the option line: |
75 # | 34 # |
76 # option optimize_for = LITE_RUNTIME; | 35 # option optimize_for = LITE_RUNTIME; |
77 # | 36 # |
78 # to your .proto file. | 37 # to your .proto file. |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 }, | 403 }, |
445 'dependencies': [ | 404 'dependencies': [ |
446 'protobuf_full_do_not_use', | 405 'protobuf_full_do_not_use', |
447 ], | 406 ], |
448 'include_dirs': [ | 407 'include_dirs': [ |
449 'src', | 408 'src', |
450 ], | 409 ], |
451 }, | 410 }, |
452 { | 411 { |
453 'target_name': 'protoc', | 412 'target_name': 'protoc', |
454 'conditions': [ | 413 'type': 'executable', |
455 ['OS!="ios" or "<(GENERATOR)"!="xcode" or "<(GENERATOR_FLAVOR)"=="ni
nja"', { | 414 'toolsets': ['host'], |
456 'type': 'executable', | 415 'sources': [ |
457 'toolsets': ['host'], | 416 "src/google/protobuf/compiler/main.cc", |
458 'sources': [ | 417 ], |
459 "src/google/protobuf/compiler/main.cc", | 418 'dependencies': [ |
460 ], | 419 'protoc_lib', |
461 'dependencies': [ | 420 ], |
462 'protoc_lib', | 421 'include_dirs': [ |
463 ], | 422 'src', |
464 'include_dirs': [ | |
465 'src', | |
466 ], | |
467 }, { # else, OS=="ios" and "<(GENERATOR)"=="xcode" and "<(GENERATOR
_FLAVOR)"!="ninja" | |
468 'type': 'none', | |
469 'toolsets': ['host'], | |
470 'dependencies': [ | |
471 'compile_protoc', | |
472 ], | |
473 'actions': [ | |
474 { | |
475 'action_name': 'copy protoc', | |
476 'inputs': [ | |
477 '<(ninja_product_dir)/protoc', | |
478 ], | |
479 'outputs': [ | |
480 '<(PRODUCT_DIR)/protoc', | |
481 ], | |
482 'action': [ | |
483 'cp', | |
484 '<(ninja_product_dir)/protoc', | |
485 '<(PRODUCT_DIR)/protoc', | |
486 ], | |
487 }, | |
488 ], | |
489 }], | |
490 ], | 423 ], |
491 }, | 424 }, |
492 { | 425 { |
493 # Generate the python module needed by all protoc-generated Python cod
e. | 426 # Generate the python module needed by all protoc-generated Python cod
e. |
494 'target_name': 'py_proto', | 427 'target_name': 'py_proto', |
495 'type': 'none', | 428 'type': 'none', |
496 'copies': [ | 429 'copies': [ |
497 { | 430 { |
498 'destination': '<(PRODUCT_DIR)/pyproto/google/', | 431 'destination': '<(PRODUCT_DIR)/pyproto/google/', |
499 'files': [ | 432 'files': [ |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
621 'toolsets': ['host', 'target'], | 554 'toolsets': ['host', 'target'], |
622 }, | 555 }, |
623 { | 556 { |
624 'target_name': 'py_proto', | 557 'target_name': 'py_proto', |
625 'type': 'none', | 558 'type': 'none', |
626 }, | 559 }, |
627 ], | 560 ], |
628 }], | 561 }], |
629 ], | 562 ], |
630 } | 563 } |
OLD | NEW |