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