aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/interpreter.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2021-03-02 21:49:23 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2021-03-06 13:11:20 +0200
commitfcbab5948c364b2be9ba0d23f0c1ed9523adc9bb (patch)
treec0964855e0d9c984774d1bafb71c79d4c87c12b9 /mesonbuild/interpreter.py
parent85796229c29898588cc1e0a80e31485e358289d5 (diff)
downloadmeson-fcbab5948c364b2be9ba0d23f0c1ed9523adc9bb.zip
meson-fcbab5948c364b2be9ba0d23f0c1ed9523adc9bb.tar.gz
meson-fcbab5948c364b2be9ba0d23f0c1ed9523adc9bb.tar.bz2
Refactor subdir visitation to track files instead of dirs.
Diffstat (limited to 'mesonbuild/interpreter.py')
-rw-r--r--mesonbuild/interpreter.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py
index c8cf078..68744ef 100644
--- a/mesonbuild/interpreter.py
+++ b/mesonbuild/interpreter.py
@@ -2380,7 +2380,7 @@ class Interpreter(InterpreterBase):
self.sanity_check_ast()
self.builtin.update({'meson': MesonMain(build, self)})
self.generators = []
- self.visited_subdirs = {}
+ self.processed_buildfiles = set() # type: T.Set[str]
self.project_args_frozen = False
self.global_args_frozen = False # implies self.project_args_frozen
self.subprojects = {}
@@ -4212,10 +4212,11 @@ This will become a hard error in the future.''' % kwargs['input'], location=self
raise InvalidArguments('Subdir argument must be a relative path.')
absdir = os.path.join(self.environment.get_source_dir(), subdir)
symlinkless_dir = os.path.realpath(absdir)
- if symlinkless_dir in self.visited_subdirs:
+ build_file = os.path.join(symlinkless_dir, 'meson.build')
+ if build_file in self.processed_buildfiles:
raise InvalidArguments('Tried to enter directory "%s", which has already been visited.'
% subdir)
- self.visited_subdirs[symlinkless_dir] = True
+ self.processed_buildfiles.add(build_file)
self.subdir = subdir
os.makedirs(os.path.join(self.environment.build_dir, subdir), exist_ok=True)
buildfilename = os.path.join(self.subdir, environment.build_filename)