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 # Defines a static library corresponding to the output of schema compiler tools | 5 # Defines a static library corresponding to the output of schema compiler tools |
6 # over a set of extensions API schemas (IDL or JSON format.) The library target | 6 # over a set of extensions API schemas (IDL or JSON format.) The library target |
7 # has implicit hard dependencies on all schema files listed by the invoker and | 7 # has implicit hard dependencies on all schema files listed by the invoker and |
8 # is itself a hard dependency. | 8 # is itself a hard dependency. |
9 # | 9 # |
10 # Invocations of this template may use the following variables: | 10 # Invocations of this template may use the following variables: |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 "$compiler_root/cpp_util.py", | 68 "$compiler_root/cpp_util.py", |
69 "$compiler_root/h_generator.py", | 69 "$compiler_root/h_generator.py", |
70 "$compiler_root/idl_schema.py", | 70 "$compiler_root/idl_schema.py", |
71 "$compiler_root/model.py", | 71 "$compiler_root/model.py", |
72 "$compiler_root/util_cc_helper.py", | 72 "$compiler_root/util_cc_helper.py", |
73 ] | 73 ] |
74 | 74 |
75 schema_generator_name = target_name + "_schema_generator" | 75 schema_generator_name = target_name + "_schema_generator" |
76 action_foreach(schema_generator_name) { | 76 action_foreach(schema_generator_name) { |
77 script = compiler_script | 77 script = compiler_script |
78 source_prereqs = compiler_sources | 78 inputs = compiler_sources |
79 sources = schemas | 79 sources = schemas |
80 outputs = [ | 80 outputs = [ |
81 "$target_gen_dir/{{source_name_part}}.cc", | 81 "$target_gen_dir/{{source_name_part}}.cc", |
82 "$target_gen_dir/{{source_name_part}}.h", | 82 "$target_gen_dir/{{source_name_part}}.h", |
83 ] | 83 ] |
84 args = [ | 84 args = [ |
85 "{{source}}", | 85 "{{source}}", |
86 "--root=" + rebase_path("//", root_build_dir), | 86 "--root=" + rebase_path("//", root_build_dir), |
87 "--destdir=" + rebase_path(root_gen_dir, root_build_dir), | 87 "--destdir=" + rebase_path(root_gen_dir, root_build_dir), |
88 "--namespace=$root_namespace", | 88 "--namespace=$root_namespace", |
89 "--generator=cpp" ] | 89 "--generator=cpp" ] |
90 visibility = target_visibility | 90 visibility = target_visibility |
91 } | 91 } |
92 | 92 |
93 if (bundle) { | 93 if (bundle) { |
94 assert(defined(invoker.impl_dir), | 94 assert(defined(invoker.impl_dir), |
95 "\"impl_dir\" must be defined for the $target_name template.") | 95 "\"impl_dir\" must be defined for the $target_name template.") |
96 impl_dir = invoker.impl_dir | 96 impl_dir = invoker.impl_dir |
97 | 97 |
98 uncompiled_schemas = [] | 98 uncompiled_schemas = [] |
99 if (defined(invoker.uncompiled_sources)) { | 99 if (defined(invoker.uncompiled_sources)) { |
100 uncompiled_schemas = invoker.uncompiled_sources | 100 uncompiled_schemas = invoker.uncompiled_sources |
101 } | 101 } |
102 | 102 |
103 bundle_generator_name = target_name + "_bundle_generator" | 103 bundle_generator_name = target_name + "_bundle_generator" |
104 action(bundle_generator_name) { | 104 action(bundle_generator_name) { |
105 script = compiler_script | 105 script = compiler_script |
106 source_prereqs = compiler_sources + schemas + uncompiled_schemas | 106 inputs = compiler_sources + schemas + uncompiled_schemas |
107 outputs = [ | 107 outputs = [ |
108 "$target_gen_dir/generated_api.cc", | 108 "$target_gen_dir/generated_api.cc", |
109 "$target_gen_dir/generated_api.h", | 109 "$target_gen_dir/generated_api.h", |
110 "$target_gen_dir/generated_schemas.cc", | 110 "$target_gen_dir/generated_schemas.cc", |
111 "$target_gen_dir/generated_schemas.h", | 111 "$target_gen_dir/generated_schemas.h", |
112 ] | 112 ] |
113 args = [ | 113 args = [ |
114 "--root=" + rebase_path("//", root_build_dir), | 114 "--root=" + rebase_path("//", root_build_dir), |
115 "--destdir=" + rebase_path(root_gen_dir, root_build_dir), | 115 "--destdir=" + rebase_path(root_gen_dir, root_build_dir), |
116 "--namespace=$root_namespace", | 116 "--namespace=$root_namespace", |
(...skipping 24 matching lines...) Expand all Loading... |
141 direct_dependent_configs = [ ":$generated_config_name" ] | 141 direct_dependent_configs = [ ":$generated_config_name" ] |
142 | 142 |
143 if (defined(invoker.visibility)) { | 143 if (defined(invoker.visibility)) { |
144 visibility = invoker.visibility | 144 visibility = invoker.visibility |
145 } | 145 } |
146 if (defined(invoker.output_name)) { | 146 if (defined(invoker.output_name)) { |
147 output_name = invoker.output_name | 147 output_name = invoker.output_name |
148 } | 148 } |
149 } | 149 } |
150 } | 150 } |
OLD | NEW |