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