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 14 matching lines...) Expand all Loading... |
25 | 25 |
26 if (current_toolchain == default_toolchain) { | 26 if (current_toolchain == default_toolchain) { |
27 # Reduce the number of tasks using the copy_bundle_data and compile_xcassets | 27 # Reduce the number of tasks using the copy_bundle_data and compile_xcassets |
28 # tools as they can cause lots of I/O contention when invoking ninja with a | 28 # tools as they can cause lots of I/O contention when invoking ninja with a |
29 # large number of parallel jobs (e.g. when using distributed build like goma). | 29 # large number of parallel jobs (e.g. when using distributed build like goma). |
30 pool("bundle_pool") { | 30 pool("bundle_pool") { |
31 depth = concurrent_links | 31 depth = concurrent_links |
32 } | 32 } |
33 } | 33 } |
34 | 34 |
| 35 if (is_clang_xcode) { |
| 36 _clang_prefix = "" |
| 37 } else { |
| 38 _clang_prefix = rebase_path("//third_party/llvm-build/Release+Asserts/bin/", |
| 39 root_build_dir) |
| 40 } |
| 41 |
35 # This will copy the gyp-mac-tool to the build directory. We pass in the source | 42 # This will copy the gyp-mac-tool to the build directory. We pass in the source |
36 # file of the mac tool. | 43 # file of the mac tool. |
37 gyp_mac_tool_source = | 44 gyp_mac_tool_source = |
38 rebase_path("//tools/gyp/pylib/gyp/mac_tool.py", root_build_dir) | 45 rebase_path("//tools/gyp/pylib/gyp/mac_tool.py", root_build_dir) |
39 exec_script("setup_toolchain.py", [ gyp_mac_tool_source ]) | 46 exec_script("setup_toolchain.py", [ gyp_mac_tool_source ]) |
40 | 47 |
41 # When implementing tools using Python scripts, a TOOL_VERSION=N env | 48 # When implementing tools using Python scripts, a TOOL_VERSION=N env |
42 # variable is placed in front of the command. The N should be incremented | 49 # variable is placed in front of the command. The N should be incremented |
43 # whenever the script is changed, so that the build system rebuilds all | 50 # whenever the script is changed, so that the build system rebuilds all |
44 # edges that utilize the script. Ideally this should be changed to use | 51 # edges that utilize the script. Ideally this should be changed to use |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 if (defined(invoker.is_clang)) { | 350 if (defined(invoker.is_clang)) { |
344 is_clang = invoker.is_clang | 351 is_clang = invoker.is_clang |
345 } | 352 } |
346 } | 353 } |
347 } | 354 } |
348 } | 355 } |
349 | 356 |
350 mac_toolchain("clang_arm") { | 357 mac_toolchain("clang_arm") { |
351 toolchain_cpu = "arm" | 358 toolchain_cpu = "arm" |
352 toolchain_os = "mac" | 359 toolchain_os = "mac" |
353 prefix = rebase_path("//third_party/llvm-build/Release+Asserts/bin", | 360 cc = "${goma_prefix}${_clang_prefix}clang" |
354 root_build_dir) | 361 cxx = "${goma_prefix}${_clang_prefix}clang++" |
355 cc = "${goma_prefix}$prefix/clang" | |
356 cxx = "${goma_prefix}$prefix/clang++" | |
357 ld = cxx | 362 ld = cxx |
358 is_clang = true | 363 is_clang = true |
359 } | 364 } |
360 | 365 |
| 366 mac_toolchain("arm") { |
| 367 toolchain_cpu = "arm" |
| 368 toolchain_os = "mac" |
| 369 cc = "${goma_prefix}gcc" |
| 370 cxx = "${goma_prefix}g++" |
| 371 ld = cxx |
| 372 is_clang = false |
| 373 } |
| 374 |
| 375 mac_toolchain("clang_x64") { |
| 376 toolchain_cpu = "x64" |
| 377 toolchain_os = "mac" |
| 378 cc = "${goma_prefix}${_clang_prefix}clang" |
| 379 cxx = "${goma_prefix}${_clang_prefix}clang++" |
| 380 ld = cxx |
| 381 is_clang = true |
| 382 } |
| 383 |
| 384 mac_toolchain("x64") { |
| 385 toolchain_cpu = "x64" |
| 386 toolchain_os = "mac" |
| 387 cc = "${goma_prefix}gcc" |
| 388 cxx = "${goma_prefix}g++" |
| 389 ld = cxx |
| 390 is_clang = false |
| 391 } |
| 392 |
361 mac_toolchain("ios_clang_arm") { | 393 mac_toolchain("ios_clang_arm") { |
362 toolchain_cpu = "arm" | 394 toolchain_cpu = "arm" |
363 toolchain_os = "mac" | 395 toolchain_os = "mac" |
364 | 396 cc = "${goma_prefix}${_clang_prefix}clang" |
365 # TODO(GYP): We need to support being able to use the version of clang | 397 cxx = "${goma_prefix}${_clang_prefix}clang++" |
366 # shipped w/ XCode instead of the one pulled from upstream. | |
367 prefix = rebase_path("//third_party/llvm-build/Release+Asserts/bin", | |
368 root_build_dir) | |
369 cc = "${goma_prefix}$prefix/clang" | |
370 cxx = "${goma_prefix}$prefix/clang++" | |
371 ld = cxx | |
372 is_clang = true | |
373 } | |
374 | |
375 mac_toolchain("ios_clang_armv7") { | |
376 toolchain_cpu = "armv7" | |
377 toolchain_os = "mac" | |
378 | |
379 # TODO(GYP): We need to support being able to use the version of clang | |
380 # shipped w/ XCode instead of the one pulled from upstream. | |
381 prefix = rebase_path("//third_party/llvm-build/Release+Asserts/bin", | |
382 root_build_dir) | |
383 cc = "${goma_prefix}$prefix/clang" | |
384 cxx = "${goma_prefix}$prefix/clang++" | |
385 ld = cxx | 398 ld = cxx |
386 is_clang = true | 399 is_clang = true |
387 } | 400 } |
388 | 401 |
389 mac_toolchain("ios_clang_arm64") { | 402 mac_toolchain("ios_clang_arm64") { |
390 toolchain_cpu = "arm64" | 403 toolchain_cpu = "arm64" |
391 toolchain_os = "mac" | 404 toolchain_os = "mac" |
392 | 405 cc = "${goma_prefix}${_clang_prefix}clang" |
393 # TODO(GYP): We need to support being able to use the version of clang | 406 cxx = "${goma_prefix}${_clang_prefix}clang++" |
394 # shipped w/ XCode instead of the one pulled from upstream. | |
395 prefix = rebase_path("//third_party/llvm-build/Release+Asserts/bin", | |
396 root_build_dir) | |
397 cc = "${goma_prefix}$prefix/clang" | |
398 cxx = "${goma_prefix}$prefix/clang++" | |
399 ld = cxx | 407 ld = cxx |
400 is_clang = true | 408 is_clang = true |
401 } | 409 } |
402 | 410 |
403 mac_toolchain("arm") { | 411 mac_toolchain("ios_clang_x86") { |
404 toolchain_cpu = "arm" | 412 toolchain_cpu = "x86" |
405 toolchain_os = "mac" | 413 toolchain_os = "mac" |
406 cc = "${goma_prefix}/gcc" | 414 cc = "${goma_prefix}${_clang_prefix}clang" |
407 cxx = "${goma_prefix}/g++" | 415 cxx = "${goma_prefix}${_clang_prefix}clang++" |
408 ld = cxx | |
409 is_clang = false | |
410 } | |
411 | |
412 mac_toolchain("clang_x64") { | |
413 toolchain_cpu = "x64" | |
414 toolchain_os = "mac" | |
415 prefix = rebase_path("//third_party/llvm-build/Release+Asserts/bin", | |
416 root_build_dir) | |
417 cc = "${goma_prefix}$prefix/clang" | |
418 cxx = "${goma_prefix}$prefix/clang++" | |
419 ld = cxx | 416 ld = cxx |
420 is_clang = true | 417 is_clang = true |
421 } | 418 } |
422 | 419 |
423 mac_toolchain("x64") { | 420 mac_toolchain("ios_clang_x64") { |
424 toolchain_cpu = "x64" | 421 toolchain_cpu = "x64" |
425 toolchain_os = "mac" | 422 toolchain_os = "mac" |
426 cc = "${goma_prefix}/gcc" | 423 cc = "${goma_prefix}${_clang_prefix}clang" |
427 cxx = "${goma_prefix}/g++" | 424 cxx = "${goma_prefix}${_clang_prefix}clang++" |
428 ld = cxx | 425 ld = cxx |
429 is_clang = false | 426 is_clang = true |
430 } | 427 } |
OLD | NEW |