mirror of
https://github.com/klzgrad/naiveproxy.git
synced 2024-12-05 03:36:08 +03:00
159 lines
4.5 KiB
Plaintext
159 lines
4.5 KiB
Plaintext
# Copyright 2017 The Chromium Authors. All rights reserved.
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
# found in the LICENSE file.
|
|
|
|
assert(is_fuchsia)
|
|
|
|
template("generate_runner_script") {
|
|
# This runtime_deps file is used at runtime and thus cannot go in
|
|
# target_gen_dir.
|
|
_target_dir_name = get_label_info(invoker.exe_target, "dir")
|
|
_target_shortname = get_label_info(invoker.exe_target, "name")
|
|
_runtime_deps_file = "$root_out_dir/gen.runtime/$_target_dir_name/$_target_shortname.runtime_deps"
|
|
_runtime_deps_target = "${target_name}__write_deps"
|
|
group(_runtime_deps_target) {
|
|
forward_variables_from(invoker,
|
|
[
|
|
"data",
|
|
"data_deps",
|
|
"deps",
|
|
"public_deps",
|
|
"testonly",
|
|
])
|
|
write_runtime_deps = _runtime_deps_file
|
|
}
|
|
|
|
action(target_name) {
|
|
forward_variables_from(invoker,
|
|
[
|
|
"data_deps",
|
|
"deps",
|
|
"runner_script",
|
|
"target",
|
|
"testonly",
|
|
])
|
|
if (!defined(deps)) {
|
|
deps = []
|
|
}
|
|
if (!defined(data_deps)) {
|
|
data_deps = []
|
|
}
|
|
|
|
script = "//build/fuchsia/create_runner_script.py"
|
|
depfile = "$target_gen_dir/$target_name.d"
|
|
|
|
data = []
|
|
runner_args = []
|
|
|
|
outputs = [
|
|
invoker.generated_script,
|
|
]
|
|
data += [
|
|
invoker.generated_script,
|
|
"//build/fuchsia/exe_runner.py",
|
|
"//build/fuchsia/test_runner.py",
|
|
"//build/fuchsia/runner_common.py",
|
|
"//build/util/lib/",
|
|
"//third_party/fuchsia-sdk/",
|
|
"//third_party/qemu-aarch64/",
|
|
"//third_party/qemu-x86_64/",
|
|
]
|
|
|
|
runner_args += [
|
|
"--runner-script",
|
|
runner_script,
|
|
"--output-directory",
|
|
rebase_path(root_build_dir, root_build_dir),
|
|
"--target-cpu",
|
|
target_cpu,
|
|
]
|
|
|
|
deps += [
|
|
":$_runtime_deps_target",
|
|
"//testing/buildbot/filters:fuchsia_filters",
|
|
]
|
|
data += [ _runtime_deps_file ]
|
|
runner_args += [
|
|
"--runtime-deps-path",
|
|
rebase_path(_runtime_deps_file, root_build_dir),
|
|
]
|
|
|
|
if (defined(args)) {
|
|
args = []
|
|
}
|
|
args = [
|
|
"--depfile",
|
|
rebase_path(depfile, root_build_dir),
|
|
"--script-output-path",
|
|
rebase_path(invoker.generated_script, root_build_dir),
|
|
"--exe-name",
|
|
_target_shortname,
|
|
]
|
|
|
|
if (defined(invoker.use_test_server) && invoker.use_test_server) {
|
|
args += [ "--enable-test-server" ]
|
|
}
|
|
|
|
args += runner_args
|
|
}
|
|
}
|
|
|
|
# This template is used to generate a runner script for test binaries into the
|
|
# build dir for Fuchsia. It's generally used from the "test" template.
|
|
template("test_runner_script") {
|
|
generate_runner_script(target_name) {
|
|
testonly = true
|
|
runner_script = "test_runner.py"
|
|
exe_target = invoker.test_name
|
|
generated_script =
|
|
"$root_build_dir/bin/run_" + get_label_info(exe_target, "name")
|
|
forward_variables_from(invoker, "*")
|
|
}
|
|
}
|
|
|
|
# This template is used to generate a runner script for arbitrary executables
|
|
# into the build dir for Fuchsia. The template should reference an "executable"
|
|
# target using the "exe_target" attribute.
|
|
#
|
|
# Example usage:
|
|
#
|
|
# executable("foo") {
|
|
# sources = [ "foo_main.cc" ]
|
|
# }
|
|
# fuchsia_executable_runner("foo_fuchsia") {
|
|
# exe_target = ":foo"
|
|
# }
|
|
template("fuchsia_executable_runner") {
|
|
generate_runner_script(target_name) {
|
|
forward_variables_from(invoker,
|
|
[
|
|
"testonly",
|
|
"exe_target",
|
|
"data_deps",
|
|
])
|
|
runner_script = "exe_runner.py"
|
|
generated_script =
|
|
"$root_build_dir/bin/run_" + get_label_info(exe_target, "name")
|
|
if (!defined(data_deps)) {
|
|
data_deps = []
|
|
}
|
|
data_deps += [ exe_target ]
|
|
}
|
|
|
|
generate_runner_script(target_name + "_archive") {
|
|
forward_variables_from(invoker,
|
|
[
|
|
"testonly",
|
|
"exe_target",
|
|
"data_deps",
|
|
])
|
|
runner_script = "archive_builder.py"
|
|
generated_script =
|
|
"$root_build_dir/bin/archive_" + get_label_info(exe_target, "name")
|
|
if (!defined(data_deps)) {
|
|
data_deps = []
|
|
}
|
|
data_deps += [ exe_target ]
|
|
}
|
|
}
|