Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(123)

Side by Side Diff: build/toolchain/mac/BUILD.gn

Issue 2079283002: [iOS/GN] Allow compilation with system clang. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « build/config/sanitizers/BUILD.gn ('k') | build/toolchain/toolchain.gni » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/cc_wrapper.gni")
17 import("//build/toolchain/goma.gni") 17 import("//build/toolchain/goma.gni")
18 import("//build/toolchain/toolchain.gni") 18 import("//build/toolchain/toolchain.gni")
19 import("//build/toolchain/concurrent_links.gni") 19 import("//build/toolchain/concurrent_links.gni")
20 20
21 if (use_goma) { 21 if (use_goma) {
22 assert(cc_wrapper == "", "Goma and cc_wrapper can't be used together.") 22 assert(cc_wrapper == "", "Goma and cc_wrapper can't be used together.")
23 compiler_prefix = "$goma_dir/gomacc " 23 compiler_prefix = "$goma_dir/gomacc "
24 } else if (cc_wrapper != "") { 24 } else if (cc_wrapper != "") {
25 compiler_prefix = cc_wrapper + " " 25 compiler_prefix = cc_wrapper + " "
26 } else { 26 } else {
27 compiler_prefix = "" 27 compiler_prefix = ""
28 } 28 }
29 29
30 if (use_xcode_clang) {
31 _clang_prefix = ""
32 } else {
33 _clang_prefix = rebase_path("//third_party/llvm-build/Release+Asserts/bin/",
34 root_build_dir)
35 }
36
30 if (current_toolchain == default_toolchain) { 37 if (current_toolchain == default_toolchain) {
31 # Reduce the number of tasks using the copy_bundle_data and compile_xcassets 38 # Reduce the number of tasks using the copy_bundle_data and compile_xcassets
32 # tools as they can cause lots of I/O contention when invoking ninja with a 39 # tools as they can cause lots of I/O contention when invoking ninja with a
33 # large number of parallel jobs (e.g. when using distributed build like goma). 40 # large number of parallel jobs (e.g. when using distributed build like goma).
34 pool("bundle_pool") { 41 pool("bundle_pool") {
35 depth = concurrent_links 42 depth = concurrent_links
36 } 43 }
37 } 44 }
38 45
39 # This will copy the gyp-mac-tool to the build directory. We pass in the source 46 # This will copy the gyp-mac-tool to the build directory. We pass in the source
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 if (defined(invoker.is_clang)) { 354 if (defined(invoker.is_clang)) {
348 is_clang = invoker.is_clang 355 is_clang = invoker.is_clang
349 } 356 }
350 } 357 }
351 } 358 }
352 } 359 }
353 360
354 mac_toolchain("clang_arm") { 361 mac_toolchain("clang_arm") {
355 toolchain_cpu = "arm" 362 toolchain_cpu = "arm"
356 toolchain_os = "mac" 363 toolchain_os = "mac"
357 prefix = rebase_path("//third_party/llvm-build/Release+Asserts/bin", 364 cc = "${compiler_prefix}${_clang_prefix}clang"
358 root_build_dir) 365 cxx = "${compiler_prefix}${_clang_prefix}clang++"
359 cc = "${compiler_prefix}$prefix/clang"
360 cxx = "${compiler_prefix}$prefix/clang++"
361 ld = cxx 366 ld = cxx
362 is_clang = true 367 is_clang = true
363 } 368 }
364 369
370 mac_toolchain("arm") {
371 toolchain_cpu = "arm"
372 toolchain_os = "mac"
373 cc = "${compiler_prefix}gcc"
374 cxx = "${compiler_prefix}g++"
375 ld = cxx
376 is_clang = false
377 }
378
379 mac_toolchain("clang_x64") {
380 toolchain_cpu = "x64"
381 toolchain_os = "mac"
382 cc = "${compiler_prefix}${_clang_prefix}clang"
383 cxx = "${compiler_prefix}${_clang_prefix}clang++"
384 ld = cxx
385 is_clang = true
386 }
387
388 mac_toolchain("x64") {
389 toolchain_cpu = "x64"
390 toolchain_os = "mac"
391 cc = "${compiler_prefix}gcc"
392 cxx = "${compiler_prefix}g++"
393 ld = cxx
394 is_clang = false
395 }
396
365 mac_toolchain("ios_clang_arm") { 397 mac_toolchain("ios_clang_arm") {
366 toolchain_cpu = "arm" 398 toolchain_cpu = "arm"
367 toolchain_os = "mac" 399 toolchain_os = "mac"
368 400 cc = "${compiler_prefix}${_clang_prefix}clang"
369 # TODO(GYP): We need to support being able to use the version of clang 401 cxx = "${compiler_prefix}${_clang_prefix}clang++"
370 # shipped w/ XCode instead of the one pulled from upstream.
371 prefix = rebase_path("//third_party/llvm-build/Release+Asserts/bin",
372 root_build_dir)
373 cc = "${compiler_prefix}$prefix/clang"
374 cxx = "${compiler_prefix}$prefix/clang++"
375 ld = cxx
376 is_clang = true
377 }
378
379 mac_toolchain("ios_clang_armv7") {
380 toolchain_cpu = "armv7"
381 toolchain_os = "mac"
382
383 # TODO(GYP): We need to support being able to use the version of clang
384 # shipped w/ XCode instead of the one pulled from upstream.
385 prefix = rebase_path("//third_party/llvm-build/Release+Asserts/bin",
386 root_build_dir)
387 cc = "${compiler_prefix}$prefix/clang"
388 cxx = "${compiler_prefix}$prefix/clang++"
389 ld = cxx 402 ld = cxx
390 is_clang = true 403 is_clang = true
391 } 404 }
392 405
393 mac_toolchain("ios_clang_arm64") { 406 mac_toolchain("ios_clang_arm64") {
394 toolchain_cpu = "arm64" 407 toolchain_cpu = "arm64"
395 toolchain_os = "mac" 408 toolchain_os = "mac"
396 409 cc = "${compiler_prefix}${_clang_prefix}clang"
397 # TODO(GYP): We need to support being able to use the version of clang 410 cxx = "${compiler_prefix}${_clang_prefix}clang++"
398 # shipped w/ XCode instead of the one pulled from upstream.
399 prefix = rebase_path("//third_party/llvm-build/Release+Asserts/bin",
400 root_build_dir)
401 cc = "${compiler_prefix}$prefix/clang"
402 cxx = "${compiler_prefix}$prefix/clang++"
403 ld = cxx 411 ld = cxx
404 is_clang = true 412 is_clang = true
405 } 413 }
406 414
407 mac_toolchain("arm") { 415 mac_toolchain("ios_clang_x86") {
408 toolchain_cpu = "arm" 416 toolchain_cpu = "x86"
409 toolchain_os = "mac" 417 toolchain_os = "mac"
410 cc = "${compiler_prefix}/gcc" 418 cc = "${compiler_prefix}${_clang_prefix}clang"
411 cxx = "${compiler_prefix}/g++" 419 cxx = "${compiler_prefix}${_clang_prefix}clang++"
412 ld = cxx
413 is_clang = false
414 }
415
416 mac_toolchain("clang_x64") {
417 toolchain_cpu = "x64"
418 toolchain_os = "mac"
419 prefix = rebase_path("//third_party/llvm-build/Release+Asserts/bin",
420 root_build_dir)
421 cc = "${compiler_prefix}$prefix/clang"
422 cxx = "${compiler_prefix}$prefix/clang++"
423 ld = cxx 420 ld = cxx
424 is_clang = true 421 is_clang = true
425 } 422 }
426 423
427 mac_toolchain("x64") { 424 mac_toolchain("ios_clang_x64") {
428 toolchain_cpu = "x64" 425 toolchain_cpu = "x64"
429 toolchain_os = "mac" 426 toolchain_os = "mac"
430 cc = "${compiler_prefix}/gcc" 427 cc = "${compiler_prefix}${_clang_prefix}clang"
431 cxx = "${compiler_prefix}/g++" 428 cxx = "${compiler_prefix}${_clang_prefix}clang++"
432 ld = cxx 429 ld = cxx
433 is_clang = false 430 is_clang = true
434 } 431 }
OLDNEW
« no previous file with comments | « build/config/sanitizers/BUILD.gn ('k') | build/toolchain/toolchain.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698