Write generator deps to Ninja files properly. Now can compile 1300+ files of QtCreator without dependency problems.

pull/15/head
Jussi Pakkanen 11 years ago
parent 1d36109002
commit f23a5a1150
  1. 9
      backends.py
  2. 6
      ninjabackend.py
  3. 4
      test cases/frameworks/4 qt5/meson.build

@ -220,7 +220,12 @@ class Backend():
if is_unity:
unity_src.append(src)
else:
obj_list.append(self.generate_single_compile(target, outfile, src, True))
# Generated targets are ordered deps because the must exist
# before the sources compiling them are used. After the first
# compile we get precise dependency info from dep files.
# This should work in all cases. If it does not, then just
# move them from orderdeps to proper deps.
obj_list.append(self.generate_single_compile(target, outfile, src, True, [], header_deps))
for src in target.get_sources():
if not self.environment.is_header(src):
src_list.append(src)
@ -229,7 +234,7 @@ class Backend():
target.get_subdir(), src)
unity_src.append(abs_src)
else:
obj_list.append(self.generate_single_compile(target, outfile, src, False, header_deps))
obj_list.append(self.generate_single_compile(target, outfile, src, False, [], header_deps))
obj_list += self.flatten_object_list(target)
if is_unity:
for src in self.generate_unity_files(target, unity_src):

@ -594,7 +594,7 @@ class NinjaBackend(backends.Backend):
elem.add_item('COMMAND', cmdlist)
elem.write(outfile)
def generate_single_compile(self, target, outfile, src, is_generated=False, header_deps=[]):
def generate_single_compile(self, target, outfile, src, is_generated=False, header_deps=[], order_deps=[]):
compiler = self.get_compiler_for_source(src)
commands = self.generate_basic_compiler_flags(target, compiler)
commands.append(compiler.get_include_arg(self.get_target_private_dir(target)))
@ -645,6 +645,10 @@ class NinjaBackend(backends.Backend):
if not '/' in d:
d = os.path.join(self.get_target_private_dir(target), d)
element.add_dep(d)
for d in order_deps:
if not '/' in d:
d = os.path.join(self.get_target_private_dir(target), d)
element.add_orderdep(d)
element.add_orderdep(pch_dep)
element.add_item('DEPFILE', dep_file)
element.add_item('FLAGS', commands)

@ -4,8 +4,8 @@ qt5dep = dependency('qt5', modules : 'Widgets')
q5exe = executable('qt5app',
sources : ['main.cpp', 'mainWindow.cpp'], # Sources that don't need preprocessing.
moc_headers : ['mainWindow.h'], # These need to be fed through the moc tool before use.
ui_files : 'mainWindow.ui', # XML files that need to be compiled with the uic tol.
moc_headers : ['mainWindow.h'], # These need to be fed through the moc tool before use.
ui_files : 'mainWindow.ui', # XML files that need to be compiled with the uic tol.
qresources : ['stuff.qrc', 'stuff2.qrc'], # Resource files for rcc compiler.
deps : qt5dep)

Loading…
Cancel
Save