| 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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 variant_suffix = "" | 234 variant_suffix = "" |
| 235 if (defined(bindings_configuration.variant)) { | 235 if (defined(bindings_configuration.variant)) { |
| 236 variant = bindings_configuration.variant | 236 variant = bindings_configuration.variant |
| 237 variant_suffix = "_${variant}" | 237 variant_suffix = "_${variant}" |
| 238 cpp_only = true | 238 cpp_only = true |
| 239 } | 239 } |
| 240 type_mappings_target_name = "${target_name}${variant_suffix}__type_mappings" | 240 type_mappings_target_name = "${target_name}${variant_suffix}__type_mappings" |
| 241 type_mappings_path = | 241 type_mappings_path = |
| 242 "$target_gen_dir/${target_name}${variant_suffix}__type_mappings" | 242 "$target_gen_dir/${target_name}${variant_suffix}__type_mappings" |
| 243 active_typemaps = [] | 243 active_typemaps = [] |
| 244 cpp_sources_suffix = "cpp_sources" | |
| 245 cpp_sources_target_name = | |
| 246 "${target_name}${variant_suffix}_${cpp_sources_suffix}" | |
| 247 enabled_sources = [] | 244 enabled_sources = [] |
| 248 if (defined(invoker.sources)) { | 245 if (defined(invoker.sources)) { |
| 249 generator_cpp_outputs = [] | 246 generator_cpp_outputs = [] |
| 250 generator_js_outputs = [] | 247 generator_js_outputs = [] |
| 251 generator_java_outputs = [] | 248 generator_java_outputs = [] |
| 252 variant_dash_suffix = "" | 249 variant_dash_suffix = "" |
| 253 if (defined(variant)) { | 250 if (defined(variant)) { |
| 254 variant_dash_suffix = "-${variant}" | 251 variant_dash_suffix = "-${variant}" |
| 255 } | 252 } |
| 256 generator_cpp_outputs += [ | 253 generator_cpp_outputs += [ |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 source_set("${target_name}${variant_suffix}") { | 414 source_set("${target_name}${variant_suffix}") { |
| 418 if (defined(invoker.visibility)) { | 415 if (defined(invoker.visibility)) { |
| 419 visibility = invoker.visibility | 416 visibility = invoker.visibility |
| 420 } | 417 } |
| 421 if (defined(invoker.testonly)) { | 418 if (defined(invoker.testonly)) { |
| 422 testonly = invoker.testonly | 419 testonly = invoker.testonly |
| 423 } | 420 } |
| 424 if (defined(invoker.sources) && !defined(bindings_configuration.variant))
{ | 421 if (defined(invoker.sources) && !defined(bindings_configuration.variant))
{ |
| 425 data = process_file_template(enabled_sources, generator_js_outputs) | 422 data = process_file_template(enabled_sources, generator_js_outputs) |
| 426 } | 423 } |
| 427 | |
| 428 public_deps = [ | |
| 429 ":${cpp_sources_target_name}", | |
| 430 "//mojo/public/cpp/bindings", | |
| 431 ] | |
| 432 if (defined(invoker.deps)) { | |
| 433 foreach(dep, invoker.deps) { | |
| 434 public_deps += | |
| 435 [ get_label_info(dep, "label_no_toolchain") + variant_suffix ] | |
| 436 } | |
| 437 } | |
| 438 if (defined(invoker.public_deps)) { | |
| 439 foreach(dep, invoker.public_deps) { | |
| 440 public_deps += | |
| 441 [ get_label_info(dep, "label_no_toolchain") + variant_suffix ] | |
| 442 } | |
| 443 } | |
| 444 | |
| 445 deps = [] | |
| 446 if (defined(invoker.sources)) { | |
| 447 public_deps += [ ":$generator_target_name" ] | |
| 448 } | |
| 449 } | |
| 450 | |
| 451 # The generated C++ source files. The main reason to introduce this target | |
| 452 # is so that mojo/public/cpp/bindings can depend on mojom interfaces without | |
| 453 # circular dependencies. It means that the target is missing the dependency | |
| 454 # on mojo/public/cpp/bindings. No external targets should depend directly on | |
| 455 # this target *except* mojo/public/cpp/bindings and other *_cpp_sources | |
| 456 # targets. | |
| 457 source_set(cpp_sources_target_name) { | |
| 458 defines = [] | 424 defines = [] |
| 459 if (defined(invoker.testonly)) { | 425 if (defined(invoker.testonly)) { |
| 460 testonly = invoker.testonly | 426 testonly = invoker.testonly |
| 461 } | 427 } |
| 462 if (defined(invoker.export_define)) { | 428 if (defined(invoker.export_define)) { |
| 463 defines += [ invoker.export_define ] | 429 defines += [ invoker.export_define ] |
| 464 } | 430 } |
| 465 if (defined(invoker.export_define_blink)) { | 431 if (defined(invoker.export_define_blink)) { |
| 466 defines += [ invoker.export_define_blink ] | 432 defines += [ invoker.export_define_blink ] |
| 467 } | 433 } |
| 468 if (enabled_sources != []) { | 434 if (enabled_sources != []) { |
| 469 sources = process_file_template(enabled_sources, generator_cpp_outputs) | 435 sources = process_file_template(enabled_sources, generator_cpp_outputs) |
| 470 } | 436 } |
| 471 deps = [ | 437 deps = [ |
| 472 "//mojo/public/cpp/bindings:struct_traits", | 438 "//mojo/public/cpp/bindings:struct_traits", |
| 473 "//mojo/public/interfaces/bindings:bindings__generator", | 439 "//mojo/public/interfaces/bindings:bindings__generator", |
| 474 "//mojo/public/interfaces/bindings:bindings_shared__generator", | 440 "//mojo/public/interfaces/bindings:bindings_shared__generator", |
| 475 ] | 441 ] |
| 476 if (enabled_sources != []) { | |
| 477 deps += [ ":$generator_target_name" ] | |
| 478 } | |
| 479 public_deps = [ | 442 public_deps = [ |
| 480 ":$shared_cpp_sources_target_name", | 443 ":$shared_cpp_sources_target_name", |
| 481 "//base", | 444 "//base", |
| 445 "//mojo/public/cpp/bindings", |
| 482 ] | 446 ] |
| 447 if (enabled_sources != []) { |
| 448 public_deps += [ ":$generator_target_name" ] |
| 449 } |
| 483 foreach(d, all_deps) { | 450 foreach(d, all_deps) { |
| 484 # Resolve the name, so that a target //mojo/something becomes | 451 # Resolve the name, so that a target //mojo/something becomes |
| 485 # //mojo/something:something and we can append cpp_sources_suffix to | 452 # //mojo/something:something and we can append variant_suffix to |
| 486 # get the cpp dependency name. | 453 # get the cpp dependency name. |
| 487 full_name = get_label_info("$d", "label_no_toolchain") | 454 full_name = get_label_info("$d", "label_no_toolchain") |
| 488 public_deps += [ "${full_name}${variant_suffix}_${cpp_sources_suffix}" ] | 455 public_deps += [ "${full_name}${variant_suffix}" ] |
| 489 } | 456 } |
| 490 foreach(typemap, active_typemaps) { | 457 foreach(typemap, active_typemaps) { |
| 491 if (defined(typemap.public_headers)) { | 458 if (defined(typemap.public_headers)) { |
| 492 sources += typemap.public_headers | 459 sources += typemap.public_headers |
| 493 } | 460 } |
| 494 if (defined(typemap.traits_headers)) { | 461 if (defined(typemap.traits_headers)) { |
| 495 sources += typemap.traits_headers | 462 sources += typemap.traits_headers |
| 496 } | 463 } |
| 497 if (defined(typemap.sources)) { | 464 if (defined(typemap.sources)) { |
| 498 sources += typemap.sources | 465 sources += typemap.sources |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 full_name = get_label_info(d, "label_no_toolchain") | 521 full_name = get_label_info(d, "label_no_toolchain") |
| 555 deps += [ "${full_name}_java" ] | 522 deps += [ "${full_name}_java" ] |
| 556 } | 523 } |
| 557 | 524 |
| 558 srcjar_deps = [ ":$java_srcjar_target_name" ] | 525 srcjar_deps = [ ":$java_srcjar_target_name" ] |
| 559 run_findbugs_override = false | 526 run_findbugs_override = false |
| 560 } | 527 } |
| 561 } | 528 } |
| 562 } | 529 } |
| 563 } | 530 } |
| OLD | NEW |