OLD | NEW |
---|---|
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 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/linux/pkg_config.gni") | 5 import("//build/config/linux/pkg_config.gni") |
6 import("//build/config/features.gni") | 6 |
7 import("//build/config/sysroot.gni") | 7 # Exists so that this file can referenced from //BUILD.gn. |
brettw
2016/04/22 18:09:29
Did you measure this? Now that all but one pkg_con
agrieve
2016/04/22 18:20:37
Yep, this was a result of using gn gen -tracelog.
brettw
2016/04/22 19:30:21
Can you call this something like "optimize_gen_tim
agrieve
2016/04/25 14:45:35
Like it. Done.
| |
8 import("//build/config/ui.gni") | 8 group("linux") { |
9 } | |
9 | 10 |
10 # This is included by reference in the //build/config/compiler config that | 11 # This is included by reference in the //build/config/compiler config that |
11 # is applied to all targets. It is here to separate out the logic that is | 12 # is applied to all targets. It is here to separate out the logic that is |
12 # Linux-only. This is not applied to Android, but is applied to ChromeOS. | 13 # Linux-only. This is not applied to Android, but is applied to ChromeOS. |
13 config("compiler") { | 14 config("compiler") { |
14 cflags = [ "-pthread" ] | 15 cflags = [ "-pthread" ] |
15 ldflags = [ "-pthread" ] | 16 ldflags = [ "-pthread" ] |
16 } | 17 } |
17 | 18 |
18 # This is included by reference in the //build/config/compiler:runtime_library | 19 # This is included by reference in the //build/config/compiler:runtime_library |
19 # config that is applied to all targets. It is here to separate out the logic | 20 # config that is applied to all targets. It is here to separate out the logic |
20 # that is Linux-only. Please see that target for advice on what should go in | 21 # that is Linux-only. Please see that target for advice on what should go in |
21 # :runtime_library vs. :compiler. | 22 # :runtime_library vs. :compiler. |
22 config("runtime_library") { | 23 config("runtime_library") { |
23 # Set here because OS_CHROMEOS cannot be autodetected in build_config.h like | 24 # Set here because OS_CHROMEOS cannot be autodetected in build_config.h like |
24 # OS_LINUX and the like. | 25 # OS_LINUX and the like. |
25 if (is_chromeos) { | 26 if (is_chromeos) { |
26 defines = [ "OS_CHROMEOS" ] | 27 defines = [ "OS_CHROMEOS" ] |
27 } | 28 } |
28 } | 29 } |
29 | 30 |
30 config("fontconfig") { | 31 config("fontconfig") { |
31 visibility = [ "//build/linux:fontconfig" ] | 32 visibility = [ "//build/linux:fontconfig" ] |
32 | |
33 libs = [ "fontconfig" ] | 33 libs = [ "fontconfig" ] |
34 } | 34 } |
35 | 35 |
36 pkg_config("freetype2") { | |
37 visibility = [ "//build/linux:freetype2" ] | |
38 | |
39 packages = [ "freetype2" ] | |
40 } | |
41 | |
42 pkg_config("glib") { | |
43 packages = [ | |
44 "glib-2.0", | |
45 "gmodule-2.0", | |
46 "gobject-2.0", | |
47 "gthread-2.0", | |
48 ] | |
49 } | |
50 | |
51 if (use_pango || use_cairo) { | |
52 pkg_config("pangocairo") { | |
53 packages = [ "pangocairo" ] | |
54 } | |
55 } | |
56 | |
57 if (use_pango) { | |
58 pkg_config("pangoft2") { | |
59 packages = [ "pangoft2" ] | |
60 } | |
61 } | |
62 | |
63 # Note: if your target also depends on //dbus, you don't need to add this | |
64 # config (it will get added automatically if you depend on //dbus). | |
65 pkg_config("dbus") { | |
66 packages = [ "dbus-1" ] | |
67 } | |
68 | |
69 pkg_config("libffi") { | |
70 packages = [ "libffi" ] | |
71 } | |
72 | |
73 config("x11") { | 36 config("x11") { |
74 libs = [ | 37 libs = [ |
75 "X11", | 38 "X11", |
76 "Xcomposite", | 39 "Xcomposite", |
77 "Xcursor", | 40 "Xcursor", |
78 "Xdamage", | 41 "Xdamage", |
79 "Xext", | 42 "Xext", |
80 "Xfixes", | 43 "Xfixes", |
81 "Xi", | 44 "Xi", |
82 "Xrender", | 45 "Xrender", |
(...skipping 30 matching lines...) Expand all Loading... | |
113 } | 76 } |
114 | 77 |
115 config("xtst") { | 78 config("xtst") { |
116 libs = [ "Xtst" ] | 79 libs = [ "Xtst" ] |
117 } | 80 } |
118 | 81 |
119 config("libresolv") { | 82 config("libresolv") { |
120 libs = [ "resolv" ] | 83 libs = [ "resolv" ] |
121 } | 84 } |
122 | 85 |
123 # CrOS doesn't install GTK, gconf or any gnome packages. | 86 pkg_config("glib") { |
124 if (!is_chromeos && use_gconf) { | 87 packages = [ |
125 # These packages should _only_ be expected when building for a target. | 88 "glib-2.0", |
126 # If these extra checks are not run, gconf is required when building host | 89 "gmodule-2.0", |
127 # tools for a CrOS build. | 90 "gobject-2.0", |
128 if (current_toolchain == default_toolchain) { | 91 "gthread-2.0", |
129 pkg_config("atk") { | 92 ] |
130 packages = [ "atk" ] | |
131 atk_lib_dir = exec_script(pkg_config_script, | |
132 pkg_config_args + [ | |
133 "--libdir", | |
134 "atk", | |
135 ], | |
136 "string") | |
137 defines = [ "ATK_LIB_DIR=\"$atk_lib_dir\"" ] | |
138 } | |
139 | |
140 # gn orders flags on a target before flags from configs. The default config | |
141 # adds -Wall, and these flags have to be after -Wall -- so they need to | |
142 # come from a config and can't be on the target directly. | |
143 config("atk_warnings") { | |
144 cflags = [ | |
145 # glib uses the pre-c++11 typedef-as-static_assert hack. | |
146 "-Wno-unused-local-typedef", | |
147 | |
148 # G_DEFINE_TYPE automatically generates a *get_instance_private | |
149 # inline function after glib 2.37. That's unused. Prevent to | |
150 # complain about it. | |
151 "-Wno-unused-function", | |
152 ] | |
153 } | |
154 | |
155 pkg_config("gconf") { | |
156 packages = [ "gconf-2.0" ] | |
157 defines = [ "USE_GCONF" ] | |
158 } | |
159 } | |
160 } | 93 } |
OLD | NEW |