OLD | NEW |
1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 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 import("//build/config/sysroot.gni") | 5 import("//build/config/sysroot.gni") |
6 import("//build/toolchain/clang.gni") | 6 import("//build/toolchain/clang.gni") |
7 import("//build/toolchain/gcc_toolchain.gni") | 7 import("//build/toolchain/gcc_toolchain.gni") |
8 import("//build/toolchain/goma.gni") | 8 import("//build/toolchain/goma.gni") |
9 | 9 |
10 if (is_gyp) { | |
11 # Set the compilers for GYP to use. This logic is only relevant to GYP where | |
12 # there is "a" target compiler. In native GN builds, we have separate | |
13 # compilers for the toolchains below, any or all of which could be active in | |
14 # any given build. | |
15 if (is_clang) { | |
16 # Set the GYP header for all toolchains when running under Clang. | |
17 make_global_settings = make_clang_global_settings | |
18 } else { | |
19 if (cpu_arch == "mipsel") { | |
20 make_global_settings = | |
21 "['CC', '$sysroot/../bin/mipsel-linux-gnu-gcc']," + | |
22 "['CXX', '$sysroot/../bin/mipsel-linux-gnu-g++']," + | |
23 "['CC.host', '/usr/bin/gcc']," + | |
24 "['CXX.host', '/usr/bin/g++']," | |
25 } else { | |
26 make_global_settings = "" | |
27 } | |
28 } | |
29 | |
30 if (use_goma) { | |
31 # There is a TODO(yyanagisawa) in common.gypi about the make generator not | |
32 # supporting CC_wrapper without CC. As a result, we must add a condition | |
33 # when on the generator when we're not explicitly setting the variables | |
34 # above (which happens when gyp_header is empty at this point). | |
35 # | |
36 # GYP will interpret the file once for each generator, so we have to write | |
37 # this condition into the GYP file since the user could have more than one | |
38 # generator set. | |
39 gyp_header = | |
40 "'conditions':" + | |
41 "[['\"<(GENERATOR)\"==\"ninja\"', { 'make_global_settings': [" + | |
42 make_global_settings + | |
43 make_goma_global_settings + | |
44 "]}]]," | |
45 } else { | |
46 gyp_header = "'make_global_settings': [" + make_global_settings + "]," | |
47 } | |
48 } | |
49 | |
50 gcc_toolchain("arm") { | 10 gcc_toolchain("arm") { |
51 cc = "arm-linux-gnueabi-gcc" | 11 cc = "arm-linux-gnueabi-gcc" |
52 cxx = "arm-linux-gnueabi-g++" | 12 cxx = "arm-linux-gnueabi-g++" |
53 ar = "arm-linux-gnueabi-ar" | 13 ar = "arm-linux-gnueabi-ar" |
54 ld = cxx | 14 ld = cxx |
55 | 15 |
56 toolchain_cpu_arch = "arm" | 16 toolchain_cpu_arch = "arm" |
57 toolchain_os = "linux" | 17 toolchain_os = "linux" |
58 } | 18 } |
59 | 19 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 | 65 |
106 gcc_toolchain("mipsel") { | 66 gcc_toolchain("mipsel") { |
107 cc = "mipsel-linux-gnu-gcc" | 67 cc = "mipsel-linux-gnu-gcc" |
108 cxx = "mipsel-linux-gnu-g++" | 68 cxx = "mipsel-linux-gnu-g++" |
109 ar = "mipsel-linux-gnu-ar" | 69 ar = "mipsel-linux-gnu-ar" |
110 ld = cxx | 70 ld = cxx |
111 | 71 |
112 toolchain_cpu_arch = "mipsel" | 72 toolchain_cpu_arch = "mipsel" |
113 toolchain_os = "linux" | 73 toolchain_os = "linux" |
114 } | 74 } |
OLD | NEW |