| 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 | 10 |
| 11 # Should only be running on Mac. | 11 # Should only be running on Mac. |
| 12 assert(is_mac || is_ios) | 12 assert(is_mac || is_ios) |
| 13 | 13 |
| 14 import("//build/toolchain/clang.gni") | 14 import("//build/toolchain/clang.gni") |
| 15 import("//build/toolchain/goma.gni") | 15 import("//build/toolchain/goma.gni") |
| 16 | 16 |
| 17 if (is_clang) { | 17 if (is_clang) { |
| 18 cc = rebase_path("//third_party/llvm-build/Release+Asserts/bin/clang", | 18 cc = rebase_path("//third_party/llvm-build/Release+Asserts/bin/clang", |
| 19 root_build_dir) | 19 root_build_dir) |
| 20 cxx = rebase_path("//third_party/llvm-build/Release+Asserts/bin/clang++", | 20 cxx = rebase_path("//third_party/llvm-build/Release+Asserts/bin/clang++", |
| 21 root_build_dir) | 21 root_build_dir) |
| 22 | |
| 23 # Set the GYP header for all toolchains when running under Clang. | |
| 24 if (is_gyp) { | |
| 25 make_global_settings = make_clang_global_settings | |
| 26 | |
| 27 if (use_goma) { | |
| 28 # There is a TODO(yyanagisawa) in common.gypi about the make generator not | |
| 29 # supporting CC_wrapper without CC. As a result, we must add a condition | |
| 30 # when on the generator when we're not explicitly setting the variables | |
| 31 # above (which happens when gyp_header is empty at this point). | |
| 32 # | |
| 33 # GYP will interpret the file once for each generator, so we have to write | |
| 34 # this condition into the GYP file since the user could have more than one | |
| 35 # generator set. | |
| 36 gyp_header = | |
| 37 "'conditions':" + | |
| 38 "[['\"<(GENERATOR)\"==\"ninja\"', { 'make_global_settings': [" + | |
| 39 make_global_settings + | |
| 40 make_goma_global_settings + | |
| 41 "]}]]," | |
| 42 } else { | |
| 43 gyp_header = "'make_global_settings': [" + make_global_settings + "]," | |
| 44 } | |
| 45 } | |
| 46 } else { | 22 } else { |
| 47 cc = "gcc" | 23 cc = "gcc" |
| 48 cxx = "g++" | 24 cxx = "g++" |
| 49 } | 25 } |
| 50 ld = cxx | 26 ld = cxx |
| 51 | 27 |
| 52 # This will copy the gyp-mac-tool to the build directory. We pass in the source | 28 # This will copy the gyp-mac-tool to the build directory. We pass in the source |
| 53 # file of the win tool. | 29 # file of the win tool. |
| 54 gyp_mac_tool_source = | 30 gyp_mac_tool_source = |
| 55 rebase_path("//tools/gyp/pylib/gyp/mac_tool.py", root_build_dir) | 31 rebase_path("//tools/gyp/pylib/gyp/mac_tool.py", root_build_dir) |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 # Toolchain representing the target build (either mac or iOS). | 124 # Toolchain representing the target build (either mac or iOS). |
| 149 mac_clang_toolchain("clang") { | 125 mac_clang_toolchain("clang") { |
| 150 toolchain_os = os | 126 toolchain_os = os |
| 151 } | 127 } |
| 152 | 128 |
| 153 # This toolchain provides a way for iOS target compiles to reference targets | 129 # This toolchain provides a way for iOS target compiles to reference targets |
| 154 # compiled for the host system. It just overrides the OS back to "mac". | 130 # compiled for the host system. It just overrides the OS back to "mac". |
| 155 mac_clang_toolchain("host_clang") { | 131 mac_clang_toolchain("host_clang") { |
| 156 toolchain_os = "mac" | 132 toolchain_os = "mac" |
| 157 } | 133 } |
| OLD | NEW |