aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2013-12-09 20:39:53 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2013-12-09 20:39:53 +0200
commite21e7091e73694ded98d8230604f264b11fcba47 (patch)
tree8a328630ba9805e0d53c5a3536f28b4dfba4b887
parent11c812769af05126732d65bf6bf6da97afd42b1c (diff)
downloadmeson-e21e7091e73694ded98d8230604f264b11fcba47.zip
meson-e21e7091e73694ded98d8230604f264b11fcba47.tar.gz
meson-e21e7091e73694ded98d8230604f264b11fcba47.tar.bz2
Track dependencies of subproject option files.
-rw-r--r--backends.py6
-rw-r--r--build.py1
-rw-r--r--interpreter.py3
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)
diff --git a/build.py b/build.py
index d4a033d..67be9f4 100644
--- a/build.py
+++ b/build.py
@@ -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]