aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2022-02-28 16:01:11 -0800
committerDylan Baker <dylan@pnwbakers.com>2022-03-03 10:29:14 -0800
commit3e90f277032d8ce91d99ed1fe62567701ce62622 (patch)
tree9358c2411405549a0e9eb075ae2023edf616da4a /mesonbuild/modules
parentb07d4bb2068f90bfbb0aa6e6ea91412db29388ea (diff)
downloadmeson-3e90f277032d8ce91d99ed1fe62567701ce62622.zip
meson-3e90f277032d8ce91d99ed1fe62567701ce62622.tar.gz
meson-3e90f277032d8ce91d99ed1fe62567701ce62622.tar.bz2
interpreter: replace build_def_files with OrderedSet
We do a bunch of backbending to make sure we don't have duplicates, let's just use the right datastructure to begin with.
Diffstat (limited to 'mesonbuild/modules')
-rw-r--r--mesonbuild/modules/cmake.py3
-rw-r--r--mesonbuild/modules/keyval.py4
2 files changed, 3 insertions, 4 deletions
diff --git a/mesonbuild/modules/cmake.py b/mesonbuild/modules/cmake.py
index 0f54d30..a263e52 100644
--- a/mesonbuild/modules/cmake.py
+++ b/mesonbuild/modules/cmake.py
@@ -403,8 +403,7 @@ class CmakeModule(ExtensionModule):
conf.used = True
conffile = os.path.normpath(inputfile.relative_name())
- if conffile not in self.interpreter.build_def_files:
- self.interpreter.build_def_files.append(conffile)
+ self.interpreter.build_def_files.add(conffile)
res = build.Data([mesonlib.File(True, ofile_path, ofile_fname)], install_dir, install_dir, None, state.subproject)
self.interpreter.build.data.append(res)
diff --git a/mesonbuild/modules/keyval.py b/mesonbuild/modules/keyval.py
index 7cebc91..36daea8 100644
--- a/mesonbuild/modules/keyval.py
+++ b/mesonbuild/modules/keyval.py
@@ -63,8 +63,8 @@ class KeyvalModule(ExtensionModule):
else:
s = os.path.join(self.interpreter.environment.source_dir, s)
- if s not in self.interpreter.build_def_files and not is_built:
- self.interpreter.build_def_files.append(s)
+ if not is_built:
+ self.interpreter.build_def_files.add(s)
return self._load_file(s)