aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules/cmake.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2020-12-04 17:01:45 -0800
committerDylan Baker <dylan@pnwbakers.com>2021-01-04 12:20:58 -0800
commite81acbd6069e8c1ae8e3be7bb83ddc239009d42d (patch)
treeb08545b2844650ed95e42ade00ecb1cd3fb85b88 /mesonbuild/modules/cmake.py
parent71db6b04a31707674ad776be1cf22f667056d56b (diff)
downloadmeson-e81acbd6069e8c1ae8e3be7bb83ddc239009d42d.zip
meson-e81acbd6069e8c1ae8e3be7bb83ddc239009d42d.tar.gz
meson-e81acbd6069e8c1ae8e3be7bb83ddc239009d42d.tar.bz2
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/cmake.py')
-rw-r--r--mesonbuild/modules/cmake.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/mesonbuild/modules/cmake.py b/mesonbuild/modules/cmake.py
index 35c85a7..f6afaf3 100644
--- a/mesonbuild/modules/cmake.py
+++ b/mesonbuild/modules/cmake.py
@@ -269,7 +269,7 @@ class CmakeModule(ExtensionModule):
pkgroot = kwargs.get('install_dir', None)
if pkgroot is None:
- pkgroot = os.path.join(state.environment.coredata.get_builtin_option('libdir'), 'cmake', name)
+ pkgroot = os.path.join(state.environment.coredata.get_option(mesonlib.OptionKey('libdir')), 'cmake', name)
if not isinstance(pkgroot, str):
raise mesonlib.MesonException('Install_dir must be a string.')
@@ -342,7 +342,7 @@ class CmakeModule(ExtensionModule):
(ofile_path, ofile_fname) = os.path.split(os.path.join(state.subdir, '{}Config.cmake'.format(name)))
ofile_abs = os.path.join(state.environment.build_dir, ofile_path, ofile_fname)
- install_dir = kwargs.get('install_dir', os.path.join(state.environment.coredata.get_builtin_option('libdir'), 'cmake', name))
+ install_dir = kwargs.get('install_dir', os.path.join(state.environment.coredata.get_option(mesonlib.OptionKey('libdir')), 'cmake', name))
if not isinstance(install_dir, str):
raise mesonlib.MesonException('"install_dir" must be a string.')
@@ -352,7 +352,7 @@ class CmakeModule(ExtensionModule):
if not isinstance(conf, ConfigurationDataHolder):
raise mesonlib.MesonException('Argument "configuration" is not of type configuration_data')
- prefix = state.environment.coredata.get_builtin_option('prefix')
+ prefix = state.environment.coredata.get_option(mesonlib.OptionKey('prefix'))
abs_install_dir = install_dir
if not os.path.isabs(abs_install_dir):
abs_install_dir = os.path.join(prefix, install_dir)