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)) | |
qsr
2014/09/22 11:11:25
You should remove this if this is not needed.
tburkard
2014/09/22 14:23:17
Done.
| |
15 assert(go_build_tool != "") | |
16 | |
17 static_library_name = target_name + "_static_library" | |
18 | |
19 static_library(static_library_name) { | |
20 sources = invoker.additional_sources | |
21 deps = invoker.deps | |
22 complete_static_lib = true | |
23 } | |
24 | |
25 action(target_name) { | |
26 deps = [ | |
27 ":$static_library_name", | |
28 ] | |
29 script = "//build/go/go.py" | |
30 outputs = [ "${target_out_dir}/${target_name}" ] | |
31 # Since go test does not permit specifying an output directory or output | |
32 # binary name, we create a temporary build directory, and the python | |
33 # script will later identify the output, copy it to the target location, | |
34 # and clean up the temporary build directory. | |
35 build_dir = "${target_out_dir}/${target_name}_build" | |
36 args = [ | |
37 "--", | |
38 "${go_build_tool}", | |
39 rebase_path(build_dir, root_build_dir), | |
40 rebase_path(target_out_dir, root_build_dir) + "/${target_name}", | |
41 rebase_path("//", root_build_dir), | |
42 "-I" + rebase_path("//", "//"), | |
qsr
2014/09/22 11:11:25
Use rebase_path without second argument to directl
tburkard
2014/09/22 14:23:17
Done.
| |
43 " -L" + rebase_path(root_build_dir +"/obj/mojo/go", "//") + | |
44 " -L" + rebase_path(root_build_dir + "/obj/third_party/libevent", "//") + | |
45 " -lsystem_test_static_library -lstdc++ -lpthread -lm -lglib-2.0 -levent", | |
46 "test", "-c", | |
47 ] + rebase_path(invoker.sources, build_dir) | |
48 } | |
49 } | |
OLD | NEW |