Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(313)

Side by Side Diff: tools/gn/secondary/build/config/linux/BUILD.gn

Issue 24657003: GN: Return array from pkgconfig wrapper (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: empty list Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tools/gn/secondary/build/config/linux/pkg-config.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 includes = pkgresult[0]
27 cflags = pkgresult[1]
28 ldflags = pkgresult[2]
25 } 29 }
26 30
27 config("glib") { 31 config("glib") {
28 glib_packages = "glib-2.0 gmodule-2.0 gobject-2.0 gthread-2.0" 32 pkgresult = exec_script(pkg_script,
29 33 [ "glib-2.0", "gmodule-2.0", "gobject-2.0", "gthread-2.0" ], "value" )
30 cflags = exec_script(pkg_script, [ "--cflags", glib_packages ], "list lines") 34 includes = pkgresult[0]
31 ldflags = exec_script(pkg_script, [ "--libs", glib_packages ], "list lines") 35 cflags = pkgresult[1]
36 ldflags = pkgresult[2]
32 } 37 }
33 38
34 config("gtk") { 39 config("gtk") {
35 # Gtk requires gmodule, but it does not list it as a dependency in some 40 # Gtk requires gmodule, but it does not list it as a dependency in some
36 # misconfigured systems. 41 # misconfigured systems.
37 gtk_packages = "gmodule-2.0 gtk+-2.0 gthread-2.0" 42 pkgresult = exec_script(pkg_script,
43 [ "gmodule-2.0", "gtk+-2.0", "gthread-2.0" ], "value" )
44 includes = pkgresult[0]
45 cflags = pkgresult[1]
46 ldflags = pkgresult[2]
38 47
39 defines = [ "TOOLKIT_GTK" ] 48 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 } 49 }
44 50
45 config("pangocairo") { 51 config("pangocairo") {
46 cflags = exec_script(pkg_script, [ "--cflags", "pangocairo" ], "list lines") 52 pkgresult = exec_script(pkg_script, [ "pangocairo" ], "value" )
47 ldflags = exec_script(pkg_script, [ "--libs", "pangocairo" ], "list lines") 53 includes = pkgresult[0]
54 cflags = pkgresult[1]
55 ldflags = pkgresult[2]
48 } 56 }
49 57
50 config("udev") { 58 config("udev") {
51 udev_packages = "libudev" 59 pkgresult = exec_script(pkg_script, [ "libudev" ], "value" )
52 60 includes = pkgresult[0]
53 cflags = exec_script(pkg_script, [ "--cflags", udev_packages ], "list lines") 61 cflags = pkgresult[1]
54 ldflags = exec_script(pkg_script, [ "--libs", udev_packages ], "list lines") 62 ldflags = pkgresult[2]
55 } 63 }
56 64
57 config("x11") { 65 config("x11") {
58 # Don't bother running pkg-config for these X related libraries since it just 66 # 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. 67 # returns the same libs, and forking pkg-config is slow.
60 defines = [ "USE_X11" ] 68 defines = [ "USE_X11" ]
61 ldflags = [ 69 ldflags = [
62 "-lX11", 70 "-lX11",
63 "-lXcomposite", 71 "-lXcomposite",
64 "-lXcursor", 72 "-lXcursor",
65 "-lXdamage", 73 "-lXdamage",
66 "-lXext", 74 "-lXext",
67 "-lXfixes", 75 "-lXfixes",
68 "-lXi", 76 "-lXi",
69 "-lXrender", 77 "-lXrender",
70 "-lXss", 78 "-lXss",
71 "-lXtst", 79 "-lXtst",
72 ] 80 ]
73 } 81 }
OLDNEW
« no previous file with comments | « no previous file | tools/gn/secondary/build/config/linux/pkg-config.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698