diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2013-02-08 22:51:19 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2013-02-08 22:51:19 +0200 |
commit | e2bc8517351b02da10c16a5a75448b146580eb5f (patch) | |
tree | 19a9a32a404493120780dcfa412fbe6b6cfecf85 | |
parent | ee34bd688cf4911bcdca922e5a0c522dc1b4fdc5 (diff) | |
download | meson-e2bc8517351b02da10c16a5a75448b146580eb5f.zip meson-e2bc8517351b02da10c16a5a75448b146580eb5f.tar.gz meson-e2bc8517351b02da10c16a5a75448b146580eb5f.tar.bz2 |
Added target dependency info.
-rwxr-xr-x | generators.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/generators.py b/generators.py index ce381f9..97b9541 100755 --- a/generators.py +++ b/generators.py @@ -268,7 +268,7 @@ class NinjaGenerator(Generator): for compiler in self.build.compilers: langname = compiler.get_language() 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_output_flags())) description = ' description = Linking target $out' @@ -337,9 +337,15 @@ class NinjaGenerator(Generator): raise RuntimeError('Unknown build target type.') for dep in target.get_external_deps(): commands += dep.get_link_flags() - commands += self.build_target_link_arguments(target.get_dependencies()) - build = 'build %s: %s %s\n' % \ - (ninja_quote(outname), linker_rule, ' '.join([ninja_quote(i) for i in obj_list])) + dependencies = target.get_dependencies() + commands += self.build_target_link_arguments(dependencies) + 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]) outfile.write(build) outfile.write(flags) |