ninjabackend: Use order-only gen-header deps for gen-sources

We do not need to *always* rebuild generated sources when a generated
header changes. We will get that information from the compiler's
dependency file, and ninja will track it for us. This is exactly the
same as static sources.

However, we do need an order-only dependency on all generated headers,
because we cannot know what headers will be needed at compile time
(which is when the compiler's dependency file is generated).

This fixes spurious rebuilds and relinking in many cases.
This commit is contained in:
Nirbheek Chauhan 2020-05-13 16:19:33 +05:30 committed by Nirbheek Chauhan
parent cd3e65a790
commit a25f0741e8
1 changed files with 1 additions and 1 deletions

View File

@ -585,7 +585,7 @@ int dummy;
o = self.generate_llvm_ir_compile(target, src)
else:
o = self.generate_single_compile(target, src, True,
header_deps=header_deps)
order_deps=header_deps)
obj_list.append(o)
use_pch = self.environment.coredata.base_options.get('b_pch', False)