diff options
-rw-r--r-- | backends.py | 6 | ||||
-rw-r--r-- | build.py | 1 | ||||
-rw-r--r-- | interpreter.py | 3 |
3 files changed, 8 insertions, 2 deletions
diff --git a/backends.py b/backends.py index 2474ed4..2c8810e 100644 --- a/backends.py +++ b/backends.py @@ -13,7 +13,7 @@ # limitations under the License. import os, sys, re, pickle -import interpreter, nodes +import nodes import environment, mlog from meson_install import InstallData from build import InvalidArguments @@ -1023,6 +1023,10 @@ class NinjaBackend(Backend): deps.append('meson-private/coredata.dat') if os.path.exists(os.path.join(self.environment.get_source_dir(), 'meson_options.txt')): deps.append(os.path.join(self.build_to_src, 'meson_options.txt')) + for sp in self.build.subprojects.keys(): + fname = os.path.join(self.environment.get_source_dir(), sp, 'meson_options.txt') + if os.path.isfile(fname): + deps.append(os.path.join(self.build_to_src, sp, 'meson_options.txt')) elem = NinjaBuildElement('build.ninja', 'REGENERATE_BUILD', deps) elem.write(outfile) @@ -40,6 +40,7 @@ class Build: self.static_cross_linker = None self.configure_files = [] self.pot = [] + self.subprojects = {} def add_compiler(self, compiler): if len(self.compilers) == 0: diff --git a/interpreter.py b/interpreter.py index b32e47a..e5348ec 100644 --- a/interpreter.py +++ b/interpreter.py @@ -740,7 +740,7 @@ class Interpreter(): raise InterpreterException('Subprojects must be defined at the root directory.') if self.subproject != '': raise InterpreterException('Subprojects of subprojects are not yet supported.') - if dirname in self.subprojects: + if dirname in self.build.subprojects: raise InterpreterException('Tried to add the same subproject twice.') subdir = os.path.join(self.subproject, self.subdir, dirname) abs_subdir = os.path.join(self.build.environment.get_source_dir(), subdir) @@ -751,6 +751,7 @@ class Interpreter(): subi = Interpreter(self.build, subdir) subi.run() mlog.log('\nSubproject finished.\n') + self.build.subprojects[dirname] = True self.subprojects[dirname] = SubprojectHolder(subi) return self.subprojects[dirname] |