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 library. | 10 # Declare a go library. |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 "--", | 94 "--", |
95 "${go_build_tool}", | 95 "${go_build_tool}", |
96 rebase_path(build_dir, root_build_dir), | 96 rebase_path(build_dir, root_build_dir), |
97 rebase_path(target_out_dir, root_build_dir) + "/${target_name}", | 97 rebase_path(target_out_dir, root_build_dir) + "/${target_name}", |
98 rebase_path("//", root_build_dir), | 98 rebase_path("//", root_build_dir), |
99 rebase_path(root_out_dir, root_build_dir), | 99 rebase_path(root_out_dir, root_build_dir), |
100 "-I" + rebase_path("//"), | 100 "-I" + rebase_path("//"), |
101 "-L" + rebase_path(target_out_dir) + " -l" + static_library_name + | 101 "-L" + rebase_path(target_out_dir) + " -l" + static_library_name + |
102 " -lstdc++ -lpthread -lm -lglib-2.0 -lrt", | 102 " -lstdc++ -lpthread -lm -lglib-2.0 -lrt", |
103 "test", | 103 "test", |
| 104 "-tags", |
| 105 "include_mojo_cgo", |
104 "-c", | 106 "-c", |
105 ] + rebase_path(invoker.sources, build_dir) | 107 ] + rebase_path(invoker.sources, build_dir) |
106 } | 108 } |
107 } | 109 } |
108 | 110 |
109 # Declare a go binary target. | 111 # Declare a go binary target. |
110 # | 112 # |
111 # The target generates a go executable, optionally linking against C code, | 113 # The target generates a go executable, optionally linking against C code, |
112 # which is compiled into a static library and linked against Go. | 114 # which is compiled into a static library and linked against Go. |
113 # | 115 # |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 args += [ | 244 args += [ |
243 "--", | 245 "--", |
244 "${go_build_tool}", | 246 "${go_build_tool}", |
245 rebase_path(build_dir, root_build_dir), | 247 rebase_path(build_dir, root_build_dir), |
246 rebase_path(target_out_dir, root_build_dir) + "/${target_name}", | 248 rebase_path(target_out_dir, root_build_dir) + "/${target_name}", |
247 rebase_path("//", root_build_dir), | 249 rebase_path("//", root_build_dir), |
248 rebase_path(root_out_dir, root_build_dir), | 250 rebase_path(root_out_dir, root_build_dir), |
249 "-I" + rebase_path("//"), | 251 "-I" + rebase_path("//"), |
250 "-L" + rebase_path(target_out_dir) + " -l" + static_library_name + "", | 252 "-L" + rebase_path(target_out_dir) + " -l" + static_library_name + "", |
251 "build", | 253 "build", |
| 254 "-tags", |
| 255 "include_mojo_cgo", |
252 ] | 256 ] |
253 args += [ "-buildmode=c-shared" ] | 257 args += [ "-buildmode=c-shared" ] |
254 args += rebase_path(invoker.sources, build_dir) | 258 args += rebase_path(invoker.sources, build_dir) |
255 } | 259 } |
256 | 260 |
257 copy(target_name) { | 261 copy(target_name) { |
258 deps = [ | 262 deps = [ |
259 ":${go_library_name}", | 263 ":${go_library_name}", |
260 ] | 264 ] |
261 sources = [ | 265 sources = [ |
262 "${target_out_dir}/${go_library_name}", | 266 "${target_out_dir}/${go_library_name}", |
263 ] | 267 ] |
264 outputs = [ | 268 outputs = [ |
265 "${root_out_dir}/${target_name}.mojo", | 269 "${root_out_dir}/${target_name}.mojo", |
266 ] | 270 ] |
267 } | 271 } |
268 } | 272 } |
OLD | NEW |