OLD | NEW |
---|---|
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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/toolchain/clang.gni") | 5 import("//build/toolchain/clang.gni") |
6 import("//build/toolchain/gcc_toolchain.gni") | 6 import("//build/toolchain/gcc_toolchain.gni") |
7 import("//build/config/sysroot.gni") | |
7 | 8 |
8 declare_args() { | 9 declare_args() { |
9 # The CrOS build system supports many different kinds of targets across | 10 # The CrOS build system supports many different kinds of targets across |
viettrungluu
2015/09/15 23:48:22
Update this comment for FNL?
cdotstout
2015/09/16 22:01:00
Done.
| |
10 # many different architectures. Bringing your own toolchain is also supported, | 11 # many different architectures. Bringing your own toolchain is also supported, |
11 # so it's actually impossible to enumerate all toolchains for all targets | 12 # so it's actually impossible to enumerate all toolchains for all targets |
12 # as GN toolchain specifications. | 13 # as GN toolchain specifications. |
13 # These arguments provide a mechanism for specifying your CC, CXX and AR at | 14 # These arguments provide a mechanism for specifying your CC, CXX and AR at |
14 # buildfile-generation time, allowing the CrOS build system to always use | 15 # buildfile-generation time, allowing the CrOS build system to always use |
15 # the right tools for the current target. | 16 # the right tools for the current target. |
16 cros_target_cc = "" | 17 compiler_prefix = "${sysroot}/../../bin/x86_64-linux-" |
viettrungluu
2015/09/15 23:48:22
It seems odd to be going outside the sysroot, but
cdotstout
2015/09/16 22:01:00
Right, this is a buildroot specific hack. Reworke
| |
17 cros_target_cxx = "" | 18 cros_target_cc = "${compiler_prefix}gcc" |
viettrungluu
2015/09/15 23:48:22
Can you rename these from cros_... to fnl_...?
cdotstout
2015/09/16 22:01:00
Done.
| |
18 cros_target_ar = "" | 19 cros_target_cxx = "${compiler_prefix}g++" |
20 cros_target_ar = "${compiler_prefix}ar" | |
21 cros_target_readelf = "${compiler_prefix}readelf" | |
22 cros_target_nm = "${compiler_prefix}nm" | |
19 } | 23 } |
20 | 24 |
21 gcc_toolchain("target") { | 25 gcc_toolchain("target") { |
22 assert(cros_target_cc != "", "Must provide target CC.") | 26 assert(cros_target_cc != "", "Must provide target CC.") |
23 assert(cros_target_cxx != "", "Must provide target CXX.") | 27 assert(cros_target_cxx != "", "Must provide target CXX.") |
24 assert(cros_target_ar != "", "Must provide target AR.") | 28 assert(cros_target_ar != "", "Must provide target AR.") |
25 | 29 |
26 cc = "${cros_target_cc}" | 30 cc = "${cros_target_cc}" |
27 cxx = "${cros_target_cxx}" | 31 cxx = "${cros_target_cxx}" |
28 | 32 |
29 ar = "${cros_target_ar}" | 33 ar = "${cros_target_ar}" |
30 ld = cxx | 34 ld = cxx |
35 readelf = "${cros_target_readelf}" | |
36 nm = "${cros_target_nm}" | |
31 | 37 |
32 toolchain_cpu = "${target_cpu}" | 38 toolchain_cpu = "${target_cpu}" |
33 toolchain_os = "linux" | 39 toolchain_os = "linux" |
34 is_clang = is_clang | 40 is_clang = is_clang |
35 } | 41 } |
OLD | NEW |