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))',
15 'mojom_include_path%': '<(DEPTH)',
16 'require_interface_bindings%': 1,
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.
25 'java_out_dir': '<(PRODUCT_DIR)/java_mojo/<(_target_name)/src',
26 'stamp_filename': '<(PRODUCT_DIR)/java_mojo/<(_target_name)/<(_target_name).stamp',
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.
32 'python', '<(DEPTH)/build/rmdir_and_stamp.py',
36 'inputs': [ '<@(mojom_files)' ],
37 'outputs': [ '<(stamp_filename)' ],
40 'action_name': '<(_target_name)_mojom_bindings_generator',
42 'java_out_dir': '<(PRODUCT_DIR)/java_mojo/<(_target_name)/src',
43 'stamp_filename': '<(PRODUCT_DIR)/java_mojo/<(_target_name)/<(_target_name).stamp',
44 'mojom_import_args%': [
46 '-I<(DEPTH)/mojo/services',
47 '-I<(DEPTH)/third_party/mojo/src',
48 '-I<(mojom_include_path)',
52 '<@(mojom_bindings_generator_sources)',
57 '<@(mojom_generated_outputs)',
60 'python', '<@(mojom_bindings_generator)',
62 '--use_bundled_pylibs',
64 '<@(mojom_import_args)',
65 '-o', '<(SHARED_INTERMEDIATE_DIR)',
66 '--java_output_directory=<(java_out_dir)',
67 '--dart_mojo_root=//third_party/mojo/src',
69 'message': 'Generating Mojo bindings from <@(mojom_files)',
73 ['require_interface_bindings==1', {
75 '<(DEPTH)/third_party/mojo/mojo_public.gyp:mojo_interface_bindings_generation',
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"
82 'suppress_wildcard': '1',
83 'hard_dependency': '1',
84 'direct_dependent_settings': {
85 # A target directly depending on this action will compile the generated
88 '<@(mojom_generated_outputs)',
90 # Include paths needed to compile the generated sources into a library.
93 '<(DEPTH)/third_party/mojo/src',
94 '<(SHARED_INTERMEDIATE_DIR)',
95 '<(SHARED_INTERMEDIATE_DIR)/third_party/mojo/src',
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.
100 'direct_dependent_settings': {
101 # Include paths needed to find the generated header files and their
102 # transitive dependancies when using the library.
105 '<(DEPTH)/third_party/mojo/src',
106 '<(SHARED_INTERMEDIATE_DIR)',
107 '<(SHARED_INTERMEDIATE_DIR)/third_party/mojo/src',
110 'generated_src_dirs': [
111 '<(PRODUCT_DIR)/java_mojo/<(_target_name)/src',
113 'additional_input_paths': [
114 '<@(mojom_bindings_generator_sources)',
117 'mojom_generated_sources': [ '<@(mojom_generated_outputs)' ],