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/ccache.gni") | 6 import("//build/toolchain/ccache.gni") |
7 import("//build/toolchain/clang.gni") | 7 import("//build/toolchain/clang.gni") |
8 import("//build/toolchain/gcc_toolchain.gni") | 8 import("//build/toolchain/gcc_toolchain.gni") |
9 import("//build/toolchain/goma.gni") | 9 import("//build/toolchain/goma.gni") |
10 | 10 |
11 if (use_goma) { | 11 if (use_goma) { |
12 assert(!use_ccache, "Goma and ccache can't be used together.") | 12 assert(!use_ccache, "Goma and ccache can't be used together.") |
13 compiler_prefix = "$goma_dir/gomacc " | 13 compiler_prefix = "$goma_dir/gomacc " |
14 } else if (use_ccache) { | 14 } else if (use_ccache) { |
15 compiler_prefix = "ccache " | 15 compiler_prefix = "ccache " |
16 } else { | 16 } else { |
17 compiler_prefix = "" | 17 compiler_prefix = "" |
18 } | 18 } |
19 | 19 |
20 gcc_toolchain("arm") { | 20 gcc_toolchain("arm") { |
21 cc = "${compiler_prefix}arm-linux-gnueabi-gcc" | 21 cc = "${compiler_prefix}arm-linux-gnueabi-gcc" |
22 cxx = "${compiler_prefix}arm-linux-gnueabi-g++" | 22 cxx = "${compiler_prefix}arm-linux-gnueabi-g++" |
23 | 23 |
24 ar = "arm-linux-gnueabi-ar" | 24 ar = "arm-linux-gnueabi-ar" |
25 ld = cxx | 25 ld = cxx |
26 | 26 |
27 toolchain_cpu_arch = "arm" | 27 toolchain_cpu = "arm" |
28 toolchain_os = "linux" | 28 toolchain_os = "linux" |
29 is_clang = false | 29 is_clang = false |
30 } | 30 } |
31 | 31 |
32 gcc_toolchain("clang_x86") { | 32 gcc_toolchain("clang_x86") { |
33 if (use_clang_type_profiler) { | 33 if (use_clang_type_profiler) { |
34 prefix = rebase_path("//third_party/llvm-allocated-type/Linux_ia32/bin", | 34 prefix = rebase_path("//third_party/llvm-allocated-type/Linux_ia32/bin", |
35 root_build_dir) | 35 root_build_dir) |
36 } else { | 36 } else { |
37 prefix = rebase_path("//third_party/llvm-build/Release+Asserts/bin", | 37 prefix = rebase_path("//third_party/llvm-build/Release+Asserts/bin", |
38 root_build_dir) | 38 root_build_dir) |
39 } | 39 } |
40 cc = "${compiler_prefix}$prefix/clang" | 40 cc = "${compiler_prefix}$prefix/clang" |
41 cxx = "${compiler_prefix}$prefix/clang++" | 41 cxx = "${compiler_prefix}$prefix/clang++" |
42 | 42 |
43 ar = "ar" | 43 ar = "ar" |
44 ld = cxx | 44 ld = cxx |
45 | 45 |
46 toolchain_cpu_arch = "x86" | 46 toolchain_cpu = "x86" |
47 toolchain_os = "linux" | 47 toolchain_os = "linux" |
48 is_clang = true | 48 is_clang = true |
49 } | 49 } |
50 | 50 |
51 gcc_toolchain("x86") { | 51 gcc_toolchain("x86") { |
52 cc = "${compiler_prefix}gcc" | 52 cc = "${compiler_prefix}gcc" |
53 cxx = "$compiler_prefix}g++" | 53 cxx = "$compiler_prefix}g++" |
54 | 54 |
55 ar = "ar" | 55 ar = "ar" |
56 ld = cxx | 56 ld = cxx |
57 | 57 |
58 toolchain_cpu_arch = "x86" | 58 toolchain_cpu = "x86" |
59 toolchain_os = "linux" | 59 toolchain_os = "linux" |
60 is_clang = false | 60 is_clang = false |
61 } | 61 } |
62 | 62 |
63 gcc_toolchain("clang_x64") { | 63 gcc_toolchain("clang_x64") { |
64 if (use_clang_type_profiler) { | 64 if (use_clang_type_profiler) { |
65 prefix = rebase_path("//third_party/llvm-allocated-type/Linux_x64/bin", | 65 prefix = rebase_path("//third_party/llvm-allocated-type/Linux_x64/bin", |
66 root_build_dir) | 66 root_build_dir) |
67 } else { | 67 } else { |
68 prefix = rebase_path("//third_party/llvm-build/Release+Asserts/bin", | 68 prefix = rebase_path("//third_party/llvm-build/Release+Asserts/bin", |
69 root_build_dir) | 69 root_build_dir) |
70 } | 70 } |
71 cc = "${compiler_prefix}$prefix/clang" | 71 cc = "${compiler_prefix}$prefix/clang" |
72 cxx = "${compiler_prefix}$prefix/clang++" | 72 cxx = "${compiler_prefix}$prefix/clang++" |
73 | 73 |
74 ar = "ar" | 74 ar = "ar" |
75 ld = cxx | 75 ld = cxx |
76 | 76 |
77 toolchain_cpu_arch = "x64" | 77 toolchain_cpu = "x64" |
78 toolchain_os = "linux" | 78 toolchain_os = "linux" |
79 is_clang = true | 79 is_clang = true |
80 } | 80 } |
81 | 81 |
82 gcc_toolchain("x64") { | 82 gcc_toolchain("x64") { |
83 cc = "${compiler_prefix}gcc" | 83 cc = "${compiler_prefix}gcc" |
84 cxx = "${compiler_prefix}g++" | 84 cxx = "${compiler_prefix}g++" |
85 | 85 |
86 ar = "ar" | 86 ar = "ar" |
87 ld = cxx | 87 ld = cxx |
88 | 88 |
89 toolchain_cpu_arch = "x64" | 89 toolchain_cpu = "x64" |
90 toolchain_os = "linux" | 90 toolchain_os = "linux" |
91 is_clang = false | 91 is_clang = false |
92 } | 92 } |
93 | 93 |
94 gcc_toolchain("mipsel") { | 94 gcc_toolchain("mipsel") { |
95 cc = "mipsel-linux-gnu-gcc" | 95 cc = "mipsel-linux-gnu-gcc" |
96 cxx = "mipsel-linux-gnu-g++" | 96 cxx = "mipsel-linux-gnu-g++" |
97 ar = "mipsel-linux-gnu-ar" | 97 ar = "mipsel-linux-gnu-ar" |
98 ld = cxx | 98 ld = cxx |
99 | 99 |
100 toolchain_cpu_arch = "mipsel" | 100 toolchain_cpu = "mipsel" |
101 toolchain_os = "linux" | 101 toolchain_os = "linux" |
102 is_clang = false | 102 is_clang = false |
103 } | 103 } |
OLD | NEW |