Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: third_party/protobuf/protobuf.gyp

Issue 11231046: Linux: add an option to build with system protobuf. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « build/protoc.gypi ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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': {
7 'use_system_protobuf%': 0,
8 },
6 'conditions': [ 9 'conditions': [
7 ['OS!="win"', { 10 ['use_system_protobuf==0', {
8 'variables': { 11 'conditions': [
9 'config_h_dir': 12 ['OS!="win"', {
10 '.', # crafted for gcc/linux. 13 'variables': {
11 }, 14 'config_h_dir':
12 }, { # else, OS=="win" 15 '.', # crafted for gcc/linux.
13 'variables': { 16 },
14 'config_h_dir': 17 }, { # else, OS=="win"
15 'vsprojects', # crafted for msvc. 18 'variables': {
16 }, 19 'config_h_dir':
17 'target_defaults': { 20 'vsprojects', # crafted for msvc.
18 'msvs_disabled_warnings': [ 21 },
19 4018, # signed/unsigned mismatch in comparison 22 'target_defaults': {
20 4244, # implicit conversion, possible loss of data 23 'msvs_disabled_warnings': [
21 4355, # 'this' used in base member initializer list 24 4018, # signed/unsigned mismatch in comparison
22 ], 25 4244, # implicit conversion, possible loss of data
23 'defines!': [ 26 4355, # 'this' used in base member initializer list
24 'WIN32_LEAN_AND_MEAN', # Protobuf defines this itself. 27 ],
25 ], 28 'defines!': [
26 }, 29 'WIN32_LEAN_AND_MEAN', # Protobuf defines this itself.
27 }] 30 ],
28 ], 31 },
29 'targets': [ 32 }]
30 # The "lite" lib is about 1/7th the size of the heavy lib, 33 ],
31 # but it doesn't support some of the more exotic features of 34 'targets': [
32 # protobufs, like reflection. To generate C++ code that can link 35 # The "lite" lib is about 1/7th the size of the heavy lib,
33 # against the lite version of the library, add the option line: 36 # but it doesn't support some of the more exotic features of
34 # 37 # protobufs, like reflection. To generate C++ code that can link
35 # option optimize_for = LITE_RUNTIME; 38 # against the lite version of the library, add the option line:
36 # 39 #
37 # to your .proto file. 40 # option optimize_for = LITE_RUNTIME;
38 { 41 #
39 'target_name': 'protobuf_lite', 42 # to your .proto file.
40 'type': 'static_library', 43 {
41 'toolsets': ['host', 'target'], 44 'target_name': 'protobuf_lite',
42 'sources': [ 45 'type': 'static_library',
43 'src/google/protobuf/stubs/atomicops.h', 46 'toolsets': ['host', 'target'],
44 'src/google/protobuf/stubs/atomicops_internals_arm_gcc.h', 47 'sources': [
45 'src/google/protobuf/stubs/atomicops_internals_atomicword_compat.h', 48 'src/google/protobuf/stubs/atomicops.h',
46 'src/google/protobuf/stubs/atomicops_internals_macosx.h', 49 'src/google/protobuf/stubs/atomicops_internals_arm_gcc.h',
47 'src/google/protobuf/stubs/atomicops_internals_mips_gcc.h', 50 'src/google/protobuf/stubs/atomicops_internals_atomicword_compat.h',
48 'src/google/protobuf/stubs/atomicops_internals_x86_gcc.cc', 51 'src/google/protobuf/stubs/atomicops_internals_macosx.h',
49 'src/google/protobuf/stubs/atomicops_internals_x86_gcc.h', 52 'src/google/protobuf/stubs/atomicops_internals_mips_gcc.h',
50 'src/google/protobuf/stubs/atomicops_internals_x86_msvc.cc', 53 'src/google/protobuf/stubs/atomicops_internals_x86_gcc.cc',
51 'src/google/protobuf/stubs/atomicops_internals_x86_msvc.h', 54 'src/google/protobuf/stubs/atomicops_internals_x86_gcc.h',
52 'src/google/protobuf/stubs/common.h', 55 'src/google/protobuf/stubs/atomicops_internals_x86_msvc.cc',
53 'src/google/protobuf/stubs/once.h', 56 'src/google/protobuf/stubs/atomicops_internals_x86_msvc.h',
54 'src/google/protobuf/stubs/platform_macros.h', 57 'src/google/protobuf/stubs/common.h',
55 'src/google/protobuf/extension_set.h', 58 'src/google/protobuf/stubs/once.h',
56 'src/google/protobuf/generated_message_util.h', 59 'src/google/protobuf/stubs/platform_macros.h',
57 'src/google/protobuf/message_lite.h', 60 'src/google/protobuf/extension_set.h',
58 'src/google/protobuf/repeated_field.h', 61 'src/google/protobuf/generated_message_util.h',
59 'src/google/protobuf/unknown_field_set.cc', 62 'src/google/protobuf/message_lite.h',
60 'src/google/protobuf/unknown_field_set.h', 63 'src/google/protobuf/repeated_field.h',
61 'src/google/protobuf/wire_format_lite.h', 64 'src/google/protobuf/unknown_field_set.cc',
62 'src/google/protobuf/wire_format_lite_inl.h', 65 'src/google/protobuf/unknown_field_set.h',
63 'src/google/protobuf/io/coded_stream.h', 66 'src/google/protobuf/wire_format_lite.h',
64 'src/google/protobuf/io/zero_copy_stream.h', 67 'src/google/protobuf/wire_format_lite_inl.h',
65 'src/google/protobuf/io/zero_copy_stream_impl_lite.h', 68 'src/google/protobuf/io/coded_stream.h',
69 'src/google/protobuf/io/zero_copy_stream.h',
70 'src/google/protobuf/io/zero_copy_stream_impl_lite.h',
66 71
67 'src/google/protobuf/stubs/common.cc', 72 'src/google/protobuf/stubs/common.cc',
68 'src/google/protobuf/stubs/once.cc', 73 'src/google/protobuf/stubs/once.cc',
69 'src/google/protobuf/stubs/hash.h', 74 'src/google/protobuf/stubs/hash.h',
70 'src/google/protobuf/stubs/map-util.h', 75 'src/google/protobuf/stubs/map-util.h',
71 'src/google/protobuf/stubs/stl_util-inl.h', 76 'src/google/protobuf/stubs/stl_util-inl.h',
72 'src/google/protobuf/extension_set.cc', 77 'src/google/protobuf/extension_set.cc',
73 'src/google/protobuf/generated_message_util.cc', 78 'src/google/protobuf/generated_message_util.cc',
74 'src/google/protobuf/message_lite.cc', 79 'src/google/protobuf/message_lite.cc',
75 'src/google/protobuf/repeated_field.cc', 80 'src/google/protobuf/repeated_field.cc',
76 'src/google/protobuf/wire_format_lite.cc', 81 'src/google/protobuf/wire_format_lite.cc',
77 'src/google/protobuf/io/coded_stream.cc', 82 'src/google/protobuf/io/coded_stream.cc',
78 'src/google/protobuf/io/coded_stream_inl.h', 83 'src/google/protobuf/io/coded_stream_inl.h',
79 'src/google/protobuf/io/zero_copy_stream.cc', 84 'src/google/protobuf/io/zero_copy_stream.cc',
80 'src/google/protobuf/io/zero_copy_stream_impl_lite.cc', 85 'src/google/protobuf/io/zero_copy_stream_impl_lite.cc',
81 '<(config_h_dir)/config.h', 86 '<(config_h_dir)/config.h',
82 ],
83 'include_dirs': [
84 '<(config_h_dir)',
85 'src',
86 ],
87 # This macro must be defined to suppress the use of dynamic_cast<>,
88 # which requires RTTI.
89 'defines': [
90 'GOOGLE_PROTOBUF_NO_RTTI',
91 'GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER',
92 ],
93
94 'direct_dependent_settings': {
95 'include_dirs': [
96 '<(config_h_dir)',
97 'src',
98 ],
99 'defines': [
100 'GOOGLE_PROTOBUF_NO_RTTI',
101 'GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER',
102 ],
103 },
104 },
105 # This is the full, heavy protobuf lib that's needed for c++ .proto's
106 # that don't specify the LITE_RUNTIME option. The protocol
107 # compiler itself (protoc) falls into that category.
108 #
109 # DO NOT LINK AGAINST THIS TARGET IN CHROME CODE --agl
110 {
111 'target_name': 'protobuf_full_do_not_use',
112 'type': 'static_library',
113 'toolsets': ['host','target'],
114 'sources': [
115 'src/google/protobuf/descriptor.h',
116 'src/google/protobuf/descriptor.pb.h',
117 'src/google/protobuf/descriptor_database.h',
118 'src/google/protobuf/dynamic_message.h',
119 'src/google/protobuf/generated_message_reflection.h',
120 'src/google/protobuf/message.h',
121 'src/google/protobuf/reflection_ops.h',
122 'src/google/protobuf/service.h',
123 'src/google/protobuf/text_format.h',
124 'src/google/protobuf/wire_format.h',
125 'src/google/protobuf/io/gzip_stream.h',
126 'src/google/protobuf/io/printer.h',
127 'src/google/protobuf/io/tokenizer.h',
128 'src/google/protobuf/io/zero_copy_stream_impl.h',
129 'src/google/protobuf/compiler/code_generator.h',
130 'src/google/protobuf/compiler/command_line_interface.h',
131 'src/google/protobuf/compiler/importer.h',
132 'src/google/protobuf/compiler/parser.h',
133
134 'src/google/protobuf/stubs/strutil.cc',
135 'src/google/protobuf/stubs/strutil.h',
136 'src/google/protobuf/stubs/substitute.cc',
137 'src/google/protobuf/stubs/substitute.h',
138 'src/google/protobuf/stubs/structurally_valid.cc',
139 'src/google/protobuf/descriptor.cc',
140 'src/google/protobuf/descriptor.pb.cc',
141 'src/google/protobuf/descriptor_database.cc',
142 'src/google/protobuf/dynamic_message.cc',
143 'src/google/protobuf/extension_set_heavy.cc',
144 'src/google/protobuf/generated_message_reflection.cc',
145 'src/google/protobuf/message.cc',
146 'src/google/protobuf/reflection_ops.cc',
147 'src/google/protobuf/service.cc',
148 'src/google/protobuf/text_format.cc',
149 'src/google/protobuf/wire_format.cc',
150 # This file pulls in zlib, but it's not actually used by protoc, so
151 # instead of compiling zlib for the host, let's just exclude this.
152 # 'src/src/google/protobuf/io/gzip_stream.cc',
153 'src/google/protobuf/io/printer.cc',
154 'src/google/protobuf/io/tokenizer.cc',
155 'src/google/protobuf/io/zero_copy_stream_impl.cc',
156 'src/google/protobuf/compiler/importer.cc',
157 'src/google/protobuf/compiler/parser.cc',
158 ],
159 'dependencies': [
160 'protobuf_lite',
161 ],
162 'export_dependent_settings': [
163 'protobuf_lite',
164 ],
165 },
166 {
167 'target_name': 'protoc',
168 'conditions': [
169 ['OS!="ios"', {
170 'type': 'executable',
171 'toolsets': ['host'],
172 'sources': [
173 'src/google/protobuf/compiler/code_generator.cc',
174 'src/google/protobuf/compiler/command_line_interface.cc',
175 'src/google/protobuf/compiler/plugin.cc',
176 'src/google/protobuf/compiler/plugin.pb.cc',
177 'src/google/protobuf/compiler/subprocess.cc',
178 'src/google/protobuf/compiler/subprocess.h',
179 'src/google/protobuf/compiler/zip_writer.cc',
180 'src/google/protobuf/compiler/zip_writer.h',
181 'src/google/protobuf/compiler/cpp/cpp_enum.cc',
182 'src/google/protobuf/compiler/cpp/cpp_enum.h',
183 'src/google/protobuf/compiler/cpp/cpp_enum_field.cc',
184 'src/google/protobuf/compiler/cpp/cpp_enum_field.h',
185 'src/google/protobuf/compiler/cpp/cpp_extension.cc',
186 'src/google/protobuf/compiler/cpp/cpp_extension.h',
187 'src/google/protobuf/compiler/cpp/cpp_field.cc',
188 'src/google/protobuf/compiler/cpp/cpp_field.h',
189 'src/google/protobuf/compiler/cpp/cpp_file.cc',
190 'src/google/protobuf/compiler/cpp/cpp_file.h',
191 'src/google/protobuf/compiler/cpp/cpp_generator.cc',
192 'src/google/protobuf/compiler/cpp/cpp_helpers.cc',
193 'src/google/protobuf/compiler/cpp/cpp_helpers.h',
194 'src/google/protobuf/compiler/cpp/cpp_message.cc',
195 'src/google/protobuf/compiler/cpp/cpp_message.h',
196 'src/google/protobuf/compiler/cpp/cpp_message_field.cc',
197 'src/google/protobuf/compiler/cpp/cpp_message_field.h',
198 'src/google/protobuf/compiler/cpp/cpp_primitive_field.cc',
199 'src/google/protobuf/compiler/cpp/cpp_primitive_field.h',
200 'src/google/protobuf/compiler/cpp/cpp_service.cc',
201 'src/google/protobuf/compiler/cpp/cpp_service.h',
202 'src/google/protobuf/compiler/cpp/cpp_string_field.cc',
203 'src/google/protobuf/compiler/cpp/cpp_string_field.h',
204 'src/google/protobuf/compiler/java/java_enum.cc',
205 'src/google/protobuf/compiler/java/java_enum.h',
206 'src/google/protobuf/compiler/java/java_enum_field.cc',
207 'src/google/protobuf/compiler/java/java_enum_field.h',
208 'src/google/protobuf/compiler/java/java_extension.cc',
209 'src/google/protobuf/compiler/java/java_extension.h',
210 'src/google/protobuf/compiler/java/java_field.cc',
211 'src/google/protobuf/compiler/java/java_field.h',
212 'src/google/protobuf/compiler/java/java_file.cc',
213 'src/google/protobuf/compiler/java/java_file.h',
214 'src/google/protobuf/compiler/java/java_generator.cc',
215 'src/google/protobuf/compiler/java/java_helpers.cc',
216 'src/google/protobuf/compiler/java/java_helpers.h',
217 'src/google/protobuf/compiler/java/java_message.cc',
218 'src/google/protobuf/compiler/java/java_message.h',
219 'src/google/protobuf/compiler/java/java_message_field.cc',
220 'src/google/protobuf/compiler/java/java_message_field.h',
221 'src/google/protobuf/compiler/java/java_primitive_field.cc',
222 'src/google/protobuf/compiler/java/java_primitive_field.h',
223 'src/google/protobuf/compiler/java/java_service.cc',
224 'src/google/protobuf/compiler/java/java_service.h',
225 'src/google/protobuf/compiler/java/java_string_field.cc',
226 'src/google/protobuf/compiler/java/java_string_field.h',
227 'src/google/protobuf/compiler/python/python_generator.cc',
228 'src/google/protobuf/compiler/main.cc',
229 ],
230 'dependencies': [
231 'protobuf_full_do_not_use',
232 ], 87 ],
233 'include_dirs': [ 88 'include_dirs': [
234 '<(config_h_dir)', 89 '<(config_h_dir)',
235 'src/src', 90 'src',
236 ], 91 ],
237 }, { # else, OS=="ios" 92 # This macro must be defined to suppress the use of dynamic_cast<>,
93 # which requires RTTI.
94 'defines': [
95 'GOOGLE_PROTOBUF_NO_RTTI',
96 'GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER',
97 ],
98
99 'direct_dependent_settings': {
100 'include_dirs': [
101 '<(config_h_dir)',
102 'src',
103 ],
104 'defines': [
105 'GOOGLE_PROTOBUF_NO_RTTI',
106 'GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER',
107 ],
108 },
109 },
110 # This is the full, heavy protobuf lib that's needed for c++ .proto's
111 # that don't specify the LITE_RUNTIME option. The protocol
112 # compiler itself (protoc) falls into that category.
113 #
114 # DO NOT LINK AGAINST THIS TARGET IN CHROME CODE --agl
115 {
116 'target_name': 'protobuf_full_do_not_use',
117 'type': 'static_library',
118 'toolsets': ['host','target'],
119 'sources': [
120 'src/google/protobuf/descriptor.h',
121 'src/google/protobuf/descriptor.pb.h',
122 'src/google/protobuf/descriptor_database.h',
123 'src/google/protobuf/dynamic_message.h',
124 'src/google/protobuf/generated_message_reflection.h',
125 'src/google/protobuf/message.h',
126 'src/google/protobuf/reflection_ops.h',
127 'src/google/protobuf/service.h',
128 'src/google/protobuf/text_format.h',
129 'src/google/protobuf/wire_format.h',
130 'src/google/protobuf/io/gzip_stream.h',
131 'src/google/protobuf/io/printer.h',
132 'src/google/protobuf/io/tokenizer.h',
133 'src/google/protobuf/io/zero_copy_stream_impl.h',
134 'src/google/protobuf/compiler/code_generator.h',
135 'src/google/protobuf/compiler/command_line_interface.h',
136 'src/google/protobuf/compiler/importer.h',
137 'src/google/protobuf/compiler/parser.h',
138
139 'src/google/protobuf/stubs/strutil.cc',
140 'src/google/protobuf/stubs/strutil.h',
141 'src/google/protobuf/stubs/substitute.cc',
142 'src/google/protobuf/stubs/substitute.h',
143 'src/google/protobuf/stubs/structurally_valid.cc',
144 'src/google/protobuf/descriptor.cc',
145 'src/google/protobuf/descriptor.pb.cc',
146 'src/google/protobuf/descriptor_database.cc',
147 'src/google/protobuf/dynamic_message.cc',
148 'src/google/protobuf/extension_set_heavy.cc',
149 'src/google/protobuf/generated_message_reflection.cc',
150 'src/google/protobuf/message.cc',
151 'src/google/protobuf/reflection_ops.cc',
152 'src/google/protobuf/service.cc',
153 'src/google/protobuf/text_format.cc',
154 'src/google/protobuf/wire_format.cc',
155 # This file pulls in zlib, but it's not actually used by protoc, so
156 # instead of compiling zlib for the host, let's just exclude this.
157 # 'src/src/google/protobuf/io/gzip_stream.cc',
158 'src/google/protobuf/io/printer.cc',
159 'src/google/protobuf/io/tokenizer.cc',
160 'src/google/protobuf/io/zero_copy_stream_impl.cc',
161 'src/google/protobuf/compiler/importer.cc',
162 'src/google/protobuf/compiler/parser.cc',
163 ],
164 'dependencies': [
165 'protobuf_lite',
166 ],
167 'export_dependent_settings': [
168 'protobuf_lite',
169 ],
170 },
171 {
172 'target_name': 'protoc',
173 'conditions': [
174 ['OS!="ios"', {
175 'type': 'executable',
176 'toolsets': ['host'],
177 'sources': [
178 'src/google/protobuf/compiler/code_generator.cc',
179 'src/google/protobuf/compiler/command_line_interface.cc',
180 'src/google/protobuf/compiler/plugin.cc',
181 'src/google/protobuf/compiler/plugin.pb.cc',
182 'src/google/protobuf/compiler/subprocess.cc',
183 'src/google/protobuf/compiler/subprocess.h',
184 'src/google/protobuf/compiler/zip_writer.cc',
185 'src/google/protobuf/compiler/zip_writer.h',
186 'src/google/protobuf/compiler/cpp/cpp_enum.cc',
187 'src/google/protobuf/compiler/cpp/cpp_enum.h',
188 'src/google/protobuf/compiler/cpp/cpp_enum_field.cc',
189 'src/google/protobuf/compiler/cpp/cpp_enum_field.h',
190 'src/google/protobuf/compiler/cpp/cpp_extension.cc',
191 'src/google/protobuf/compiler/cpp/cpp_extension.h',
192 'src/google/protobuf/compiler/cpp/cpp_field.cc',
193 'src/google/protobuf/compiler/cpp/cpp_field.h',
194 'src/google/protobuf/compiler/cpp/cpp_file.cc',
195 'src/google/protobuf/compiler/cpp/cpp_file.h',
196 'src/google/protobuf/compiler/cpp/cpp_generator.cc',
197 'src/google/protobuf/compiler/cpp/cpp_helpers.cc',
198 'src/google/protobuf/compiler/cpp/cpp_helpers.h',
199 'src/google/protobuf/compiler/cpp/cpp_message.cc',
200 'src/google/protobuf/compiler/cpp/cpp_message.h',
201 'src/google/protobuf/compiler/cpp/cpp_message_field.cc',
202 'src/google/protobuf/compiler/cpp/cpp_message_field.h',
203 'src/google/protobuf/compiler/cpp/cpp_primitive_field.cc',
204 'src/google/protobuf/compiler/cpp/cpp_primitive_field.h',
205 'src/google/protobuf/compiler/cpp/cpp_service.cc',
206 'src/google/protobuf/compiler/cpp/cpp_service.h',
207 'src/google/protobuf/compiler/cpp/cpp_string_field.cc',
208 'src/google/protobuf/compiler/cpp/cpp_string_field.h',
209 'src/google/protobuf/compiler/java/java_enum.cc',
210 'src/google/protobuf/compiler/java/java_enum.h',
211 'src/google/protobuf/compiler/java/java_enum_field.cc',
212 'src/google/protobuf/compiler/java/java_enum_field.h',
213 'src/google/protobuf/compiler/java/java_extension.cc',
214 'src/google/protobuf/compiler/java/java_extension.h',
215 'src/google/protobuf/compiler/java/java_field.cc',
216 'src/google/protobuf/compiler/java/java_field.h',
217 'src/google/protobuf/compiler/java/java_file.cc',
218 'src/google/protobuf/compiler/java/java_file.h',
219 'src/google/protobuf/compiler/java/java_generator.cc',
220 'src/google/protobuf/compiler/java/java_helpers.cc',
221 'src/google/protobuf/compiler/java/java_helpers.h',
222 'src/google/protobuf/compiler/java/java_message.cc',
223 'src/google/protobuf/compiler/java/java_message.h',
224 'src/google/protobuf/compiler/java/java_message_field.cc',
225 'src/google/protobuf/compiler/java/java_message_field.h',
226 'src/google/protobuf/compiler/java/java_primitive_field.cc',
227 'src/google/protobuf/compiler/java/java_primitive_field.h',
228 'src/google/protobuf/compiler/java/java_service.cc',
229 'src/google/protobuf/compiler/java/java_service.h',
230 'src/google/protobuf/compiler/java/java_string_field.cc',
231 'src/google/protobuf/compiler/java/java_string_field.h',
232 'src/google/protobuf/compiler/python/python_generator.cc',
233 'src/google/protobuf/compiler/main.cc',
234 ],
235 'dependencies': [
236 'protobuf_full_do_not_use',
237 ],
238 'include_dirs': [
239 '<(config_h_dir)',
240 'src/src',
241 ],
242 }, { # else, OS=="ios"
243 'type': 'none',
244 'variables': {
245 'ninja_output_dir': 'ninja-protoc',
246 # Gyp to rerun
247 're_run_targets': [
248 'third_party/protobuf/protobuf.gyp',
249 ],
250 },
251 'includes': ['../../build/ios/mac_build.gypi'],
252 'actions': [
253 {
254 'action_name': 'compile protoc',
255 'inputs': [],
256 'outputs': [],
257 'action': [
258 '<@(ninja_cmd)',
259 'protoc',
260 ],
261 'message': 'Generating the C++ protocol buffers compiler',
262 },
263 {
264 'action_name': 'copy protoc',
265 'inputs': [
266 '<(ninja_product_dir)/protoc',
267 ],
268 'outputs': [
269 '<(PRODUCT_DIR)/protoc',
270 ],
271 'action': [
272 'cp',
273 '<(ninja_product_dir)/protoc',
274 '<(PRODUCT_DIR)/protoc',
275 ],
276 },
277 ],
278 }],
279 ],
280 },
281 {
282 # Generate the python module needed by all protoc-generated Python cod e.
283 'target_name': 'py_proto',
238 'type': 'none', 284 'type': 'none',
239 'variables': { 285 'copies': [
240 'ninja_output_dir': 'ninja-protoc',
241 # Gyp to rerun
242 're_run_targets': [
243 'third_party/protobuf/protobuf.gyp',
244 ],
245 },
246 'includes': ['../../build/ios/mac_build.gypi'],
247 'actions': [
248 { 286 {
249 'action_name': 'compile protoc', 287 'destination': '<(PRODUCT_DIR)/pyproto/google/',
250 'inputs': [], 288 'files': [
251 'outputs': [], 289 # google/ module gets an empty __init__.py.
252 'action': [ 290 '__init__.py',
253 '<@(ninja_cmd)', 291 ],
254 'protoc',
255 ],
256 'message': 'Generating the C++ protocol buffers compiler',
257 }, 292 },
258 { 293 {
259 'action_name': 'copy protoc', 294 'destination': '<(PRODUCT_DIR)/pyproto/google/protobuf',
260 'inputs': [ 295 'files': [
261 '<(ninja_product_dir)/protoc', 296 'python/google/protobuf/__init__.py',
262 ], 297 'python/google/protobuf/descriptor.py',
263 'outputs': [ 298 'python/google/protobuf/message.py',
264 '<(PRODUCT_DIR)/protoc', 299 'python/google/protobuf/reflection.py',
265 ], 300 'python/google/protobuf/service.py',
266 'action': [ 301 'python/google/protobuf/service_reflection.py',
267 'cp', 302 'python/google/protobuf/text_format.py',
268 '<(ninja_product_dir)/protoc', 303
269 '<(PRODUCT_DIR)/protoc', 304 # TODO(ncarter): protoc's python generator treats descriptor.pro to
305 # specially, but it's not possible to trigger the special treatm ent
306 # unless you run protoc from ./src/src (the treatment is based
307 # on the path to the .proto file matching a constant exactly).
308 # I'm not sure how to convince gyp to execute a rule from a
309 # different directory. Until this is resolved, use a copy of
310 # descriptor_pb2.py that I manually generated.
311 'descriptor_pb2.py',
270 ], 312 ],
271 }, 313 },
272 ], 314 {
273 }], 315 'destination': '<(PRODUCT_DIR)/pyproto/google/protobuf/internal',
316 'files': [
317 'python/google/protobuf/internal/__init__.py',
318 'python/google/protobuf/internal/api_implementation.py',
319 'python/google/protobuf/internal/containers.py',
320 'python/google/protobuf/internal/cpp_message.py',
321 'python/google/protobuf/internal/decoder.py',
322 'python/google/protobuf/internal/encoder.py',
323 'python/google/protobuf/internal/generator_test.py',
324 'python/google/protobuf/internal/message_listener.py',
325 'python/google/protobuf/internal/python_message.py',
326 'python/google/protobuf/internal/type_checkers.py',
327 'python/google/protobuf/internal/wire_format.py',
328 ],
329 },
330 ],
331 # # We can't generate a proper descriptor_pb2.py -- see earlier comment.
332 # 'rules': [
333 # {
334 # 'rule_name': 'genproto',
335 # 'extension': 'proto',
336 # 'inputs': [
337 # '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)protoc<(EXECUTABLE_SUFFIX)',
338 # ],
339 # 'variables': {
340 # # The protoc compiler requires a proto_path argument with the
341 # # directory containing the .proto file.
342 # 'rule_input_relpath': 'src/google/protobuf',
343 # },
344 # 'outputs': [
345 # '<(PRODUCT_DIR)/pyproto/google/protobuf/<(RULE_INPUT_ROOT)_pb2 .py',
346 # ],
347 # 'action': [
348 # '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)protoc<(EXECUTABLE_SUFFIX) ',
349 # '-I./src',
350 # '-I.',
351 # '--python_out=<(PRODUCT_DIR)/pyproto/google/protobuf',
352 # 'google/protobuf/descriptor.proto',
353 # ],
354 # 'message': 'Generating Python code from <(RULE_INPUT_PATH)',
355 # },
356 # ],
357 # 'dependencies': [
358 # 'protoc#host',
359 # ],
360 # 'sources': [
361 # 'src/google/protobuf/descriptor.proto',
362 # ],
363 },
274 ], 364 ],
275 }, 365 }, { # use_system_protobuf==1
276 { 366 'targets': [
277 # Generate the python module needed by all protoc-generated Python code. 367 {
278 'target_name': 'py_proto', 368 'target_name': 'protobuf_lite',
279 'type': 'none', 369 'type': 'none',
280 'copies': [ 370 'direct_dependent_settings': {
281 { 371 'cflags': [
282 'destination': '<(PRODUCT_DIR)/pyproto/google/', 372 '<!@(pkg-config --cflags protobuf-lite)',
283 'files': [ 373 ],
284 # google/ module gets an empty __init__.py. 374 'defines': [
285 '__init__.py', 375 # This macro must be defined to suppress the use of dynamic_cast<> ,
agl 2012/10/23 13:58:44 This comment looks like it needs rewrapping, as do
286 ], 376 # which requires RTTI.
287 }, 377 'GOOGLE_PROTOBUF_NO_RTTI',
288 { 378 'GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER',
289 'destination': '<(PRODUCT_DIR)/pyproto/google/protobuf', 379 ],
290 'files': [ 380 },
291 'python/google/protobuf/__init__.py', 381 'link_settings': {
292 'python/google/protobuf/descriptor.py', 382 'ldflags': [
293 'python/google/protobuf/message.py', 383 '<!@(pkg-config --libs-only-L --libs-only-other protobuf-lite)',
294 'python/google/protobuf/reflection.py', 384 ],
295 'python/google/protobuf/service.py', 385 'libraries': [
296 'python/google/protobuf/service_reflection.py', 386 '<!@(pkg-config --libs-only-l protobuf-lite)',
297 'python/google/protobuf/text_format.py', 387 ],
298 388 },
299 # TODO(ncarter): protoc's python generator treats descriptor.proto 389 },
300 # specially, but it's not possible to trigger the special treatment 390 {
301 # unless you run protoc from ./src/src (the treatment is based 391 'target_name': 'protoc',
302 # on the path to the .proto file matching a constant exactly). 392 'type': 'none',
303 # I'm not sure how to convince gyp to execute a rule from a 393 'toolsets': ['host', 'target'],
304 # different directory. Until this is resolved, use a copy of 394 },
305 # descriptor_pb2.py that I manually generated. 395 {
306 'descriptor_pb2.py', 396 'target_name': 'py_proto',
307 ], 397 'type': 'none',
308 },
309 {
310 'destination': '<(PRODUCT_DIR)/pyproto/google/protobuf/internal',
311 'files': [
312 'python/google/protobuf/internal/__init__.py',
313 'python/google/protobuf/internal/api_implementation.py',
314 'python/google/protobuf/internal/containers.py',
315 'python/google/protobuf/internal/cpp_message.py',
316 'python/google/protobuf/internal/decoder.py',
317 'python/google/protobuf/internal/encoder.py',
318 'python/google/protobuf/internal/generator_test.py',
319 'python/google/protobuf/internal/message_listener.py',
320 'python/google/protobuf/internal/python_message.py',
321 'python/google/protobuf/internal/type_checkers.py',
322 'python/google/protobuf/internal/wire_format.py',
323 ],
324 }, 398 },
325 ], 399 ],
326 # # We can't generate a proper descriptor_pb2.py -- see earlier comment. 400 }],
327 # 'rules': [
328 # {
329 # 'rule_name': 'genproto',
330 # 'extension': 'proto',
331 # 'inputs': [
332 # '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)protoc<(EXECUTABLE_SUFFIX)',
333 # ],
334 # 'variables': {
335 # # The protoc compiler requires a proto_path argument with the
336 # # directory containing the .proto file.
337 # 'rule_input_relpath': 'src/google/protobuf',
338 # },
339 # 'outputs': [
340 # '<(PRODUCT_DIR)/pyproto/google/protobuf/<(RULE_INPUT_ROOT)_pb2.py' ,
341 # ],
342 # 'action': [
343 # '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)protoc<(EXECUTABLE_SUFFIX)',
344 # '-I./src',
345 # '-I.',
346 # '--python_out=<(PRODUCT_DIR)/pyproto/google/protobuf',
347 # 'google/protobuf/descriptor.proto',
348 # ],
349 # 'message': 'Generating Python code from <(RULE_INPUT_PATH)',
350 # },
351 # ],
352 # 'dependencies': [
353 # 'protoc#host',
354 # ],
355 # 'sources': [
356 # 'src/google/protobuf/descriptor.proto',
357 # ],
358 },
359 ], 401 ],
360 } 402 }
OLDNEW
« no previous file with comments | « build/protoc.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698