OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 declare_args() { | 5 declare_args() { |
6 # By default, there is no go build tool, because go builds are not supported. | 6 # By default, there is no go build tool, because go builds are not supported. |
7 go_build_tool = "" | 7 go_build_tool = "" |
8 } | 8 } |
9 | 9 |
10 # Declare a go test binary target. | 10 # Declare a go test binary target. |
(...skipping 21 matching lines...) Expand all Loading... |
32 sources = invoker.static_library_sources | 32 sources = invoker.static_library_sources |
33 deps = invoker.deps | 33 deps = invoker.deps |
34 complete_static_lib = true | 34 complete_static_lib = true |
35 } | 35 } |
36 | 36 |
37 action(target_name) { | 37 action(target_name) { |
38 deps = [ | 38 deps = [ |
39 ":$static_library_name", | 39 ":$static_library_name", |
40 ] | 40 ] |
41 script = "//build/go/go.py" | 41 script = "//build/go/go.py" |
42 outputs = [ "${target_out_dir}/${target_name}" ] | 42 outputs = [ |
| 43 "${target_out_dir}/${target_name}", |
| 44 ] |
43 | 45 |
44 # Since go test does not permit specifying an output directory or output | 46 # Since go test does not permit specifying an output directory or output |
45 # binary name, we create a temporary build directory, and the python | 47 # binary name, we create a temporary build directory, and the python |
46 # script will later identify the output, copy it to the target location, | 48 # script will later identify the output, copy it to the target location, |
47 # and clean up the temporary build directory. | 49 # and clean up the temporary build directory. |
48 build_dir = "${target_out_dir}/${target_name}_build" | 50 build_dir = "${target_out_dir}/${target_name}_build" |
49 args = [ | 51 args = [ |
50 "--", | 52 "--", |
51 "${go_build_tool}", | 53 "${go_build_tool}", |
52 rebase_path(build_dir, root_build_dir), | 54 rebase_path(build_dir, root_build_dir), |
(...skipping 19 matching lines...) Expand all Loading... |
72 static_library(static_library_name) { | 74 static_library(static_library_name) { |
73 complete_static_lib = true | 75 complete_static_lib = true |
74 deps = invoker.deps | 76 deps = invoker.deps |
75 } | 77 } |
76 | 78 |
77 action(target_name) { | 79 action(target_name) { |
78 deps = [ | 80 deps = [ |
79 ":$static_library_name", | 81 ":$static_library_name", |
80 ] | 82 ] |
81 script = "//build/go/go.py" | 83 script = "//build/go/go.py" |
82 outputs = [ "${target_out_dir}/${target_name}" ] | 84 outputs = [ |
| 85 "${target_out_dir}/${target_name}", |
| 86 ] |
83 | 87 |
84 # Since go test does not permit specifying an output directory or output | 88 # Since go test does not permit specifying an output directory or output |
85 # binary name, we create a temporary build directory, and the python | 89 # binary name, we create a temporary build directory, and the python |
86 # script will later identify the output, copy it to the target location, | 90 # script will later identify the output, copy it to the target location, |
87 # and clean up the temporary build directory. | 91 # and clean up the temporary build directory. |
88 build_dir = "${target_out_dir}/${target_name}_build" | 92 build_dir = "${target_out_dir}/${target_name}_build" |
89 args = [ | 93 args = [ |
90 "--", | 94 "--", |
91 "CGO_ENABLED=1 GOOS=android GOARCH=arm GOARM=7 ${go_build_tool}", | 95 "CGO_ENABLED=1 GOOS=android GOARCH=arm GOARM=7 ${go_build_tool}", |
92 rebase_path(build_dir, root_build_dir), | 96 rebase_path(build_dir, root_build_dir), |
93 rebase_path(target_out_dir, root_build_dir) + "/${target_name}", | 97 rebase_path(target_out_dir, root_build_dir) + "/${target_name}", |
94 rebase_path("//", root_build_dir), | 98 rebase_path("//", root_build_dir), |
95 "-I" + rebase_path("//"), | 99 "-I" + rebase_path("//"), |
96 " -L" + rebase_path(target_out_dir) + " -l" + static_library_name + | 100 " -L" + rebase_path(target_out_dir) + " -l" + static_library_name + |
97 "", | 101 "", |
98 "build -ldflags=-shared", | 102 "build -ldflags=-shared", |
99 ] + rebase_path(invoker.sources, build_dir) | 103 ] + rebase_path(invoker.sources, build_dir) |
100 } | 104 } |
101 } | 105 } |
OLD | NEW |