| 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 'variables': { | |
| 11 'mojom_variant%': 'none', | |
| 12 }, | |
| 13 'mojom_variant%': '<(mojom_variant)', | |
| 14 'mojom_base_output_dir': | |
| 15 '<!(python <(DEPTH)/build/inverse_depth.py <(DEPTH))', | |
| 16 'mojom_generated_outputs': [ | |
| 17 '<!@(python <(DEPTH)/mojo/public/tools/bindings/mojom_list_outputs.py --ba
sedir <(mojom_base_output_dir) --variant <(mojom_variant) <@(mojom_files))', | |
| 18 ], | |
| 19 'mojom_include_path%': '<(DEPTH)', | |
| 20 'mojom_extra_generator_args%': [], | |
| 21 'require_interface_bindings%': 1, | |
| 22 'conditions': [ | |
| 23 ['mojom_variant=="none"', { | |
| 24 'mojom_output_languages%': 'c++,javascript,java', | |
| 25 }, { | |
| 26 'mojom_output_languages%': 'c++', | |
| 27 }], | |
| 28 ], | |
| 29 }, | |
| 30 # Given mojom files as inputs, generate sources. These sources will be | |
| 31 # exported to another target (via dependent_settings) to be compiled. This | |
| 32 # keeps code generation separate from compilation, allowing the same sources | |
| 33 # to be compiled with multiple toolchains - target, NaCl, etc. | |
| 34 'actions': [ | |
| 35 { | |
| 36 'variables': { | |
| 37 'java_out_dir': '<(PRODUCT_DIR)/java_mojo/<(_target_name)/src', | |
| 38 'stamp_filename': '<(PRODUCT_DIR)/java_mojo/<(_target_name)/<(_target_na
me).stamp', | |
| 39 }, | |
| 40 'action_name': '<(_target_name)_mojom_bindings_stamp', | |
| 41 # The java output directory is deleted to ensure that the java library | |
| 42 # doesn't try to compile stale files. | |
| 43 'action': [ | |
| 44 'python', '<(DEPTH)/build/rmdir_and_stamp.py', | |
| 45 '<(java_out_dir)', | |
| 46 '<(stamp_filename)', | |
| 47 ], | |
| 48 'inputs': [ | |
| 49 '<@(mojom_files)', | |
| 50 '<(SHARED_INTERMEDIATE_DIR)/mojo/public/tools/bindings/cpp_templates.zip
', | |
| 51 '<(SHARED_INTERMEDIATE_DIR)/mojo/public/tools/bindings/java_templates.zi
p', | |
| 52 '<(SHARED_INTERMEDIATE_DIR)/mojo/public/tools/bindings/js_templates.zip'
, | |
| 53 ], | |
| 54 'outputs': [ '<(stamp_filename)' ], | |
| 55 }, | |
| 56 { | |
| 57 'action_name': '<(_target_name)_mojom_bindings_generator', | |
| 58 'variables': { | |
| 59 'java_out_dir': '<(PRODUCT_DIR)/java_mojo/<(_target_name)/src', | |
| 60 'stamp_filename': '<(PRODUCT_DIR)/java_mojo/<(_target_name)/<(_target_na
me).stamp', | |
| 61 'mojom_import_args%': [ | |
| 62 '-I<(DEPTH)', | |
| 63 '-I<(DEPTH)/mojo/services', | |
| 64 '-I<(mojom_include_path)', | |
| 65 ], | |
| 66 }, | |
| 67 'inputs': [ | |
| 68 '<@(mojom_bindings_generator_sources)', | |
| 69 '<@(mojom_files)', | |
| 70 '<(stamp_filename)', | |
| 71 ], | |
| 72 'outputs': [ | |
| 73 '<@(mojom_generated_outputs)', | |
| 74 ], | |
| 75 'action': [ | |
| 76 'python', '<@(mojom_bindings_generator)', | |
| 77 '--use_bundled_pylibs', 'generate', | |
| 78 '<@(mojom_files)', | |
| 79 '-d', '<(DEPTH)', | |
| 80 '<@(mojom_import_args)', | |
| 81 '-o', '<(SHARED_INTERMEDIATE_DIR)', | |
| 82 '--java_output_directory=<(java_out_dir)', | |
| 83 '--variant', '<(mojom_variant)', | |
| 84 '-g', '<(mojom_output_languages)', | |
| 85 '<@(mojom_extra_generator_args)', | |
| 86 '--bytecode_path', | |
| 87 '<(SHARED_INTERMEDIATE_DIR)/mojo/public/tools/bindings', | |
| 88 ], | |
| 89 'message': 'Generating Mojo bindings from <@(mojom_files)', | |
| 90 } | |
| 91 ], | |
| 92 'conditions': [ | |
| 93 ['require_interface_bindings==1', { | |
| 94 'dependencies': [ | |
| 95 '<(DEPTH)/base/base.gyp:base', | |
| 96 '<(DEPTH)/mojo/public/tools/bindings/bindings.gyp:precompile_mojom_bindi
ngs_generator_templates', | |
| 97 '<(DEPTH)/third_party/mojo/mojo_public.gyp:mojo_interface_bindings_gener
ation', | |
| 98 ], | |
| 99 }], | |
| 100 ], | |
| 101 # Prevent the generated sources from being injected into the "all" target by | |
| 102 # preventing the code generator from being directly depended on by the "all" | |
| 103 # target. | |
| 104 'suppress_wildcard': '1', | |
| 105 'hard_dependency': '1', | |
| 106 'direct_dependent_settings': { | |
| 107 # A target directly depending on this action will compile the generated | |
| 108 # sources. | |
| 109 'sources': [ | |
| 110 '<@(mojom_generated_outputs)', | |
| 111 ], | |
| 112 # Include paths needed to compile the generated sources into a library. | |
| 113 'include_dirs': [ | |
| 114 '<(DEPTH)', | |
| 115 '<(SHARED_INTERMEDIATE_DIR)', | |
| 116 ], | |
| 117 # Make sure the generated header files are available for any static library | |
| 118 # that depends on a static library that depends on this generator. | |
| 119 'hard_dependency': 1, | |
| 120 'direct_dependent_settings': { | |
| 121 # Include paths needed to find the generated header files and their | |
| 122 # transitive dependancies when using the library. | |
| 123 'include_dirs': [ | |
| 124 '<(DEPTH)', | |
| 125 '<(SHARED_INTERMEDIATE_DIR)', | |
| 126 ], | |
| 127 'variables': { | |
| 128 'generated_src_dirs': [ | |
| 129 '<(PRODUCT_DIR)/java_mojo/<(_target_name)/src', | |
| 130 ], | |
| 131 'additional_input_paths': [ | |
| 132 '<@(mojom_bindings_generator_sources)', | |
| 133 '<@(mojom_files)', | |
| 134 ], | |
| 135 'mojom_generated_sources': [ '<@(mojom_generated_outputs)' ], | |
| 136 }, | |
| 137 } | |
| 138 }, | |
| 139 } | |
| OLD | NEW |