| # Copyright 2018 The Chromium OS Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| template("generate_dbus_adaptors") { |
| forward_variables_from(invoker, |
| [ |
| "dbus_adaptors_out_dir", |
| "dbus_service_config", |
| ]) |
| h_dir = "${root_gen_dir}/${dbus_adaptors_out_dir}" |
| |
| if (!defined(dbus_service_config) || dbus_service_config == "") { |
| service_config = "" |
| } else { |
| service_config = rebase_path(dbus_service_config) |
| } |
| |
| action_foreach(target_name) { |
| sources = invoker.sources |
| script = "//common-mk/file_generator_wrapper.py" |
| outputs = [ "${h_dir}/{{source_name_part}}.h" ] |
| args = [ |
| "generate-chromeos-dbus-bindings", |
| "{{source}}", |
| "--service-config=${service_config}", |
| "--adaptor=${h_dir}/{{source_name_part}}.h", |
| ] |
| } |
| } |