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 re | |
scottmg
2013/09/25 21:30:52
unfinished comment
| |
16 pkg_script = "pkg-config.py" | 17 pkg_script = "pkg-config.py" |
17 | 18 |
18 config("fontconfig") { | 19 config("fontconfig") { |
19 ldflags = [ "-lfontconfig" ] | 20 ldflags = [ "-lfontconfig" ] |
20 } | 21 } |
21 | 22 |
22 config("freetype2") { | 23 config("freetype2") { |
23 cflags = exec_script(pkg_script, [ "--cflags", "freetype2" ], "list lines") | 24 pkgresult = exec_script(pkg_script, [ "freetype2" ], "value") |
24 ldflags = exec_script(pkg_script, [ "--libs", "freetype2" ], "list lines") | 25 cflags = pkgresult[0] |
26 ldflags = pkgresult[1] | |
25 } | 27 } |
26 | 28 |
27 config("glib") { | 29 config("glib") { |
28 glib_packages = "glib-2.0 gmodule-2.0 gobject-2.0 gthread-2.0" | 30 pkgresult = exec_script(pkg_script, |
29 | 31 [ "glib-2.0", "gmodule-2.0", "gobject-2.0", "gthread-2.0" ], "value" ) |
30 cflags = exec_script(pkg_script, [ "--cflags", glib_packages ], "list lines") | 32 cflags = pkgresult[0] |
31 ldflags = exec_script(pkg_script, [ "--libs", glib_packages ], "list lines") | 33 ldflags = pkgresult[1] |
32 } | 34 } |
33 | 35 |
34 config("gtk") { | 36 config("gtk") { |
35 # Gtk requires gmodule, but it does not list it as a dependency in some | 37 # Gtk requires gmodule, but it does not list it as a dependency in some |
36 # misconfigured systems. | 38 # misconfigured systems. |
37 gtk_packages = "gmodule-2.0 gtk+-2.0 gthread-2.0" | 39 pkgresult = exec_script(pkg_script, |
40 [ "gmodule-2.0", "gtk+-2.0", "gthread-2.0" ], "value" ) | |
41 cflags = pkgresult[0] | |
42 ldflags = pkgresult[1] | |
38 | 43 |
39 defines = [ "TOOLKIT_GTK" ] | 44 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 } | 45 } |
44 | 46 |
45 config("pangocairo") { | 47 config("pangocairo") { |
46 cflags = exec_script(pkg_script, [ "--cflags", "pangocairo" ], "list lines") | 48 pkgresult = exec_script(pkg_script, [ "pangocairo" ], "value" ) |
47 ldflags = exec_script(pkg_script, [ "--libs", "pangocairo" ], "list lines") | 49 cflags = pkgresult[0] |
50 ldflags = pkgresult[1] | |
48 } | 51 } |
49 | 52 |
50 config("udev") { | 53 config("udev") { |
51 udev_packages = "libudev" | 54 pkgresult = exec_script(pkg_script, [ "libudev" ], "value" ) |
52 | 55 cflags = pkgresult[0] |
53 cflags = exec_script(pkg_script, [ "--cflags", udev_packages ], "list lines") | 56 ldflags = pkgresult[1] |
54 ldflags = exec_script(pkg_script, [ "--libs", udev_packages ], "list lines") | |
55 } | 57 } |
56 | 58 |
57 config("x11") { | 59 config("x11") { |
58 # Don't bother running pkg-config for these X related libraries since it just | 60 # 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. | 61 # returns the same libs, and forking pkg-config is slow. |
60 defines = [ "USE_X11" ] | 62 defines = [ "USE_X11" ] |
61 ldflags = [ | 63 ldflags = [ |
62 "-lX11", | 64 "-lX11", |
63 "-lXcomposite", | 65 "-lXcomposite", |
64 "-lXcursor", | 66 "-lXcursor", |
65 "-lXdamage", | 67 "-lXdamage", |
66 "-lXext", | 68 "-lXext", |
67 "-lXfixes", | 69 "-lXfixes", |
68 "-lXi", | 70 "-lXi", |
69 "-lXrender", | 71 "-lXrender", |
70 "-lXss", | 72 "-lXss", |
71 "-lXtst", | 73 "-lXtst", |
72 ] | 74 ] |
73 } | 75 } |
OLD | NEW |