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("pkg_config.gni") |
| 6 |
5 # Sets up the dynamic library search path to include our "lib" directory. | 7 # Sets up the dynamic library search path to include our "lib" directory. |
6 config("executable_ldconfig") { | 8 config("executable_ldconfig") { |
7 ldflags = [ | 9 ldflags = [ |
8 # Want to pass "\$". Need to escape both '\' and '$'. GN will re-escape as | 10 # Want to pass "\$". Need to escape both '\' and '$'. GN will re-escape as |
9 # required for ninja. | 11 # required for ninja. |
10 "-Wl,-rpath=\\\$ORIGIN/lib/", | 12 "-Wl,-rpath=\\\$ORIGIN/lib/", |
11 | 13 |
12 "-Wl,-rpath-link=lib/", | 14 "-Wl,-rpath-link=lib/", |
13 ] | 15 ] |
14 } | 16 } |
15 | 17 |
16 # This script returns a list consisting of two nested lists: the first is the | |
17 # list of cflags, the second are the linker flags. | |
18 pkg_script = "pkg-config.py" | |
19 | |
20 config("fontconfig") { | 18 config("fontconfig") { |
21 libs = [ "fontconfig" ] | 19 libs = [ "fontconfig" ] |
22 } | 20 } |
23 | 21 |
24 config("freetype2") { | 22 pkg_config("freetype2") { |
25 pkgresult = exec_script(pkg_script, [ "freetype2" ], "value") | 23 packages = [ "freetype2" ] |
26 include_dirs = pkgresult[0] | |
27 cflags = pkgresult[1] | |
28 libs = pkgresult[2] | |
29 lib_dirs = pkgresult[3] | |
30 } | 24 } |
31 | 25 |
32 config("glib") { | 26 pkg_config("glib") { |
33 pkgresult = exec_script(pkg_script, | 27 packages = [ "glib-2.0", "gmodule-2.0", "gobject-2.0", "gthread-2.0" ] |
34 [ "glib-2.0", "gmodule-2.0", "gobject-2.0", "gthread-2.0" ], "value" ) | |
35 include_dirs = pkgresult[0] | |
36 cflags = pkgresult[1] | |
37 libs = pkgresult[2] | |
38 lib_dirs = pkgresult[3] | |
39 } | 28 } |
40 | 29 |
41 config("gtk") { | 30 pkg_config("gtk") { |
42 # Gtk requires gmodule, but it does not list it as a dependency in some | 31 # Gtk requires gmodule, but it does not list it as a dependency in some |
43 # misconfigured systems. | 32 # misconfigured systems. |
44 pkgresult = exec_script(pkg_script, | 33 packages = [ "gmodule-2.0", "gtk+-2.0", "gthread-2.0" ] |
45 [ "gmodule-2.0", "gtk+-2.0", "gthread-2.0" ], "value" ) | |
46 include_dirs = pkgresult[0] | |
47 cflags = pkgresult[1] | |
48 libs = pkgresult[2] | |
49 lib_dirs = pkgresult[3] | |
50 | |
51 defines = [ "TOOLKIT_GTK" ] | 34 defines = [ "TOOLKIT_GTK" ] |
52 } | 35 } |
53 | 36 |
54 config("pangocairo") { | 37 pkg_config("pangocairo") { |
55 pkgresult = exec_script(pkg_script, [ "pangocairo" ], "value" ) | 38 packages = [ "pangocairo" ] |
56 include_dirs = pkgresult[0] | |
57 cflags = pkgresult[1] | |
58 libs = pkgresult[2] | |
59 lib_dirs = pkgresult[3] | |
60 } | 39 } |
61 | 40 |
62 config("udev") { | 41 pkg_config("udev") { |
63 pkgresult = exec_script(pkg_script, [ "libudev" ], "value" ) | 42 packages = [ "libudev" ] |
64 include_dirs = pkgresult[0] | |
65 cflags = pkgresult[1] | |
66 libs = pkgresult[2] | |
67 lib_dirs = pkgresult[3] | |
68 } | 43 } |
69 | 44 |
70 config("x11") { | 45 config("x11") { |
71 # Don't bother running pkg-config for these X related libraries since it just | 46 # Don't bother running pkg-config for these X related libraries since it just |
72 # returns the same libs, and forking pkg-config is slow. | 47 # returns the same libs, and forking pkg-config is slow. |
73 defines = [ "USE_X11" ] | 48 defines = [ "USE_X11" ] |
74 libs = [ | 49 libs = [ |
75 "X11", | 50 "X11", |
76 "Xcomposite", | 51 "Xcomposite", |
77 "Xcursor", | 52 "Xcursor", |
78 "Xdamage", | 53 "Xdamage", |
79 "Xext", | 54 "Xext", |
80 "Xfixes", | 55 "Xfixes", |
81 "Xi", | 56 "Xi", |
82 "Xrender", | 57 "Xrender", |
83 "Xss", | 58 "Xss", |
84 "Xtst", | 59 "Xtst", |
85 ] | 60 ] |
86 } | 61 } |
OLD | NEW |