| 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 # Compile a protocol buffer. | 5 # Compile a protocol buffer. |
| 6 # | 6 # |
| 7 # Protobuf parameters: | 7 # Protobuf parameters: |
| 8 # | 8 # |
| 9 # proto_in_dir (optional) | 9 # proto_in_dir (optional) |
| 10 # Specifies the path relative to the current BUILD.gn file where | 10 # Specifies the path relative to the current BUILD.gn file where |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 # generator_plugin_options (optional) | 56 # generator_plugin_options (optional) |
| 57 # Extra flags passed to the plugin. See cc_generator_options. | 57 # Extra flags passed to the plugin. See cc_generator_options. |
| 58 # | 58 # |
| 59 # deps (optional) | 59 # deps (optional) |
| 60 # Additional dependencies. | 60 # Additional dependencies. |
| 61 # | 61 # |
| 62 # use_protobuf_full (optional) | 62 # use_protobuf_full (optional) |
| 63 # If adding protobuf library would be required, adds protobuf_full to deps | 63 # If adding protobuf library would be required, adds protobuf_full to deps |
| 64 # instead of protobuf_lite. | 64 # instead of protobuf_lite. |
| 65 # | 65 # |
| 66 # import_dirs (optional) |
| 67 # A list of extra import directories to be passed to protoc compiler. The |
| 68 # default case is just proto_in_dir. |
| 69 # WARNING: This options should not be used in Chrome code until |
| 70 # http://crbug.com/691451 is resolved. |
| 71 # |
| 66 # Parameters for compiling the generated code: | 72 # Parameters for compiling the generated code: |
| 67 # | 73 # |
| 68 # component_build_force_source_set (Default=false) | 74 # component_build_force_source_set (Default=false) |
| 69 # When set true the generated code will be compiled as a source set in | 75 # When set true the generated code will be compiled as a source set in |
| 70 # the component build. This does not affect static builds. If you are | 76 # the component build. This does not affect static builds. If you are |
| 71 # exporting symbols from a component, this is required to prevent those | 77 # exporting symbols from a component, this is required to prevent those |
| 72 # symbols from being stripped. If you're not using dllexports in | 78 # symbols from being stripped. If you're not using dllexports in |
| 73 # cc_generator_options, it's usually best to leave this false. | 79 # cc_generator_options, it's usually best to leave this false. |
| 74 # | 80 # |
| 75 # defines (optional) | 81 # defines (optional) |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 rel_cc_out_dir, | 276 rel_cc_out_dir, |
| 271 ] | 277 ] |
| 272 if (defined(invoker.generator_plugin_options)) { | 278 if (defined(invoker.generator_plugin_options)) { |
| 273 args += [ | 279 args += [ |
| 274 "--plugin-options", | 280 "--plugin-options", |
| 275 invoker.generator_plugin_options, | 281 invoker.generator_plugin_options, |
| 276 ] | 282 ] |
| 277 } | 283 } |
| 278 } | 284 } |
| 279 | 285 |
| 286 if (defined(invoker.import_dirs)) { |
| 287 foreach(path, invoker.import_dirs) { |
| 288 args += ["--import-dir=" + rebase_path(path, root_build_dir)] |
| 289 } |
| 290 } |
| 291 |
| 280 # System protoc is not used so it's necessary to build a chromium one. | 292 # System protoc is not used so it's necessary to build a chromium one. |
| 281 inputs = [ | 293 inputs = [ |
| 282 protoc_path, | 294 protoc_path, |
| 283 ] | 295 ] |
| 284 deps = [ | 296 deps = [ |
| 285 protoc_label, | 297 protoc_label, |
| 286 ] | 298 ] |
| 287 | 299 |
| 288 if (generate_with_plugin) { | 300 if (generate_with_plugin) { |
| 289 inputs += [ plugin_path ] | 301 inputs += [ plugin_path ] |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 ":$action_name", | 380 ":$action_name", |
| 369 ] | 381 ] |
| 370 | 382 |
| 371 # This will link any libraries in the deps (the use of invoker.deps in the | 383 # This will link any libraries in the deps (the use of invoker.deps in the |
| 372 # action won't link it). | 384 # action won't link it). |
| 373 if (defined(invoker.deps)) { | 385 if (defined(invoker.deps)) { |
| 374 deps += invoker.deps | 386 deps += invoker.deps |
| 375 } | 387 } |
| 376 } | 388 } |
| 377 } | 389 } |
| OLD | NEW |