| 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 args += [ | 130 args += [ |
| 131 "--", | 131 "--", |
| 132 "${go_build_tool}", | 132 "${go_build_tool}", |
| 133 rebase_path(build_dir, root_build_dir), | 133 rebase_path(build_dir, root_build_dir), |
| 134 rebase_path(target_out_dir, root_build_dir) + "/${target_name}", | 134 rebase_path(target_out_dir, root_build_dir) + "/${target_name}", |
| 135 rebase_path("//", root_build_dir), | 135 rebase_path("//", root_build_dir), |
| 136 rebase_path(root_out_dir, root_build_dir), | 136 rebase_path(root_out_dir, root_build_dir), |
| 137 "-I" + rebase_path("//"), | 137 "-I" + rebase_path("//"), |
| 138 "-L" + rebase_path(target_out_dir) + " -l" + static_library_name + "", | 138 "-L" + rebase_path(target_out_dir) + " -l" + static_library_name + "", |
| 139 "build", | 139 "build", |
| 140 "-ldflags=-shared", | |
| 141 ] | 140 ] |
| 142 if (is_linux) { | 141 args += [ "-buildmode=c-shared" ] |
| 143 args += [ "-buildmode=c-shared" ] | |
| 144 } | |
| 145 args += rebase_path(invoker.sources, build_dir) | 142 args += rebase_path(invoker.sources, build_dir) |
| 146 } | 143 } |
| 147 | 144 |
| 148 copy(target_name) { | 145 copy(target_name) { |
| 149 deps = [ | 146 deps = [ |
| 150 ":${go_library_name}", | 147 ":${go_library_name}", |
| 151 ] | 148 ] |
| 152 sources = [ | 149 sources = [ |
| 153 "${target_out_dir}/${go_library_name}", | 150 "${target_out_dir}/${go_library_name}", |
| 154 ] | 151 ] |
| 155 outputs = [ | 152 outputs = [ |
| 156 "${root_out_dir}/${target_name}.mojo", | 153 "${root_out_dir}/${target_name}.mojo", |
| 157 ] | 154 ] |
| 158 } | 155 } |
| 159 } | 156 } |
| OLD | NEW |