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 import("//build/config/mac/mac_sdk.gni") | 11 import("//build/config/mac/mac_sdk.gni") |
12 import("//build/config/mac/symbols.gni") | 12 import("//build/config/mac/symbols.gni") |
13 | 13 |
14 assert(host_os == "mac") | 14 assert(host_os == "mac") |
15 | 15 |
| 16 import("//build/toolchain/cc_wrapper.gni") |
16 import("//build/toolchain/goma.gni") | 17 import("//build/toolchain/goma.gni") |
17 import("//build/toolchain/toolchain.gni") | 18 import("//build/toolchain/toolchain.gni") |
18 import("//build/toolchain/concurrent_links.gni") | 19 import("//build/toolchain/concurrent_links.gni") |
19 | 20 |
20 if (use_goma) { | 21 if (use_goma) { |
21 goma_prefix = "$goma_dir/gomacc " | 22 assert(cc_wrapper == "", "Goma and cc_wrapper can't be used together.") |
| 23 compiler_prefix = "$goma_dir/gomacc " |
| 24 } else if (cc_wrapper != "") { |
| 25 compiler_prefix = cc_wrapper + " " |
22 } else { | 26 } else { |
23 goma_prefix = "" | 27 compiler_prefix = "" |
24 } | 28 } |
25 | 29 |
26 if (current_toolchain == default_toolchain) { | 30 if (current_toolchain == default_toolchain) { |
27 # Reduce the number of tasks using the copy_bundle_data and compile_xcassets | 31 # 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 | 32 # 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). | 33 # large number of parallel jobs (e.g. when using distributed build like goma). |
30 pool("bundle_pool") { | 34 pool("bundle_pool") { |
31 depth = concurrent_links | 35 depth = concurrent_links |
32 } | 36 } |
33 } | 37 } |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 } | 349 } |
346 } | 350 } |
347 } | 351 } |
348 } | 352 } |
349 | 353 |
350 mac_toolchain("clang_arm") { | 354 mac_toolchain("clang_arm") { |
351 toolchain_cpu = "arm" | 355 toolchain_cpu = "arm" |
352 toolchain_os = "mac" | 356 toolchain_os = "mac" |
353 prefix = rebase_path("//third_party/llvm-build/Release+Asserts/bin", | 357 prefix = rebase_path("//third_party/llvm-build/Release+Asserts/bin", |
354 root_build_dir) | 358 root_build_dir) |
355 cc = "${goma_prefix}$prefix/clang" | 359 cc = "${compiler_prefix}$prefix/clang" |
356 cxx = "${goma_prefix}$prefix/clang++" | 360 cxx = "${compiler_prefix}$prefix/clang++" |
357 ld = cxx | 361 ld = cxx |
358 is_clang = true | 362 is_clang = true |
359 } | 363 } |
360 | 364 |
361 mac_toolchain("ios_clang_arm") { | 365 mac_toolchain("ios_clang_arm") { |
362 toolchain_cpu = "arm" | 366 toolchain_cpu = "arm" |
363 toolchain_os = "mac" | 367 toolchain_os = "mac" |
364 | 368 |
365 # TODO(GYP): We need to support being able to use the version of clang | 369 # TODO(GYP): We need to support being able to use the version of clang |
366 # shipped w/ XCode instead of the one pulled from upstream. | 370 # shipped w/ XCode instead of the one pulled from upstream. |
367 prefix = rebase_path("//third_party/llvm-build/Release+Asserts/bin", | 371 prefix = rebase_path("//third_party/llvm-build/Release+Asserts/bin", |
368 root_build_dir) | 372 root_build_dir) |
369 cc = "${goma_prefix}$prefix/clang" | 373 cc = "${compiler_prefix}$prefix/clang" |
370 cxx = "${goma_prefix}$prefix/clang++" | 374 cxx = "${compiler_prefix}$prefix/clang++" |
371 ld = cxx | 375 ld = cxx |
372 is_clang = true | 376 is_clang = true |
373 } | 377 } |
374 | 378 |
375 mac_toolchain("ios_clang_armv7") { | 379 mac_toolchain("ios_clang_armv7") { |
376 toolchain_cpu = "armv7" | 380 toolchain_cpu = "armv7" |
377 toolchain_os = "mac" | 381 toolchain_os = "mac" |
378 | 382 |
379 # TODO(GYP): We need to support being able to use the version of clang | 383 # 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. | 384 # shipped w/ XCode instead of the one pulled from upstream. |
381 prefix = rebase_path("//third_party/llvm-build/Release+Asserts/bin", | 385 prefix = rebase_path("//third_party/llvm-build/Release+Asserts/bin", |
382 root_build_dir) | 386 root_build_dir) |
383 cc = "${goma_prefix}$prefix/clang" | 387 cc = "${compiler_prefix}$prefix/clang" |
384 cxx = "${goma_prefix}$prefix/clang++" | 388 cxx = "${compiler_prefix}$prefix/clang++" |
385 ld = cxx | 389 ld = cxx |
386 is_clang = true | 390 is_clang = true |
387 } | 391 } |
388 | 392 |
389 mac_toolchain("ios_clang_arm64") { | 393 mac_toolchain("ios_clang_arm64") { |
390 toolchain_cpu = "arm64" | 394 toolchain_cpu = "arm64" |
391 toolchain_os = "mac" | 395 toolchain_os = "mac" |
392 | 396 |
393 # TODO(GYP): We need to support being able to use the version of clang | 397 # TODO(GYP): We need to support being able to use the version of clang |
394 # shipped w/ XCode instead of the one pulled from upstream. | 398 # shipped w/ XCode instead of the one pulled from upstream. |
395 prefix = rebase_path("//third_party/llvm-build/Release+Asserts/bin", | 399 prefix = rebase_path("//third_party/llvm-build/Release+Asserts/bin", |
396 root_build_dir) | 400 root_build_dir) |
397 cc = "${goma_prefix}$prefix/clang" | 401 cc = "${compiler_prefix}$prefix/clang" |
398 cxx = "${goma_prefix}$prefix/clang++" | 402 cxx = "${compiler_prefix}$prefix/clang++" |
399 ld = cxx | 403 ld = cxx |
400 is_clang = true | 404 is_clang = true |
401 } | 405 } |
402 | 406 |
403 mac_toolchain("arm") { | 407 mac_toolchain("arm") { |
404 toolchain_cpu = "arm" | 408 toolchain_cpu = "arm" |
405 toolchain_os = "mac" | 409 toolchain_os = "mac" |
406 cc = "${goma_prefix}/gcc" | 410 cc = "${compiler_prefix}/gcc" |
407 cxx = "${goma_prefix}/g++" | 411 cxx = "${compiler_prefix}/g++" |
408 ld = cxx | 412 ld = cxx |
409 is_clang = false | 413 is_clang = false |
410 } | 414 } |
411 | 415 |
412 mac_toolchain("clang_x64") { | 416 mac_toolchain("clang_x64") { |
413 toolchain_cpu = "x64" | 417 toolchain_cpu = "x64" |
414 toolchain_os = "mac" | 418 toolchain_os = "mac" |
415 prefix = rebase_path("//third_party/llvm-build/Release+Asserts/bin", | 419 prefix = rebase_path("//third_party/llvm-build/Release+Asserts/bin", |
416 root_build_dir) | 420 root_build_dir) |
417 cc = "${goma_prefix}$prefix/clang" | 421 cc = "${compiler_prefix}$prefix/clang" |
418 cxx = "${goma_prefix}$prefix/clang++" | 422 cxx = "${compiler_prefix}$prefix/clang++" |
419 ld = cxx | 423 ld = cxx |
420 is_clang = true | 424 is_clang = true |
421 } | 425 } |
422 | 426 |
423 mac_toolchain("x64") { | 427 mac_toolchain("x64") { |
424 toolchain_cpu = "x64" | 428 toolchain_cpu = "x64" |
425 toolchain_os = "mac" | 429 toolchain_os = "mac" |
426 cc = "${goma_prefix}/gcc" | 430 cc = "${compiler_prefix}/gcc" |
427 cxx = "${goma_prefix}/g++" | 431 cxx = "${compiler_prefix}/g++" |
428 ld = cxx | 432 ld = cxx |
429 is_clang = false | 433 is_clang = false |
430 } | 434 } |
OLD | NEW |