aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2021-12-06 15:27:45 -0800
committerEli Schwartz <eschwartz93@gmail.com>2022-01-18 17:53:29 -0500
commit5074e2d3b5837f64ef008b359e50765675c528ab (patch)
treeddea2131d2acc9e53c091add12a618ca8d7042fb /mesonbuild/modules
parent23af9e4c1a77072218bc3123bc1151b4845049d5 (diff)
downloadmeson-5074e2d3b5837f64ef008b359e50765675c528ab.zip
meson-5074e2d3b5837f64ef008b359e50765675c528ab.tar.gz
meson-5074e2d3b5837f64ef008b359e50765675c528ab.tar.bz2
interpreter: replace ConfigurationDataObject with ConfigurationDataHolder
This is much cleaner, and more in line with the way we handle interpreter objects in modern meson practice
Diffstat (limited to 'mesonbuild/modules')
-rw-r--r--mesonbuild/modules/cmake.py8
-rw-r--r--mesonbuild/modules/sourceset.py8
-rw-r--r--mesonbuild/modules/unstable_simd.py6
3 files changed, 13 insertions, 9 deletions
diff --git a/mesonbuild/modules/cmake.py b/mesonbuild/modules/cmake.py
index 0c61b47..0f325f5 100644
--- a/mesonbuild/modules/cmake.py
+++ b/mesonbuild/modules/cmake.py
@@ -20,7 +20,7 @@ from . import ExtensionModule, ModuleReturnValue, ModuleObject
from .. import build, mesonlib, mlog, dependencies
from ..cmake import SingleTargetOptions, TargetOptions, cmake_defines_to_args
-from ..interpreter import ConfigurationDataObject, SubprojectHolder
+from ..interpreter import SubprojectHolder
from ..interpreterbase import (
FeatureNew,
FeatureNewKwargs,
@@ -358,7 +358,7 @@ class CmakeModule(ExtensionModule):
if 'configuration' not in kwargs:
raise mesonlib.MesonException('"configuration" not specified.')
conf = kwargs['configuration']
- if not isinstance(conf, ConfigurationDataObject):
+ if not isinstance(conf, build.ConfigurationData):
raise mesonlib.MesonException('Argument "configuration" is not of type configuration_data')
prefix = state.environment.coredata.get_option(mesonlib.OptionKey('prefix'))
@@ -372,8 +372,8 @@ class CmakeModule(ExtensionModule):
extra = PACKAGE_INIT_EXT.replace('@absInstallDir@', abs_install_dir)
extra = extra.replace('@installPrefix@', prefix)
- self.create_package_file(ifile_abs, ofile_abs, PACKAGE_RELATIVE_PATH, extra, conf.conf_data)
- conf.mark_used()
+ self.create_package_file(ifile_abs, ofile_abs, PACKAGE_RELATIVE_PATH, extra, conf)
+ conf.used = True
conffile = os.path.normpath(inputfile.relative_name())
if conffile not in self.interpreter.build_def_files:
diff --git a/mesonbuild/modules/sourceset.py b/mesonbuild/modules/sourceset.py
index ba8b300..515e670 100644
--- a/mesonbuild/modules/sourceset.py
+++ b/mesonbuild/modules/sourceset.py
@@ -154,8 +154,12 @@ class SourceSet(MutableModuleObject):
def _get_from_config_data(key):
nonlocal config_cache
if key not in config_cache:
- args = [key] if strict else [key, False]
- config_cache[key] = config_data.get_method(args, {})
+ if key in config_data:
+ config_cache[key] = config_data.get(key)[0]
+ elif strict:
+ raise InvalidArguments(f'sourceset.apply: key "{key}" not in passed configuration, and strict set.')
+ else:
+ config_cache[key] = False
return config_cache[key]
files = self.collect(_get_from_config_data, False)
diff --git a/mesonbuild/modules/unstable_simd.py b/mesonbuild/modules/unstable_simd.py
index 3339cea..8715a14 100644
--- a/mesonbuild/modules/unstable_simd.py
+++ b/mesonbuild/modules/unstable_simd.py
@@ -13,6 +13,7 @@
# limitations under the License.
from .. import mesonlib, compilers, mlog
+from .. import build
from . import ExtensionModule
@@ -57,8 +58,7 @@ class SimdModule(ExtensionModule):
compiler = kwargs['compiler']
if not isinstance(compiler, compilers.compilers.Compiler):
raise mesonlib.MesonException('Compiler argument must be a compiler object.')
- cdata = self.interpreter.func_configuration_data(None, [], {})
- conf = cdata.conf_data
+ conf = build.ConfigurationData()
for iset in self.isets:
if iset not in kwargs:
continue
@@ -82,7 +82,7 @@ class SimdModule(ExtensionModule):
all_lang_args = old_lang_args + args
lib_kwargs[langarg_key] = all_lang_args
result.append(self.interpreter.func_static_lib(None, [libname], lib_kwargs))
- return [result, cdata]
+ return [result, conf]
def initialize(*args, **kwargs):
return SimdModule(*args, **kwargs)