Track dependencies of subproject option files.

pull/15/head
Jussi Pakkanen 11 years ago
parent 11c812769a
commit e21e7091e7
  1. 6
      backends.py
  2. 1
      build.py
  3. 3
      interpreter.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:

@ -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]

Loading…
Cancel
Save