OLD | NEW |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 | 6 |
7 assert(is_posix) | 7 assert(is_posix) |
8 | 8 |
9 # This is included by reference in the //build/config/compiler:runtime_library | 9 # This is included by reference in the //build/config/compiler:runtime_library |
10 # config that is applied to all targets. It is here to separate out the logic | 10 # config that is applied to all targets. It is here to separate out the logic |
11 # that is Posix-only. Please see that target for advice on what should go in | 11 # that is Posix-only. Please see that target for advice on what should go in |
12 # :runtime_library vs. :compiler. | 12 # :runtime_library vs. :compiler. |
13 config("runtime_library") { | 13 config("runtime_library") { |
14 if (!is_mac && sysroot != "") { | 14 if (!is_mac && sysroot != "") { |
15 # Pass the sysroot to all C compiler variants, the assembler, and linker. | 15 # Pass the sysroot to all C compiler variants, the assembler, and linker. |
16 cflags = [ "--sysroot=" + sysroot ] | 16 cflags = [ "--sysroot=" + rebase_path(sysroot, root_build_dir) ] |
17 asmflags = cflags | 17 asmflags = cflags |
18 ldflags = cflags | 18 ldflags = cflags |
19 | 19 |
20 # Need to get some linker flags out of the sysroot. | 20 # Need to get some linker flags out of the sysroot. |
21 ldflags += [ exec_script("sysroot_ld_path.py", | 21 ldflags += [ exec_script("sysroot_ld_path.py", |
22 [ | 22 [ |
23 rebase_path("//build/linux/sysroot_ld_path.sh", | 23 rebase_path("//build/linux/sysroot_ld_path.sh", |
24 root_build_dir), | 24 root_build_dir), |
25 sysroot, | 25 sysroot, |
26 ], | 26 ], |
27 "value") ] | 27 "value") ] |
28 } | 28 } |
29 } | 29 } |
OLD | NEW |