diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2019-02-12 15:51:46 -0800 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2019-04-05 15:08:17 -0700 |
commit | 569e646e1e3556fb5fdb7c4fb012a30145c7145d (patch) | |
tree | 1e42b0750bb3e0f0cce0cb1857916c0b2d7d97b6 /mesonbuild/coredata.py | |
parent | 25eb86382b4b081c1d3992b9bfd9ebc4ab9b3d10 (diff) | |
download | meson-569e646e1e3556fb5fdb7c4fb012a30145c7145d.zip meson-569e646e1e3556fb5fdb7c4fb012a30145c7145d.tar.gz meson-569e646e1e3556fb5fdb7c4fb012a30145c7145d.tar.bz2 |
dependencies: Add command line option for pkg_config_path
This creates a new command line option to store pkg_config_path into,
and store the environment variable into that option. Currently this
works like the environment variable, for both cross and native targets.
Diffstat (limited to 'mesonbuild/coredata.py')
-rw-r--r-- | mesonbuild/coredata.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py index 2666bb9..034f86a 100644 --- a/mesonbuild/coredata.py +++ b/mesonbuild/coredata.py @@ -270,7 +270,6 @@ class CoreData: self.cross_compilers = OrderedDict() self.deps = OrderedDict() # Only to print a warning if it changes between Meson invocations. - self.pkgconf_envvar = os.environ.get('PKG_CONFIG_PATH', '') self.config_files = self.__load_config_files(options.native_file) self.libdir_cross_fixup() @@ -504,6 +503,12 @@ class CoreData: # languages and setting the backend (builtin options must be set first # to know which backend we'll use). options = {} + + # Some options default to environment variables if they are + # unset, set those now. These will either be overwritten + # below, or they won't. + options['pkg_config_path'] = os.environ.get('PKG_CONFIG_PATH', '').split(':') + for k, v in env.cmd_line_options.items(): if subproject: if not k.startswith(subproject + ':'): @@ -789,6 +794,7 @@ builtin_options = { 'optimization': BuiltinOption(UserComboOption, 'Optimization level', '0', choices=['0', 'g', '1', '2', '3', 's']), 'debug': BuiltinOption(UserBooleanOption, 'Debug', True), 'wrap_mode': BuiltinOption(UserComboOption, 'Wrap mode', 'default', choices=['default', 'nofallback', 'nodownload', 'forcefallback']), + 'pkg_config_path': BuiltinOption(UserArrayOption, 'List of additional paths for pkg-config to search', []), } # Special prefix-dependent defaults for installation directories that reside in |