blob: 34175ae172d802f2b0868a8fa039e3a5ea9ec6ff [file] [log] [blame]
# Copyright 2018 The ChromiumOS Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# TODO(crbug.com/983008): Unify build rule of generate_dbus_proxies and
# generate_dbus_adaptors for easy to maintain.
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)
}
# TODO(crbug.com/983008): Use action to simplify the bindings by unifying
# with proxy generator.
action_foreach(target_name) {
sources = invoker.sources
script = "//common-mk/file_generator_wrapper.py"
outputs = [ "${h_dir}/{{source_name_part}}.h" ]
args = [
"go-generate-chromeos-dbus-bindings",
"-adaptor=${h_dir}/{{source_name_part}}.h",
"-service-config=${service_config}",
"{{source}}",
]
}
}