| # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| # Sets up the dynamic library search path to include our "lib" directory. |
| config("executable_ldconfig") { |
| ldflags = [ |
| # Want to pass "\$". Need to escape both '\' and '$'. GN will re-escape as |
| # required for ninja. |
| "-Wl,-rpath=\\\$ORIGIN/lib/", |
| |
| "-Wl,-rpath-link=lib/", |
| ] |
| } |
| |
| pkg_script = "pkg-config.py" |
| |
| config("glib") { |
| glib_packages = "glib-2.0 gmodule-2.0 gobject-2.0 gthread-2.0" |
| |
| cflags = exec_script(pkg_script, [ "--cflags", glib_packages ], "list lines") |
| ldflags = exec_script(pkg_script, [ "--libs", glib_packages ], "list lines") |
| # if (use_x11) { # TODO(brettw) need to add use_x11 |
| ldflags += "-lXtst" |
| #} |
| } |
| |
| config("gtk") { |
| # Gtk requires gmodule, but it does not list it as a dependency in some |
| # misconfigured systems. |
| gtk_packages = "gmodule-2.0 gtk+-2.0 gthread-2.0" |
| |
| defines = [ "TOOLKIT_GTK" ] |
| |
| cflags = exec_script(pkg_script, [ "--cflags", gtk_packages ], "list lines") |
| ldflags = exec_script(pkg_script, [ "--libs", gtk_packages ], "list lines") |
| } |
| |
| config("x11") { |
| x11_packages = "x11 xi" |
| |
| defines = [ "USE_X11" ] |
| |
| cflags = exec_script(pkg_script, [ "--cflags", x11_packages ], "list lines") |
| ldflags = exec_script(pkg_script, [ "--libs", x11_packages ], "list lines") |
| } |