| 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 mojom_generator_root = "//mojo/public/tools/bindings" | 5 mojom_generator_root = "//mojo/public/tools/bindings" |
| 6 mojom_generator_script = "$mojom_generator_root/mojom_bindings_generator.py" | 6 mojom_generator_script = "$mojom_generator_root/mojom_bindings_generator.py" |
| 7 mojom_generator_sources = [ | 7 mojom_generator_sources = [ |
| 8 "$mojom_generator_root/generators/mojom_cpp_generator.py", | 8 "$mojom_generator_root/generators/mojom_cpp_generator.py", |
| 9 "$mojom_generator_root/generators/mojom_js_generator.py", | 9 "$mojom_generator_root/generators/mojom_js_generator.py", |
| 10 "$mojom_generator_root/generators/mojom_java_generator.py", | 10 "$mojom_generator_root/generators/mojom_java_generator.py", |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 } | 202 } |
| 203 | 203 |
| 204 all_deps = [] | 204 all_deps = [] |
| 205 if (defined(invoker.deps)) { | 205 if (defined(invoker.deps)) { |
| 206 all_deps += invoker.deps | 206 all_deps += invoker.deps |
| 207 } | 207 } |
| 208 if (defined(invoker.public_deps)) { | 208 if (defined(invoker.public_deps)) { |
| 209 all_deps += invoker.public_deps | 209 all_deps += invoker.public_deps |
| 210 } | 210 } |
| 211 | 211 |
| 212 group("${target_name}__is_mojom") { | 212 if (defined(invoker.variant)) { |
| 213 variant_suffix = "of_variant_${invoker.variant}" |
| 214 } else { |
| 215 variant_suffix = "of_no_variant" |
| 216 } |
| 217 group("${target_name}__is_mojom_${variant_suffix}") { |
| 213 } | 218 } |
| 214 | 219 |
| 215 # Explicitly ensure that all dependencies (invoker.deps and | 220 # Explicitly ensure that all dependencies (invoker.deps and |
| 216 # invoker.public_deps) are mojom targets themselves. | 221 # invoker.public_deps) are mojom targets of the same variant themselves. |
| 217 group("${target_name}__check_deps_are_all_mojom") { | 222 group("${target_name}__check_deps_are_all_mojom_${variant_suffix}") { |
| 218 deps = [] | 223 deps = [] |
| 219 foreach(d, all_deps) { | 224 foreach(d, all_deps) { |
| 220 name = get_label_info(d, "label_no_toolchain") | 225 name = get_label_info(d, "label_no_toolchain") |
| 221 toolchain = get_label_info(d, "toolchain") | 226 toolchain = get_label_info(d, "toolchain") |
| 222 deps += [ "${name}__is_mojom(${toolchain})" ] | 227 deps += [ "${name}__is_mojom_${variant_suffix}(${toolchain})" ] |
| 223 } | 228 } |
| 224 } | 229 } |
| 225 | 230 |
| 226 if (defined(invoker.sources)) { | 231 if (defined(invoker.sources)) { |
| 227 # The generated C++ source files. The main reason to introduce this target | 232 # The generated C++ source files. The main reason to introduce this target |
| 228 # is so that mojo/public/cpp/bindings can depend on mojom interfaces without | 233 # is so that mojo/public/cpp/bindings can depend on mojom interfaces without |
| 229 # circular dependencies. It means that the target is missing the dependency | 234 # circular dependencies. It means that the target is missing the dependency |
| 230 # on mojo/public/cpp/bindings. No external targets should depend directly on | 235 # on mojo/public/cpp/bindings. No external targets should depend directly on |
| 231 # this target *except* mojo/public/cpp/bindings and other *_cpp_sources | 236 # this target *except* mojo/public/cpp/bindings and other *_cpp_sources |
| 232 # targets. | 237 # targets. |
| 233 source_set(cpp_sources_target_name) { | 238 source_set(cpp_sources_target_name) { |
| 234 if (defined(invoker.testonly)) { | 239 if (defined(invoker.testonly)) { |
| 235 testonly = invoker.testonly | 240 testonly = invoker.testonly |
| 236 } | 241 } |
| 237 sources = process_file_template(invoker.sources, generator_cpp_outputs) | 242 sources = process_file_template(invoker.sources, generator_cpp_outputs) |
| 243 |
| 238 deps = [ | 244 deps = [ |
| 239 ":$generator_target_name", | 245 ":$generator_target_name", |
| 240 "//mojo/public/interfaces/bindings:bindings__generator", | 246 "//mojo/public/interfaces/bindings:bindings__generator", |
| 241 ] | 247 ] |
| 242 public_deps = [ | 248 public_deps = [ |
| 243 "//base", | 249 "//base", |
| 244 ] | 250 ] |
| 245 if (defined(invoker.typemap_deps)) { | |
| 246 public_deps += invoker.typemap_deps | |
| 247 } | |
| 248 foreach(d, all_deps) { | 251 foreach(d, all_deps) { |
| 249 # Resolve the name, so that a target //mojo/something becomes | 252 # Resolve the name, so that a target //mojo/something becomes |
| 250 # //mojo/something:something and we can append cpp_sources_suffix to | 253 # //mojo/something:something and we can append cpp_sources_suffix to |
| 251 # get the cpp dependency name. | 254 # get the cpp dependency name. |
| 252 full_name = get_label_info(d, "label_no_toolchain") | 255 full_name = get_label_info(d, "label_no_toolchain") |
| 253 deps += [ "${full_name}_${cpp_sources_suffix}" ] | 256 deps += [ "${full_name}_${cpp_sources_suffix}" ] |
| 254 } | 257 } |
| 255 if (defined(invoker.for_blink) && invoker.for_blink) { | 258 if (defined(invoker.for_blink) && invoker.for_blink) { |
| 256 public_deps += [ "//mojo/public/cpp/bindings:wtf_support" ] | 259 public_deps += [ "//mojo/public/cpp/bindings:wtf_support" ] |
| 257 } | 260 } |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 # //mojo/something:something and we can append "_java" to get the java | 296 # //mojo/something:something and we can append "_java" to get the java |
| 294 # dependency name. | 297 # dependency name. |
| 295 full_name = get_label_info(d, "label_no_toolchain") | 298 full_name = get_label_info(d, "label_no_toolchain") |
| 296 deps += [ "${full_name}_java" ] | 299 deps += [ "${full_name}_java" ] |
| 297 } | 300 } |
| 298 | 301 |
| 299 srcjar_deps = [ ":$java_srcjar_target_name" ] | 302 srcjar_deps = [ ":$java_srcjar_target_name" ] |
| 300 } | 303 } |
| 301 } | 304 } |
| 302 } | 305 } |
| OLD | NEW |