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 import("//build/config/sysroot.gni") | 5 import("//build/config/sysroot.gni") |
6 | 6 |
7 # Defines a config specifying the result of running pkg-config for the given | 7 # Defines a config specifying the result of running pkg-config for the given |
8 # packages. Put the package names you want to query in the "packages" variable | 8 # packages. Put the package names you want to query in the "packages" variable |
9 # inside the template invocation. | 9 # inside the template invocation. |
10 # | 10 # |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 ] | 58 ] |
59 } else if (pkg_config != "") { | 59 } else if (pkg_config != "") { |
60 pkg_config_args = [ | 60 pkg_config_args = [ |
61 "-p", | 61 "-p", |
62 pkg_config, | 62 pkg_config, |
63 ] | 63 ] |
64 } else { | 64 } else { |
65 pkg_config_args = [] | 65 pkg_config_args = [] |
66 } | 66 } |
67 | 67 |
68 # Only use the custom libdir when building with the default toolchain. | 68 # Only use the custom libdir when building with the target sysroot. |
69 if (current_toolchain == default_toolchain) { | 69 if (target_sysroot != "" && sysroot == target_sysroot) { |
70 pkg_config_args += [ | 70 pkg_config_args += [ |
71 "--system_libdir", | 71 "--system_libdir", |
72 system_libdir, | 72 system_libdir, |
73 ] | 73 ] |
74 } | 74 } |
75 | 75 |
76 template("pkg_config") { | 76 template("pkg_config") { |
77 assert(defined(invoker.packages), | 77 assert(defined(invoker.packages), |
78 "Variable |packages| must be defined to be a list in pkg_config.") | 78 "Variable |packages| must be defined to be a list in pkg_config.") |
79 config(target_name) { | 79 config(target_name) { |
(...skipping 12 matching lines...) Expand all Loading... |
92 ldflags = pkgresult[4] | 92 ldflags = pkgresult[4] |
93 } | 93 } |
94 | 94 |
95 forward_variables_from(invoker, | 95 forward_variables_from(invoker, |
96 [ | 96 [ |
97 "defines", | 97 "defines", |
98 "visibility", | 98 "visibility", |
99 ]) | 99 ]) |
100 } | 100 } |
101 } | 101 } |
OLD | NEW |