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 # This file is meant to be included into a target to provide a rule | 5 # This file is meant to be included into a target to provide a rule |
6 # to invoke protoc in a consistent manner. | 6 # to invoke protoc in a consistent manner. |
7 # | 7 # |
8 # To use this, create a gyp target with the following form: | 8 # To use this, create a gyp target with the following form: |
9 # { | 9 # { |
10 # 'target_name': 'my_proto_lib', | 10 # 'target_name': 'my_proto_lib', |
(...skipping 30 matching lines...) Expand all Loading... |
41 # e.g. 'base/base_export.h' | 41 # e.g. 'base/base_export.h' |
42 # | 42 # |
43 # Implementation notes: | 43 # Implementation notes: |
44 # A proto_out_dir of foo/bar produces | 44 # A proto_out_dir of foo/bar produces |
45 # <(SHARED_INTERMEDIATE_DIR)/protoc_out/foo/bar/{file1,file2}.pb.{cc,h} | 45 # <(SHARED_INTERMEDIATE_DIR)/protoc_out/foo/bar/{file1,file2}.pb.{cc,h} |
46 # <(SHARED_INTERMEDIATE_DIR)/pyproto/foo/bar/{file1,file2}_pb2.py | 46 # <(SHARED_INTERMEDIATE_DIR)/pyproto/foo/bar/{file1,file2}_pb2.py |
47 | 47 |
48 { | 48 { |
49 'variables': { | 49 'variables': { |
50 'protoc_wrapper': '<(DEPTH)/tools/protoc_wrapper/protoc_wrapper.py', | 50 'protoc_wrapper': '<(DEPTH)/tools/protoc_wrapper/protoc_wrapper.py', |
51 'protoc': '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)protoc<(EXECUTABLE_SUFFIX)', | |
52 'cc_dir': '<(SHARED_INTERMEDIATE_DIR)/protoc_out/<(proto_out_dir)', | 51 'cc_dir': '<(SHARED_INTERMEDIATE_DIR)/protoc_out/<(proto_out_dir)', |
53 'py_dir': '<(PRODUCT_DIR)/pyproto/<(proto_out_dir)', | 52 'py_dir': '<(PRODUCT_DIR)/pyproto/<(proto_out_dir)', |
54 'cc_generator_options%': '', | 53 'cc_generator_options%': '', |
55 'cc_include%': '', | 54 'cc_include%': '', |
56 'proto_in_dir%': '.', | 55 'proto_in_dir%': '.', |
| 56 'conditions': [ |
| 57 ['use_system_protobuf==0', { |
| 58 'protoc': '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)protoc<(EXECUTABLE_SUFFIX)
', |
| 59 }, { # use_system_protobuf==1 |
| 60 'protoc': '<!(which protoc)', |
| 61 }], |
| 62 ], |
57 }, | 63 }, |
58 'rules': [ | 64 'rules': [ |
59 { | 65 { |
60 'rule_name': 'genproto', | 66 'rule_name': 'genproto', |
61 'extension': 'proto', | 67 'extension': 'proto', |
62 'inputs': [ | 68 'inputs': [ |
63 '<(protoc_wrapper)', | 69 '<(protoc_wrapper)', |
64 '<(protoc)', | 70 '<(protoc)', |
65 ], | 71 ], |
66 'outputs': [ | 72 'outputs': [ |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 }, | 113 }, |
108 'export_dependent_settings': [ | 114 'export_dependent_settings': [ |
109 # The generated headers reference headers within protobuf_lite, | 115 # The generated headers reference headers within protobuf_lite, |
110 # so dependencies must be able to find those headers too. | 116 # so dependencies must be able to find those headers too. |
111 '<(DEPTH)/third_party/protobuf/protobuf.gyp:protobuf_lite', | 117 '<(DEPTH)/third_party/protobuf/protobuf.gyp:protobuf_lite', |
112 ], | 118 ], |
113 # This target exports a hard dependency because it generates header | 119 # This target exports a hard dependency because it generates header |
114 # files. | 120 # files. |
115 'hard_dependency': 1, | 121 'hard_dependency': 1, |
116 } | 122 } |
OLD | NEW |