OLD | NEW |
(Empty) | |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. |
| 4 |
| 5 declare_args() { |
| 6 # By default, there is no go build tool, because go builds are not supported. |
| 7 go_build_tool = "" |
| 8 } |
| 9 |
| 10 template("go_test_binary") { |
| 11 # Only available on linux for now. |
| 12 assert(is_linux) |
| 13 assert(defined(invoker.sources)) |
| 14 # assert(defined(invoker.go_base_module)) |
| 15 assert(go_build_tool != "") |
| 16 |
| 17 action(target_name) { |
| 18 script = "//build/go/go.py" |
| 19 outputs = [ "${target_out_dir}/${target_name}" ] |
| 20 # Since go test does not permit specifying an output directory or output |
| 21 # binary name, we create a temporary build directory, and the python |
| 22 # script will later identify the output, copy it to the target location, |
| 23 # and clean up the temporary build directory. |
| 24 build_dir = "${target_out_dir}/${target_name}_build" |
| 25 args = [ |
| 26 "${go_build_tool}", |
| 27 rebase_path(build_dir, root_build_dir), |
| 28 rebase_path(target_out_dir, root_build_dir) + "/${target_name}", |
| 29 rebase_path("//", root_build_dir), |
| 30 "-I" + rebase_path("//", "//"), |
| 31 "-L" + rebase_path("//out/Release/lib", "//") + |
| 32 " -lmojo_system_impl -lbase", |
| 33 "test", "-c", |
| 34 ] + rebase_path(invoker.sources, build_dir) |
| 35 } |
| 36 } |
OLD | NEW |