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/build_metadata.gni") | |
6 import("//build/config/sysroot.gni") | 5 import("//build/config/sysroot.gni") |
7 | 6 |
8 assert(is_posix) | 7 assert(is_posix) |
9 | 8 |
10 # 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 |
11 # 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 |
12 # 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 |
13 # :runtime_library vs. :compiler. | 12 # :runtime_library vs. :compiler. |
14 config("runtime_library") { | 13 config("runtime_library") { |
15 if (!is_mac && sysroot != "") { | 14 if (!is_mac && sysroot != "") { |
16 # 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. |
17 # If we don't care about build metadata, then just set the sysroot to an | 16 cflags = [ "--sysroot=" + rebase_path(sysroot) ] |
18 # absolute path. Some buildbots (read: codesearch) care about this. | |
19 # See crbug.com/580103 for some discussion of why this was necessary. | |
Nico
2016/02/09 22:53:49
...won't this change regress things?
Zachary Forman
2016/02/09 23:26:23
No, because of a CL dsansome submitted a few days
| |
20 if (dont_embed_build_metadata) { | |
21 cflags = [ "--sysroot=" + rebase_path(sysroot, root_build_dir) ] | |
22 } else { | |
23 cflags = [ "--sysroot=" + rebase_path(sysroot) ] | |
24 } | |
25 asmflags = cflags | 17 asmflags = cflags |
26 ldflags = cflags | 18 ldflags = cflags |
27 | 19 |
28 # Need to get some linker flags out of the sysroot. | 20 # Need to get some linker flags out of the sysroot. |
29 ldflags += [ exec_script("sysroot_ld_path.py", | 21 ldflags += [ exec_script("sysroot_ld_path.py", |
30 [ | 22 [ |
31 rebase_path("//build/linux/sysroot_ld_path.sh", | 23 rebase_path("//build/linux/sysroot_ld_path.sh", |
32 root_build_dir), | 24 root_build_dir), |
33 sysroot, | 25 sysroot, |
34 ], | 26 ], |
35 "value") ] | 27 "value") ] |
36 } | 28 } |
37 } | 29 } |
OLD | NEW |