Chromium Code Reviews| 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 # Generate C++ and JavaScript source files from mojom files. | 5 # Generate C++ and JavaScript source files from mojom files. |
| 6 template("mojom") { | 6 template("mojom") { |
| 7 assert(defined(invoker.sources), | 7 assert(defined(invoker.sources), |
| 8 "\"sources\" must be defined for the $target_name template.") | 8 "\"sources\" must be defined for the $target_name template.") |
| 9 | 9 |
| 10 generator_root = "//mojo/public/tools/bindings" | 10 generator_root = "//mojo/public/tools/bindings" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 55 ] | 55 ] |
| 56 generator_js_outputs = [ | 56 generator_js_outputs = [ |
| 57 "$target_gen_dir/{{source_name_part}}.mojom.js", | 57 "$target_gen_dir/{{source_name_part}}.mojom.js", |
| 58 ] | 58 ] |
| 59 | 59 |
| 60 target_visibility = ":$target_name" | 60 target_visibility = ":$target_name" |
| 61 | 61 |
| 62 generator_target_name = target_name + "_generator" | 62 generator_target_name = target_name + "_generator" |
| 63 action_foreach(generator_target_name) { | 63 action_foreach(generator_target_name) { |
| 64 visibility = target_visibility | 64 visibility = target_visibility |
| 65 hard_dep = true | |
| 66 script = generator_script | 65 script = generator_script |
| 67 source_prereqs = generator_sources | 66 source_prereqs = generator_sources |
| 68 sources = invoker.sources | 67 sources = invoker.sources |
| 69 outputs = generator_cpp_outputs + generator_js_outputs | 68 outputs = generator_cpp_outputs + generator_js_outputs |
| 70 args = [ | 69 args = [ |
| 71 "{{source}}", | 70 "{{source}}", |
| 72 "--use_chromium_bundled_pylibs", | 71 "--use_chromium_bundled_pylibs", |
| 73 "-d", rebase_path("//", root_build_dir), | 72 "-d", rebase_path("//", root_build_dir), |
| 74 "-o", rebase_path(target_gen_dir, root_build_dir), | 73 "-o", rebase_path(target_gen_dir, root_build_dir), |
| 75 ] | 74 ] |
| 76 } | 75 } |
| 77 | 76 |
| 78 source_set(target_name) { | 77 source_set(target_name) { |
| 79 hard_dep = true | |
|
scottmg
2014/05/13 23:21:22
sorry, i forget, just to confirm source_set got au
| |
| 80 sources = process_file_template(invoker.sources, generator_cpp_outputs) | 78 sources = process_file_template(invoker.sources, generator_cpp_outputs) |
| 81 data = process_file_template(invoker.sources, generator_js_outputs) | 79 data = process_file_template(invoker.sources, generator_js_outputs) |
| 82 deps = [ | 80 deps = [ |
| 83 ":$generator_target_name", | 81 ":$generator_target_name", |
| 84 "//mojo/public/cpp/bindings", | 82 "//mojo/public/cpp/bindings", |
| 85 ] | 83 ] |
| 86 } | 84 } |
| 87 } | 85 } |
| 88 | 86 |
| OLD | NEW |