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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 # Tell GN about the output files. It will link to the dylib but use the | 186 # Tell GN about the output files. It will link to the dylib but use the |
187 # tocname for dependency management. | 187 # tocname for dependency management. |
188 outputs = [ | 188 outputs = [ |
189 dylib, | 189 dylib, |
190 tocname, | 190 tocname, |
191 ] | 191 ] |
192 link_output = dylib | 192 link_output = dylib |
193 depend_output = tocname | 193 depend_output = tocname |
194 | 194 |
195 if (enable_dsyms) { | 195 if (enable_dsyms) { |
196 outputs += [ dylib + ".dSYM/" ] | 196 outputs += [ "{{root_out_dir}}/{{target_output_name}}{{output_extension}
}.dSYM/" ] |
197 } | 197 } |
198 } | 198 } |
199 | 199 |
200 tool("solink_module") { | 200 tool("solink_module") { |
201 sofile = "{{output_dir}}/{{target_output_name}}{{output_extension}}" # eg
"./libfoo.so" | 201 sofile = "{{output_dir}}/{{target_output_name}}{{output_extension}}" # eg
"./libfoo.so" |
202 rspfile = sofile + ".rsp" | 202 rspfile = sofile + ".rsp" |
203 | 203 |
204 link_command = "$linker_driver $ld -bundle {{ldflags}} -o \"$sofile\" -Wl,
-filelist,\"$rspfile\"" | 204 link_command = "$linker_driver $ld -bundle {{ldflags}} -o \"$sofile\" -Wl,
-filelist,\"$rspfile\"" |
205 if (is_component_build) { | 205 if (is_component_build) { |
206 link_command += " -Wl,-install_name,@rpath/{{target_output_name}}{{outpu
t_extension}}" | 206 link_command += " -Wl,-install_name,@rpath/{{target_output_name}}{{outpu
t_extension}}" |
(...skipping 10 matching lines...) Expand all Loading... |
217 # overrides it (in which case {{output_extension}} will be what the target | 217 # overrides it (in which case {{output_extension}} will be what the target |
218 # specifies). | 218 # specifies). |
219 default_output_dir = "{{root_out_dir}}" | 219 default_output_dir = "{{root_out_dir}}" |
220 default_output_extension = ".so" | 220 default_output_extension = ".so" |
221 | 221 |
222 outputs = [ | 222 outputs = [ |
223 sofile, | 223 sofile, |
224 ] | 224 ] |
225 | 225 |
226 if (enable_dsyms) { | 226 if (enable_dsyms) { |
227 outputs += [ sofile + ".dSYM/" ] | 227 outputs += [ "{{root_out_dir}}/{{target_output_name}}{{output_extension}
}.dSYM/" ] |
228 } | 228 } |
229 } | 229 } |
230 | 230 |
231 tool("link") { | 231 tool("link") { |
232 outfile = "{{output_dir}}/{{target_output_name}}{{output_extension}}" | 232 outfile = "{{output_dir}}/{{target_output_name}}{{output_extension}}" |
233 rspfile = "$outfile.rsp" | 233 rspfile = "$outfile.rsp" |
234 | 234 |
235 # Note about --filelist: Apple's linker reads the file list file and | 235 # Note about --filelist: Apple's linker reads the file list file and |
236 # interprets each newline-separated chunk of text as a file name. It | 236 # interprets each newline-separated chunk of text as a file name. It |
237 # doesn't do the things one would expect from the shell like unescaping | 237 # doesn't do the things one would expect from the shell like unescaping |
238 # or handling quotes. In contrast, when Ninja finds a file name with | 238 # or handling quotes. In contrast, when Ninja finds a file name with |
239 # spaces, it single-quotes them in $inputs_newline as it would normally | 239 # spaces, it single-quotes them in $inputs_newline as it would normally |
240 # do for command-line arguments. Thus any source names with spaces, or | 240 # do for command-line arguments. Thus any source names with spaces, or |
241 # label names with spaces (which GN bases the output paths on) will be | 241 # label names with spaces (which GN bases the output paths on) will be |
242 # corrupted by this process. Don't use spaces for source files or labels. | 242 # corrupted by this process. Don't use spaces for source files or labels. |
243 command = "$linker_driver $ld $dsym_switch {{ldflags}} -o \"$outfile\" -Wl
,-filelist,\"$rspfile\" {{solibs}} {{libs}}" | 243 command = "$linker_driver $ld $dsym_switch {{ldflags}} -o \"$outfile\" -Wl
,-filelist,\"$rspfile\" {{solibs}} {{libs}}" |
244 description = "LINK $outfile" | 244 description = "LINK $outfile" |
245 rspfile_content = "{{inputs_newline}}" | 245 rspfile_content = "{{inputs_newline}}" |
246 outputs = [ | 246 outputs = [ |
247 outfile, | 247 outfile, |
248 ] | 248 ] |
249 | 249 |
250 if (enable_dsyms) { | 250 if (enable_dsyms) { |
251 outputs += [ outfile + ".dSYM/" ] | 251 outputs += [ "{{root_out_dir}}/{{target_output_name}}{{output_extension}
}.dSYM/" ] |
252 } | 252 } |
253 | 253 |
254 default_output_dir = "{{root_out_dir}}" | 254 default_output_dir = "{{root_out_dir}}" |
255 } | 255 } |
256 | 256 |
257 # These two are really entirely generic, but have to be repeated in | 257 # These two are really entirely generic, but have to be repeated in |
258 # each toolchain because GN doesn't allow a template to be used here. | 258 # each toolchain because GN doesn't allow a template to be used here. |
259 # See //build/toolchain/toolchain.gni for details. | 259 # See //build/toolchain/toolchain.gni for details. |
260 tool("stamp") { | 260 tool("stamp") { |
261 command = stamp_command | 261 command = stamp_command |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 } | 379 } |
380 | 380 |
381 mac_toolchain("x64") { | 381 mac_toolchain("x64") { |
382 toolchain_cpu = "x64" | 382 toolchain_cpu = "x64" |
383 toolchain_os = "mac" | 383 toolchain_os = "mac" |
384 cc = "${goma_prefix}/gcc" | 384 cc = "${goma_prefix}/gcc" |
385 cxx = "${goma_prefix}/g++" | 385 cxx = "${goma_prefix}/g++" |
386 ld = cxx | 386 ld = cxx |
387 is_clang = false | 387 is_clang = false |
388 } | 388 } |
OLD | NEW |