tgfrerer / island

🌋🐎 Project Island is an experimental, hot-reloading Vulkan Renderer for Linux and Windows, written in C/C++.
MIT License
1.04k stars 42 forks source link

[cmake] flatten module inclusion hierarchy #43

Closed tgfrerer closed 2 years ago

tgfrerer commented 2 years ago

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.