| OLD | NEW |
| (Empty) |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | |
| 2 # Use of this source code is governed by a BSD-style license that can be | |
| 3 # found in the LICENSE file. | |
| 4 | |
| 5 { | |
| 6 'includes': [ | |
| 7 'mojom_bindings_generator_variables.gypi', | |
| 8 ], | |
| 9 'variables': { | |
| 10 'mojom_base_output_dir': | |
| 11 '<!(python <(DEPTH)/build/inverse_depth.py <(DEPTH))', | |
| 12 'mojom_generated_outputs': [ | |
| 13 '<!@(python <(DEPTH)/third_party/mojo/src/mojo/public/tools/bindings/mojom
_list_outputs.py --basedir <(mojom_base_output_dir) <@(mojom_files))', | |
| 14 ], | |
| 15 'mojom_include_path%': '<(DEPTH)', | |
| 16 'require_interface_bindings%': 1, | |
| 17 }, | |
| 18 # Given mojom files as inputs, generate sources. These sources will be | |
| 19 # exported to another target (via dependent_settings) to be compiled. This | |
| 20 # keeps code generation separate from compilation, allowing the same sources | |
| 21 # to be compiled with multiple toolchains - target, NaCl, etc. | |
| 22 'actions': [ | |
| 23 { | |
| 24 'variables': { | |
| 25 'java_out_dir': '<(PRODUCT_DIR)/java_mojo/<(_target_name)/src', | |
| 26 'stamp_filename': '<(PRODUCT_DIR)/java_mojo/<(_target_name)/<(_target_na
me).stamp', | |
| 27 }, | |
| 28 'action_name': '<(_target_name)_mojom_bindings_stamp', | |
| 29 # The java output directory is deleted to ensure that the java library | |
| 30 # doesn't try to compile stale files. | |
| 31 'action': [ | |
| 32 'python', '<(DEPTH)/build/rmdir_and_stamp.py', | |
| 33 '<(java_out_dir)', | |
| 34 '<(stamp_filename)', | |
| 35 ], | |
| 36 'inputs': [ '<@(mojom_files)' ], | |
| 37 'outputs': [ '<(stamp_filename)' ], | |
| 38 }, | |
| 39 { | |
| 40 'action_name': '<(_target_name)_mojom_bindings_generator', | |
| 41 'variables': { | |
| 42 'java_out_dir': '<(PRODUCT_DIR)/java_mojo/<(_target_name)/src', | |
| 43 'stamp_filename': '<(PRODUCT_DIR)/java_mojo/<(_target_name)/<(_target_na
me).stamp', | |
| 44 'mojom_import_args%': [ | |
| 45 '-I<(DEPTH)', | |
| 46 '-I<(DEPTH)/mojo/services', | |
| 47 '-I<(DEPTH)/third_party/mojo/src', | |
| 48 '-I<(mojom_include_path)', | |
| 49 ], | |
| 50 }, | |
| 51 'inputs': [ | |
| 52 '<@(mojom_bindings_generator_sources)', | |
| 53 '<@(mojom_files)', | |
| 54 '<(stamp_filename)', | |
| 55 ], | |
| 56 'outputs': [ | |
| 57 '<@(mojom_generated_outputs)', | |
| 58 ], | |
| 59 'action': [ | |
| 60 'python', '<@(mojom_bindings_generator)', | |
| 61 '<@(mojom_files)', | |
| 62 '--use_bundled_pylibs', | |
| 63 '-d', '<(DEPTH)', | |
| 64 '<@(mojom_import_args)', | |
| 65 '-o', '<(SHARED_INTERMEDIATE_DIR)', | |
| 66 '--java_output_directory=<(java_out_dir)', | |
| 67 ], | |
| 68 'message': 'Generating Mojo bindings from <@(mojom_files)', | |
| 69 } | |
| 70 ], | |
| 71 'conditions': [ | |
| 72 ['require_interface_bindings==1', { | |
| 73 'dependencies': [ | |
| 74 '<(DEPTH)/base/base.gyp:base', | |
| 75 '<(DEPTH)/third_party/mojo/mojo_public.gyp:mojo_interface_bindings_gener
ation', | |
| 76 ], | |
| 77 }], | |
| 78 ], | |
| 79 # Prevent the generated sources from being injected into the "all" target by | |
| 80 # preventing the code generator from being directly depended on by the "all" | |
| 81 # target. | |
| 82 'suppress_wildcard': '1', | |
| 83 'hard_dependency': '1', | |
| 84 'direct_dependent_settings': { | |
| 85 # A target directly depending on this action will compile the generated | |
| 86 # sources. | |
| 87 'sources': [ | |
| 88 '<@(mojom_generated_outputs)', | |
| 89 ], | |
| 90 # Include paths needed to compile the generated sources into a library. | |
| 91 'include_dirs': [ | |
| 92 '<(DEPTH)', | |
| 93 '<(DEPTH)/third_party/mojo/src', | |
| 94 '<(SHARED_INTERMEDIATE_DIR)', | |
| 95 '<(SHARED_INTERMEDIATE_DIR)/third_party/mojo/src', | |
| 96 ], | |
| 97 # Make sure the generated header files are available for any static library | |
| 98 # that depends on a static library that depends on this generator. | |
| 99 'hard_dependency': 1, | |
| 100 'direct_dependent_settings': { | |
| 101 # Include paths needed to find the generated header files and their | |
| 102 # transitive dependancies when using the library. | |
| 103 'include_dirs': [ | |
| 104 '<(DEPTH)', | |
| 105 '<(DEPTH)/third_party/mojo/src', | |
| 106 '<(SHARED_INTERMEDIATE_DIR)', | |
| 107 '<(SHARED_INTERMEDIATE_DIR)/third_party/mojo/src', | |
| 108 ], | |
| 109 'variables': { | |
| 110 'generated_src_dirs': [ | |
| 111 '<(PRODUCT_DIR)/java_mojo/<(_target_name)/src', | |
| 112 ], | |
| 113 'additional_input_paths': [ | |
| 114 '<@(mojom_bindings_generator_sources)', | |
| 115 '<@(mojom_files)', | |
| 116 ], | |
| 117 'mojom_generated_sources': [ '<@(mojom_generated_outputs)' ], | |
| 118 }, | |
| 119 } | |
| 120 }, | |
| 121 } | |
| OLD | NEW |