Commit 5261741e authored by Scott Graham's avatar Scott Graham Committed by Commit Bot

fuchsia: Don't define fidl js (or cpp) compile action unless necessary

Bug: 898088
Change-Id: Iaf7c0013ff0c7fa64f008023619962526bc41b81
Reviewed-on: https://chromium-review.googlesource.com/c/1298223Reviewed-by: default avatarWez <wez@chromium.org>
Commit-Queue: Wez <wez@chromium.org>
Commit-Queue: Scott Graham <scottmg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#602394}
parent 9dea9705
......@@ -45,6 +45,17 @@ template("fidl_library") {
languages = [ "cpp" ]
}
_define_cpp_action = false
_define_js_action = false
foreach(language, languages) {
if (language == "cpp") {
_define_cpp_action = true
} else if (language == "js") {
_define_js_action = true
}
}
_response_file = "$target_gen_dir/$target_name.rsp"
_json_representation = "$target_gen_dir/${_library_name}.fidl.json"
_output_gen_dir = "$target_gen_dir/fidl"
......@@ -139,6 +150,7 @@ template("fidl_library") {
]
}
if (_define_cpp_action) {
action("${target_name}_cpp_gen") {
visibility = [ ":${invoker.target_name}" ]
forward_variables_from(invoker, [ "testonly" ])
......@@ -172,7 +184,9 @@ template("fidl_library") {
rebase_path("${_output_base}"),
]
}
}
if (_define_js_action) {
_output_js_path = "$_output_gen_dir/${_library_path}/js/fidl.js"
action("${target_name}_js_gen") {
visibility = [ ":${invoker.target_name}" ]
......@@ -206,6 +220,7 @@ template("fidl_library") {
data += [ rebase_path(o) ]
}
}
}
config("${target_name}_config") {
visibility = [ ":${invoker.target_name}" ]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment