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.
7 'mojom_bindings_generator_variables.gypi',
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))',
16 # Given mojom files as inputs, generate sources. These sources will be
17 # exported to another target (via dependent_settings) to be compiled. This
18 # keeps code generation separate from compilation, allowing the same sources
19 # to be compiled with multiple toolchains - target, NaCl, etc.
23 'java_out_dir': '<(PRODUCT_DIR)/java_mojo/<(_target_name)/src',
24 'stamp_filename': '<(PRODUCT_DIR)/java_mojo/<(_target_name)/<(_target_name).stamp',
26 'action_name': '<(_target_name)_mojom_bindings_stamp',
27 # The java output directory is deleted to ensure that the java library
28 # doesn't try to compile stale files.
30 'python', '<(DEPTH)/build/rmdir_and_stamp.py',
34 'inputs': [ '<@(mojom_files)' ],
35 'outputs': [ '<(stamp_filename)' ],
38 'action_name': '<(_target_name)_mojom_bindings_generator',
40 'java_out_dir': '<(PRODUCT_DIR)/java_mojo/<(_target_name)/src',
41 'stamp_filename': '<(PRODUCT_DIR)/java_mojo/<(_target_name)/<(_target_name).stamp',
42 'mojom_import_args%': [
44 '-I<(DEPTH)/third_party/mojo/src'
48 '<@(mojom_bindings_generator_sources)',
53 '<@(mojom_generated_outputs)',
56 'python', '<@(mojom_bindings_generator)',
58 '--use_bundled_pylibs',
60 '<@(mojom_import_args)',
61 '-o', '<(SHARED_INTERMEDIATE_DIR)',
62 '--java_output_directory=<(java_out_dir)',
64 'message': 'Generating Mojo bindings from <@(mojom_files)',
67 # Prevent the generated sources from being injected into the "all" target by
68 # preventing the code generator from being directly depended on by the "all"
70 'suppress_wildcard': '1',
71 'direct_dependent_settings': {
72 # A target directly depending on this action will compile the generated
75 '<@(mojom_generated_outputs)',
77 # Include paths needed to compile the generated sources into a library.
80 '<(DEPTH)/third_party/mojo/src',
81 '<(SHARED_INTERMEDIATE_DIR)',
82 '<(SHARED_INTERMEDIATE_DIR)/third_party/mojo/src',
84 # Make sure the generated header files are available for any static library
85 # that depends on a static library that depends on this generator.
87 'direct_dependent_settings': {
88 # Include paths needed to find the generated header files and their
89 # transitive dependancies when using the library.
92 '<(DEPTH)/third_party/mojo/src',
93 '<(SHARED_INTERMEDIATE_DIR)',
94 '<(SHARED_INTERMEDIATE_DIR)/third_party/mojo/src',
97 'generated_src_dirs': [
98 '<(PRODUCT_DIR)/java_mojo/<(_target_name)/src',
100 'additional_input_paths': [
101 '<@(mojom_bindings_generator_sources)',