BUILD.gn revision f2477e01787aa58f445919b809d89e252beef54f
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
3# found in the LICENSE file.
4
5# Sets up the dynamic library search path to include our "lib" directory.
6config("executable_ldconfig") {
7  ldflags = [
8    # Want to pass "\$". Need to escape both '\' and '$'. GN will re-escape as
9    # required for ninja.
10    "-Wl,-rpath=\\\$ORIGIN/lib/",
11
12    "-Wl,-rpath-link=lib/",
13  ]
14}
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.
18pkg_script = "pkg-config.py"
19
20config("fontconfig") {
21  libs = [ "fontconfig" ]
22}
23
24config("freetype2") {
25  pkgresult = exec_script(pkg_script, [ "freetype2" ], "value")
26  include_dirs = pkgresult[0]
27  cflags = pkgresult[1]
28  libs = pkgresult[2]
29  lib_dirs = pkgresult[3]
30}
31
32config("glib") {
33  pkgresult = exec_script(pkg_script,
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}
40
41config("gtk") {
42  # Gtk requires gmodule, but it does not list it as a dependency in some
43  # misconfigured systems.
44  pkgresult = exec_script(pkg_script,
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" ]
52}
53
54config("pangocairo") {
55  pkgresult = exec_script(pkg_script, [ "pangocairo" ], "value" )
56  include_dirs = pkgresult[0]
57  cflags = pkgresult[1]
58  libs = pkgresult[2]
59  lib_dirs = pkgresult[3]
60}
61
62config("udev") {
63  pkgresult = exec_script(pkg_script, [ "libudev" ], "value" )
64  include_dirs = pkgresult[0]
65  cflags = pkgresult[1]
66  libs = pkgresult[2]
67  lib_dirs = pkgresult[3]
68}
69
70config("x11") {
71  # 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.
73  defines = [ "USE_X11" ]
74  libs = [
75    "X11",
76    "Xcomposite",
77    "Xcursor",
78    "Xdamage",
79    "Xext",
80    "Xfixes",
81    "Xi",
82    "Xrender",
83    "Xss",
84    "Xtst",
85  ]
86}
87