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") |
11 | 11 |
12 assert(host_os == "mac") | 12 assert(host_os == "mac") |
13 | 13 |
14 import("//build/toolchain/goma.gni") | 14 import("//build/toolchain/goma.gni") |
| 15 import("//build/toolchain/toolchain.gni") |
15 | 16 |
16 if (use_goma) { | 17 if (use_goma) { |
17 goma_prefix = "$goma_dir/gomacc " | 18 goma_prefix = "$goma_dir/gomacc " |
18 } else { | 19 } else { |
19 goma_prefix = "" | 20 goma_prefix = "" |
20 } | 21 } |
21 | 22 |
22 # This will copy the gyp-mac-tool to the build directory. We pass in the source | 23 # This will copy the gyp-mac-tool to the build directory. We pass in the source |
23 # file of the win tool. | 24 # file of the win tool. |
24 gyp_mac_tool_source = | 25 gyp_mac_tool_source = |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 outfile = "{{root_out_dir}}/{{target_output_name}}{{output_extension}}" | 199 outfile = "{{root_out_dir}}/{{target_output_name}}{{output_extension}}" |
199 rspfile = "$outfile.rsp" | 200 rspfile = "$outfile.rsp" |
200 command = "$ld {{ldflags}} -o \"$outfile\" -Wl,-filelist,\"$rspfile\" {{so
libs}} {{libs}}" | 201 command = "$ld {{ldflags}} -o \"$outfile\" -Wl,-filelist,\"$rspfile\" {{so
libs}} {{libs}}" |
201 description = "LINK $outfile" | 202 description = "LINK $outfile" |
202 rspfile_content = "{{inputs_newline}}" | 203 rspfile_content = "{{inputs_newline}}" |
203 outputs = [ | 204 outputs = [ |
204 outfile, | 205 outfile, |
205 ] | 206 ] |
206 } | 207 } |
207 | 208 |
| 209 # These two are really entirely generic, but have to be repeated in |
| 210 # each toolchain because GN doesn't allow a template to be used here. |
| 211 # See //build/toolchain/toolchain.gni for details. |
208 tool("stamp") { | 212 tool("stamp") { |
209 command = "touch {{output}}" | 213 command = stamp_command |
210 description = "STAMP {{output}}" | 214 description = stamp_description |
211 } | 215 } |
212 | |
213 tool("copy") { | 216 tool("copy") { |
214 command = "ln -f {{source}} {{output}} 2>/dev/null || (rm -rf {{output}} &
& cp -af {{source}} {{output}})" | 217 command = copy_command |
215 description = "COPY {{source}} {{output}}" | 218 description = copy_description |
216 } | 219 } |
217 | 220 |
218 toolchain_args() { | 221 toolchain_args() { |
219 current_cpu = invoker.toolchain_cpu | 222 current_cpu = invoker.toolchain_cpu |
220 current_os = invoker.toolchain_os | 223 current_os = invoker.toolchain_os |
221 | 224 |
222 # These values need to be passed through unchanged. | 225 # These values need to be passed through unchanged. |
223 target_os = target_os | 226 target_os = target_os |
224 target_cpu = target_cpu | 227 target_cpu = target_cpu |
225 | 228 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 } | 280 } |
278 | 281 |
279 mac_toolchain("x64") { | 282 mac_toolchain("x64") { |
280 toolchain_cpu = "x64" | 283 toolchain_cpu = "x64" |
281 toolchain_os = "mac" | 284 toolchain_os = "mac" |
282 cc = "${goma_prefix}/gcc" | 285 cc = "${goma_prefix}/gcc" |
283 cxx = "${goma_prefix}/g++" | 286 cxx = "${goma_prefix}/g++" |
284 ld = cxx | 287 ld = cxx |
285 is_clang = false | 288 is_clang = false |
286 } | 289 } |
OLD | NEW |