(no title)
bjkchoy | 1 year ago
He also describes the dynamic discovery of header dependencies of Ninja as a hack. It is true that it is a special case to handle a specific type of dynamic dependencies. But the basic idea behind it (using the compiler's diagnostic as the source of truth) is sane and efficient. The alternative is to scan the sources using a custom parser, which is slower and more fragile.
jason_s|1 year ago
More fragile, yes, but I dispute the "slower" aspect. waf does this very well. In C you don't need to parse the entire program structure, you just need to parse what the preprocessor does.
Also there's a difference between the complete set of header dependencies (notably #include statements within an #if or #ifdef) and a more sane but incomplete methodology for #include statements (don't do it within #if/#ifdef). Not sure whether this is a big enough difference to try to matter.
gavinhoward|1 year ago