When including dependent modules recursively including subdirectories
led to very deep build trees.
This is not very pretty, and can lead to compile issues on windows,
where the effective length of paths appears to be limited at 260
characters.
To fix this, this change applies a new algorithm for resolving
dependencies, which resolves dependencies in a two-step manner,
flattening the build tree.
We can do this because the clang linker does not require topological
order for build artifacts, and we use the --[start|end]group flag for
the gcc linker, which forces symbol resolution to be a bit more lenient
about the order in which artifacts are presented to the linker.
When including dependent modules recursively including subdirectories led to very deep build trees.
This is not very pretty, and can lead to compile issues on windows, where the effective length of paths appears to be limited at 260 characters.
To fix this, this change applies a new algorithm for resolving dependencies, which resolves dependencies in a two-step manner, flattening the build tree.
We can do this because the clang linker does not require topological order for build artifacts, and we use the
--[start|end]group
flag for the gcc linker, which forces symbol resolution to be a bit more lenient about the order in which artifacts are presented to the linker.