SFTtech / openage

Free (as in freedom) open source clone of the Age of Empires II engine 🚀
http://openage.dev
Other
12.73k stars 1.12k forks source link

Increase verbosity of buildsystem documentation #1244

Open simonsan opened 4 years ago

simonsan commented 4 years ago

As I'm finding my way around the buildsystem in the last weeks I feel that we could add some more information to the documentation. Some first thoughts (more added later):

I think we should create an own folder doc/buildsystem and explain the different parts in detail. For example, how the find_package-System works, where to find the modules. How to add a new one or how to refactor a module. Maybe even some basic call/caller-graphs[1] to find the way more easy or to see where optimisation could be needed. I think that could be a long-term profit for everyone. For new people coming in to understand it and for people using it every day to find their way around faster.

In addition to that, as we will probably need it more often, we should document processes like how to create a new Makefile-target and how to deal within CMake with these. What to do, if you want to add a new feature within openage and/or libopenage. How is the buildsystem involved with the c++/python interface etc.

Our documentation for the buildsystem is here right now: https://github.com/SFTtech/openage/blob/master/doc/buildsystem.md

Here is explained how a make target for a dependency-graph could look like. While the repository here has the DependencyGraph.cmake (and some other cool tooling).

[1]: cmake <PATH_TO_SOURCES> --graphviz=graph/test.dot https://cmake.org/cmake/help/latest/module/CMakeGraphVizOptions.html

Graphviz example:

Project to visualize cpp dependencies https://github.com/tomtom-international/cpp-dependencies#using-cpp-dependencies-to-make-visualized-graphs

simonsan commented 4 years ago

cmake .. --graphviz=out.dot dot -Tpng out.dot -o out.png

Looks currently like this :-P

out

simonsan commented 4 years ago

Not the buildsystem, but c++ dependencies visualized as well:

cpp-dependencies.exe -dir libopenage --recursive --graph dependencies.dot dot -Tpng dependencies.dot > dependencies.png

dependencies