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 # Sets up the dynamic library search path to include our "lib" directory. | 5 # Sets up the dynamic library search path to include our "lib" directory. |
6 config("executable_ldconfig") { | 6 config("executable_ldconfig") { |
7 ldflags = [ | 7 ldflags = [ |
8 # Want to pass "\$". Need to escape both '\' and '$'. GN will re-escape as | 8 # Want to pass "\$". Need to escape both '\' and '$'. GN will re-escape as |
9 # required for ninja. | 9 # required for ninja. |
10 "-Wl,-rpath=\\\$ORIGIN/lib/", | 10 "-Wl,-rpath=\\\$ORIGIN/lib/", |
11 | 11 |
12 "-Wl,-rpath-link=lib/", | 12 "-Wl,-rpath-link=lib/", |
13 ] | 13 ] |
14 } | 14 } |
15 | 15 |
| 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. |
16 pkg_script = "pkg-config.py" | 18 pkg_script = "pkg-config.py" |
17 | 19 |
18 config("fontconfig") { | 20 config("fontconfig") { |
19 ldflags = [ "-lfontconfig" ] | 21 ldflags = [ "-lfontconfig" ] |
20 } | 22 } |
21 | 23 |
22 config("freetype2") { | 24 config("freetype2") { |
23 cflags = exec_script(pkg_script, [ "--cflags", "freetype2" ], "list lines") | 25 pkgresult = exec_script(pkg_script, [ "freetype2" ], "value") |
24 ldflags = exec_script(pkg_script, [ "--libs", "freetype2" ], "list lines") | 26 cflags = pkgresult[0] |
| 27 ldflags = pkgresult[1] |
25 } | 28 } |
26 | 29 |
27 config("glib") { | 30 config("glib") { |
28 glib_packages = "glib-2.0 gmodule-2.0 gobject-2.0 gthread-2.0" | 31 pkgresult = exec_script(pkg_script, |
29 | 32 [ "glib-2.0", "gmodule-2.0", "gobject-2.0", "gthread-2.0" ], "value" ) |
30 cflags = exec_script(pkg_script, [ "--cflags", glib_packages ], "list lines") | 33 cflags = pkgresult[0] |
31 ldflags = exec_script(pkg_script, [ "--libs", glib_packages ], "list lines") | 34 ldflags = pkgresult[1] |
32 } | 35 } |
33 | 36 |
34 config("gtk") { | 37 config("gtk") { |
35 # Gtk requires gmodule, but it does not list it as a dependency in some | 38 # Gtk requires gmodule, but it does not list it as a dependency in some |
36 # misconfigured systems. | 39 # misconfigured systems. |
37 gtk_packages = "gmodule-2.0 gtk+-2.0 gthread-2.0" | 40 pkgresult = exec_script(pkg_script, |
| 41 [ "gmodule-2.0", "gtk+-2.0", "gthread-2.0" ], "value" ) |
| 42 cflags = pkgresult[0] |
| 43 ldflags = pkgresult[1] |
38 | 44 |
39 defines = [ "TOOLKIT_GTK" ] | 45 defines = [ "TOOLKIT_GTK" ] |
40 | |
41 cflags = exec_script(pkg_script, [ "--cflags", gtk_packages ], "list lines") | |
42 ldflags = exec_script(pkg_script, [ "--libs", gtk_packages ], "list lines") | |
43 } | 46 } |
44 | 47 |
45 config("pangocairo") { | 48 config("pangocairo") { |
46 cflags = exec_script(pkg_script, [ "--cflags", "pangocairo" ], "list lines") | 49 pkgresult = exec_script(pkg_script, [ "pangocairo" ], "value" ) |
47 ldflags = exec_script(pkg_script, [ "--libs", "pangocairo" ], "list lines") | 50 cflags = pkgresult[0] |
| 51 ldflags = pkgresult[1] |
48 } | 52 } |
49 | 53 |
50 config("udev") { | 54 config("udev") { |
51 udev_packages = "libudev" | 55 pkgresult = exec_script(pkg_script, [ "libudev" ], "value" ) |
52 | 56 cflags = pkgresult[0] |
53 cflags = exec_script(pkg_script, [ "--cflags", udev_packages ], "list lines") | 57 ldflags = pkgresult[1] |
54 ldflags = exec_script(pkg_script, [ "--libs", udev_packages ], "list lines") | |
55 } | 58 } |
56 | 59 |
57 config("x11") { | 60 config("x11") { |
58 # Don't bother running pkg-config for these X related libraries since it just | 61 # Don't bother running pkg-config for these X related libraries since it just |
59 # returns the same libs, and forking pkg-config is slow. | 62 # returns the same libs, and forking pkg-config is slow. |
60 defines = [ "USE_X11" ] | 63 defines = [ "USE_X11" ] |
61 ldflags = [ | 64 ldflags = [ |
62 "-lX11", | 65 "-lX11", |
63 "-lXcomposite", | 66 "-lXcomposite", |
64 "-lXcursor", | 67 "-lXcursor", |
65 "-lXdamage", | 68 "-lXdamage", |
66 "-lXext", | 69 "-lXext", |
67 "-lXfixes", | 70 "-lXfixes", |
68 "-lXi", | 71 "-lXi", |
69 "-lXrender", | 72 "-lXrender", |
70 "-lXss", | 73 "-lXss", |
71 "-lXtst", | 74 "-lXtst", |
72 ] | 75 ] |
73 } | 76 } |
OLD | NEW |