Added target dependency info.
This commit is contained in:
parent
ee34bd688c
commit
e2bc851735
|
@ -268,7 +268,7 @@ class NinjaGenerator(Generator):
|
||||||
for compiler in self.build.compilers:
|
for compiler in self.build.compilers:
|
||||||
langname = compiler.get_language()
|
langname = compiler.get_language()
|
||||||
rule = 'rule %s_LINKER\n' % langname
|
rule = 'rule %s_LINKER\n' % langname
|
||||||
command = ' command = %s $FLAGS $LINK_FLAGS %s $out $in\n' % \
|
command = ' command = %s $FLAGS %s $out $in $LINK_FLAGS\n' % \
|
||||||
(' '.join(compiler.get_exelist()),\
|
(' '.join(compiler.get_exelist()),\
|
||||||
' '.join(compiler.get_output_flags()))
|
' '.join(compiler.get_output_flags()))
|
||||||
description = ' description = Linking target $out'
|
description = ' description = Linking target $out'
|
||||||
|
@ -337,9 +337,15 @@ class NinjaGenerator(Generator):
|
||||||
raise RuntimeError('Unknown build target type.')
|
raise RuntimeError('Unknown build target type.')
|
||||||
for dep in target.get_external_deps():
|
for dep in target.get_external_deps():
|
||||||
commands += dep.get_link_flags()
|
commands += dep.get_link_flags()
|
||||||
commands += self.build_target_link_arguments(target.get_dependencies())
|
dependencies = target.get_dependencies()
|
||||||
build = 'build %s: %s %s\n' % \
|
commands += self.build_target_link_arguments(dependencies)
|
||||||
(ninja_quote(outname), linker_rule, ' '.join([ninja_quote(i) for i in obj_list]))
|
if len(dependencies) == 0:
|
||||||
|
dep_targets = ''
|
||||||
|
else:
|
||||||
|
dep_targets = '| ' + ' '.join([self.get_target_filename(t) for t in dependencies])
|
||||||
|
build = 'build %s: %s %s %s\n' % \
|
||||||
|
(ninja_quote(outname), linker_rule, ' '.join([ninja_quote(i) for i in obj_list]),
|
||||||
|
dep_targets)
|
||||||
flags = ' LINK_FLAGS = %s\n\n' % ' '.join([ninja_quote(a) for a in commands])
|
flags = ' LINK_FLAGS = %s\n\n' % ' '.join([ninja_quote(a) for a in commands])
|
||||||
outfile.write(build)
|
outfile.write(build)
|
||||||
outfile.write(flags)
|
outfile.write(flags)
|
||||||
|
|
Loading…
Reference in New Issue