# Copyright 2023 The Dawn Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# built_target_action() is like action, except that it runs a built target.
template("built_target_action") {
  assert(defined(invoker.target), "must set 'target'")
  assert(defined(invoker.outputs), "must set 'outputs'")
  assert(defined(invoker.args), "must set 'args'")
  assert(!defined(invoker.sources), "use 'inputs' instead of 'sources'")

  action(target_name) {
    forward_variables_from(invoker,
                           [
                             "depfile",
                             "inputs",
                             "outputs",
                           ])

    exe = get_label_info(invoker.target, "root_out_dir") + "/" +
          get_label_info(invoker.target, "name")
    deps = [ invoker.target ]
    script = "build/run_built_binary.py"
    args = [
             "",
             rebase_path(exe, root_build_dir),
           ] + invoker.args
  }
}
