diff options
| author | Dylan Baker <dylan@pnwbakers.com> | 2020-12-04 17:01:45 -0800 |
|---|---|---|
| committer | Dylan Baker <dylan@pnwbakers.com> | 2021-01-04 12:20:58 -0800 |
| commit | e81acbd6069e8c1ae8e3be7bb83ddc239009d42d (patch) | |
| tree | b08545b2844650ed95e42ade00ecb1cd3fb85b88 /mesonbuild/modules/pkgconfig.py | |
| parent | 71db6b04a31707674ad776be1cf22f667056d56b (diff) | |
| download | meson-e81acbd6069e8c1ae8e3be7bb83ddc239009d42d.tar.gz | |
Use a single coredata dictionary for options
This patches takes the options work to it's logical conclusion: A single
flat dictionary of OptionKey: UserOptions. This allows us to simplify a
large number of cases, as we don't need to check if an option is in this
dict or that one (or any of 5 or 6, actually).
Diffstat (limited to 'mesonbuild/modules/pkgconfig.py')
| -rw-r--r-- | mesonbuild/modules/pkgconfig.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/mesonbuild/modules/pkgconfig.py b/mesonbuild/modules/pkgconfig.py index 7e19d7177..7d347a6f1 100644 --- a/mesonbuild/modules/pkgconfig.py +++ b/mesonbuild/modules/pkgconfig.py @@ -331,10 +331,10 @@ class PkgConfigModule(ExtensionModule): srcdir = PurePath(state.environment.get_source_dir()) else: outdir = state.environment.scratch_dir - prefix = PurePath(coredata.get_builtin_option('prefix')) + prefix = PurePath(coredata.get_option(mesonlib.OptionKey('prefix'))) # These always return paths relative to prefix - libdir = PurePath(coredata.get_builtin_option('libdir')) - incdir = PurePath(coredata.get_builtin_option('includedir')) + libdir = PurePath(coredata.get_option(mesonlib.OptionKey('libdir'))) + incdir = PurePath(coredata.get_option(mesonlib.OptionKey('includedir'))) fname = os.path.join(outdir, pcfile) with open(fname, 'w', encoding='utf-8') as ofile: if not dataonly: @@ -531,9 +531,9 @@ class PkgConfigModule(ExtensionModule): pkgroot = kwargs.get('install_dir', default_install_dir) if pkgroot is None: if mesonlib.is_freebsd(): - pkgroot = os.path.join(state.environment.coredata.get_builtin_option('prefix'), 'libdata', 'pkgconfig') + pkgroot = os.path.join(state.environment.coredata.get_option(mesonlib.OptionKey('prefix')), 'libdata', 'pkgconfig') else: - pkgroot = os.path.join(state.environment.coredata.get_builtin_option('libdir'), 'pkgconfig') + pkgroot = os.path.join(state.environment.coredata.get_option(mesonlib.OptionKey('libdir')), 'pkgconfig') if not isinstance(pkgroot, str): raise mesonlib.MesonException('Install_dir must be a string.') self.generate_pkgconfig_file(state, deps, subdirs, name, description, url, |
