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 13 matching lines...) Expand all Loading... | |
24 # when doing manual dynamic linking), set: | 24 # when doing manual dynamic linking), set: |
25 # ignore_libs = true | 25 # ignore_libs = true |
26 | 26 |
27 declare_args() { | 27 declare_args() { |
28 # A pkg-config wrapper to call instead of trying to find and call the right | 28 # A pkg-config wrapper to call instead of trying to find and call the right |
29 # pkg-config directly. Wrappers like this are common in cross-compilation | 29 # pkg-config directly. Wrappers like this are common in cross-compilation |
30 # environments. | 30 # environments. |
31 # Leaving it blank defaults to searching PATH for 'pkg-config' and relying on | 31 # Leaving it blank defaults to searching PATH for 'pkg-config' and relying on |
32 # the sysroot mechanism to find the right .pc files. | 32 # the sysroot mechanism to find the right .pc files. |
33 pkg_config = "" | 33 pkg_config = "" |
34 | |
35 # CrOS builds set the `system_libdir` variable as part of building on a 64 or | |
brettw
2016/01/07 00:43:25
I'm a bit confused what "lib" is relative to. The
rjkroege
2016/01/07 01:37:37
Done. Much more detailed comment now.
| |
36 # 32 bit target. | |
37 system_libdir = "lib" | |
34 } | 38 } |
35 | 39 |
36 pkg_config_script = "//build/config/linux/pkg-config.py" | 40 pkg_config_script = "//build/config/linux/pkg-config.py" |
37 | 41 |
38 # Define the args we pass to the pkg-config script for other build files that | 42 # Define the args we pass to the pkg-config script for other build files that |
39 # need to invoke it manually. | 43 # need to invoke it manually. |
40 if (sysroot != "") { | 44 if (sysroot != "") { |
41 # Pass the sysroot if we're using one (it requires the CPU arch also). | 45 # Pass the sysroot if we're using one (it requires the CPU arch also). |
42 pkg_config_args = [ | 46 pkg_config_args = [ |
43 "-s", | 47 "-s", |
44 sysroot, | 48 sysroot, |
45 "-a", | 49 "-a", |
46 current_cpu, | 50 current_cpu, |
51 "--system_libdir", | |
52 system_libdir, | |
47 ] | 53 ] |
48 } else if (pkg_config != "") { | 54 } else if (pkg_config != "") { |
49 pkg_config_args = [ | 55 pkg_config_args = [ |
50 "-p", | 56 "-p", |
51 pkg_config, | 57 pkg_config, |
58 "--system_libdir", | |
59 system_libdir, | |
52 ] | 60 ] |
53 } else { | 61 } else { |
54 pkg_config_args = [] | 62 pkg_config_args = [] |
55 } | 63 } |
56 | 64 |
57 template("pkg_config") { | 65 template("pkg_config") { |
58 assert(defined(invoker.packages), | 66 assert(defined(invoker.packages), |
59 "Variable |packages| must be defined to be a list in pkg_config.") | 67 "Variable |packages| must be defined to be a list in pkg_config.") |
60 config(target_name) { | 68 config(target_name) { |
61 args = pkg_config_args + invoker.packages | 69 args = pkg_config_args + invoker.packages |
(...skipping 11 matching lines...) Expand all Loading... | |
73 ldflags = pkgresult[4] | 81 ldflags = pkgresult[4] |
74 } | 82 } |
75 | 83 |
76 forward_variables_from(invoker, | 84 forward_variables_from(invoker, |
77 [ | 85 [ |
78 "defines", | 86 "defines", |
79 "visibility", | 87 "visibility", |
80 ]) | 88 ]) |
81 } | 89 } |
82 } | 90 } |
OLD | NEW |