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

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

Issue 2209713002: Fix compilation with Xcode version of clang. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change conditional. Created 4 years, 4 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 | « no previous file | 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/clang/clang.gni") 10 import("//build/config/clang/clang.gni")
11 if (is_ios) { 11 if (is_ios) {
12 import("//build/config/ios/ios_sdk.gni") 12 import("//build/config/ios/ios_sdk.gni")
13 } 13 }
14 import("//build/config/mac/mac_sdk.gni") 14 import("//build/config/mac/mac_sdk.gni")
15 import("//build/config/mac/symbols.gni") 15 import("//build/config/mac/symbols.gni")
16 16
17 assert(host_os == "mac") 17 assert(host_os == "mac")
18 18
19 import("//build/toolchain/cc_wrapper.gni") 19 import("//build/toolchain/cc_wrapper.gni")
20 import("//build/toolchain/goma.gni") 20 import("//build/toolchain/goma.gni")
21 import("//build/toolchain/toolchain.gni") 21 import("//build/toolchain/toolchain.gni")
22 import("//build/toolchain/concurrent_links.gni") 22 import("//build/toolchain/concurrent_links.gni")
23 23
24 if (use_goma) {
25 assert(cc_wrapper == "", "Goma and cc_wrapper can't be used together.")
26 compiler_prefix = "$goma_dir/gomacc "
27 } else if (cc_wrapper != "") {
28 compiler_prefix = cc_wrapper + " "
29 } else {
30 compiler_prefix = ""
31 }
32
33 if (!use_xcode_clang) {
34 compiler_prefix =
35 compiler_prefix + rebase_path("$clang_base_path/bin/", root_build_dir)
36 }
37
38 declare_args() { 24 declare_args() {
39 # Reduce the number of tasks using the copy_bundle_data and compile_xcassets 25 # Reduce the number of tasks using the copy_bundle_data and compile_xcassets
40 # tools as they can cause lots of I/O contention when invoking ninja with a 26 # tools as they can cause lots of I/O contention when invoking ninja with a
41 # large number of parallel jobs (e.g. when using distributed build like goma). 27 # large number of parallel jobs (e.g. when using distributed build like goma).
42 bundle_pool_depth = -1 28 bundle_pool_depth = -1
43 } 29 }
44 30
45 if (current_toolchain == default_toolchain) { 31 if (current_toolchain == default_toolchain) {
46 pool("bundle_pool") { 32 pool("bundle_pool") {
47 if (bundle_pool_depth == -1) { 33 if (bundle_pool_depth == -1) {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 # build args in this definition. 65 # build args in this definition.
80 template("mac_toolchain") { 66 template("mac_toolchain") {
81 toolchain(target_name) { 67 toolchain(target_name) {
82 assert(defined(invoker.toolchain_cpu), 68 assert(defined(invoker.toolchain_cpu),
83 "mac_toolchain() must specify a \"toolchain_cpu\"") 69 "mac_toolchain() must specify a \"toolchain_cpu\"")
84 assert(defined(invoker.toolchain_os), 70 assert(defined(invoker.toolchain_os),
85 "mac_toolchain() must specify a \"toolchain_os\"") 71 "mac_toolchain() must specify a \"toolchain_os\"")
86 72
87 # concurrent_links is picked up from the declare_arg(). 73 # concurrent_links is picked up from the declare_arg().
88 74
89 cc = "${compiler_prefix}clang" 75 if (use_goma) {
90 cxx = "${compiler_prefix}clang++" 76 assert(cc_wrapper == "", "Goma and cc_wrapper can't be used together.")
77 _compiler_prefix = "$goma_dir/gomacc "
78 } else if (cc_wrapper != "") {
79 _compiler_prefix = cc_wrapper + " "
80 } else {
81 _compiler_prefix = ""
82 }
83
84 if (invoker.toolchain_os != "ios" || !use_xcode_clang) {
85 _compiler_prefix += rebase_path("$clang_base_path/bin/", root_build_dir)
86 }
87
88 cc = "${_compiler_prefix}clang"
89 cxx = "${_compiler_prefix}clang++"
91 ld = cxx 90 ld = cxx
92 91
93 linker_driver = 92 linker_driver =
94 "TOOL_VERSION=${tool_versions.linker_driver} " + 93 "TOOL_VERSION=${tool_versions.linker_driver} " +
95 rebase_path("//build/toolchain/mac/linker_driver.py", root_build_dir) 94 rebase_path("//build/toolchain/mac/linker_driver.py", root_build_dir)
96 95
97 if (invoker.toolchain_os == "ios" && additional_toolchains != []) { 96 if (invoker.toolchain_os == "ios" && additional_toolchains != []) {
98 # For a fat build, the generation of dSYM needs to be performed after the 97 # For a fat build, the generation of dSYM needs to be performed after the
99 # generation of the fat binaries using "lipo". So disable the generation 98 # generation of the fat binaries using "lipo". So disable the generation
100 # of the dSYM for intermediate architecture specific binaries. 99 # of the dSYM for intermediate architecture specific binaries.
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 mac_toolchain("ios_clang_x86") { 415 mac_toolchain("ios_clang_x86") {
417 toolchain_cpu = "x86" 416 toolchain_cpu = "x86"
418 toolchain_os = "ios" 417 toolchain_os = "ios"
419 } 418 }
420 419
421 mac_toolchain("ios_clang_x64") { 420 mac_toolchain("ios_clang_x64") {
422 toolchain_cpu = "x64" 421 toolchain_cpu = "x64"
423 toolchain_os = "ios" 422 toolchain_os = "ios"
424 } 423 }
425 } 424 }
OLDNEW
« no previous file with comments | « no previous file | build/toolchain/toolchain.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698