OLD | NEW |
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 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 # TODO(brettw) Use "gcc_toolchain.gni" like the Linux toolchains. This requires | 5 # TODO(brettw) Use "gcc_toolchain.gni" like the Linux toolchains. This requires |
6 # some enhancements since the commands on Mac are slightly different than on | 6 # some enhancements since the commands on Mac are slightly different than on |
7 # Linux. | 7 # Linux. |
8 | 8 |
9 import("../goma.gni") | 9 import("../goma.gni") |
10 import("//build/config/ios/ios_sdk.gni") | 10 import("//build/config/ios/ios_sdk.gni") |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 # Tell GN about the output files. It will link to the dylib but use the | 160 # Tell GN about the output files. It will link to the dylib but use the |
161 # tocname for dependency management. | 161 # tocname for dependency management. |
162 outputs = [ | 162 outputs = [ |
163 dylib, | 163 dylib, |
164 tocname, | 164 tocname, |
165 ] | 165 ] |
166 link_output = dylib | 166 link_output = dylib |
167 depend_output = tocname | 167 depend_output = tocname |
168 } | 168 } |
169 | 169 |
| 170 tool("solink_module") { |
| 171 sofile = "{{root_out_dir}}/{{target_output_name}}{{output_extension}}" #
eg "./libfoo.so" |
| 172 rspfile = sofile + ".rsp" |
| 173 |
| 174 link_command = "$ld -bundle {{ldflags}} -o $sofile -Wl,-filelist,$rspfile" |
| 175 if (is_component_build) { |
| 176 link_command += " -Wl,-install_name,@rpath/{{target_output_name}}{{outpu
t_extension}}" |
| 177 } |
| 178 link_command += " {{solibs}} {{libs}}" |
| 179 command = link_command |
| 180 |
| 181 rspfile_content = "{{inputs_newline}}" |
| 182 |
| 183 description = "SOLINK_MODULE {{output}}" |
| 184 |
| 185 # Use this for {{output_extension}} expansions unless a target manually |
| 186 # overrides it (in which case {{output_extension}} will be what the target |
| 187 # specifies). |
| 188 default_output_extension = ".so" |
| 189 |
| 190 output_prefix = "lib" |
| 191 |
| 192 outputs = [ |
| 193 sofile, |
| 194 ] |
| 195 } |
| 196 |
170 tool("link") { | 197 tool("link") { |
171 outfile = "{{root_out_dir}}/{{target_output_name}}{{output_extension}}" | 198 outfile = "{{root_out_dir}}/{{target_output_name}}{{output_extension}}" |
172 rspfile = "$outfile.rsp" | 199 rspfile = "$outfile.rsp" |
173 command = "$ld {{ldflags}} -o $outfile -Wl,-filelist,$rspfile {{solibs}} {
{libs}}" | 200 command = "$ld {{ldflags}} -o $outfile -Wl,-filelist,$rspfile {{solibs}} {
{libs}}" |
174 description = "LINK $outfile" | 201 description = "LINK $outfile" |
175 rspfile_content = "{{inputs_newline}}" | 202 rspfile_content = "{{inputs_newline}}" |
176 outputs = [ | 203 outputs = [ |
177 outfile, | 204 outfile, |
178 ] | 205 ] |
179 } | 206 } |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 } | 277 } |
251 | 278 |
252 mac_toolchain("x64") { | 279 mac_toolchain("x64") { |
253 toolchain_cpu = "x64" | 280 toolchain_cpu = "x64" |
254 toolchain_os = "mac" | 281 toolchain_os = "mac" |
255 cc = "${goma_prefix}/gcc" | 282 cc = "${goma_prefix}/gcc" |
256 cxx = "${goma_prefix}/g++" | 283 cxx = "${goma_prefix}/g++" |
257 ld = cxx | 284 ld = cxx |
258 is_clang = false | 285 is_clang = false |
259 } | 286 } |
OLD | NEW |