I started looking at the https://github.com/vegastrike/Vega-Strike-Engine-Source/blob/master/engine/CMakeLists.txt in part to add a C++ Linter and test it out. I did manage to get something, but it might have changed compilers on me since it was clang-tidy. Any how... I started looking at the file itself. There's a lot of cleanup that can be done to it and make it less work to maintain. For example:
FILE(GLOB LIB_NET_LOW_LEVEL_FILES
RELATIVE_PATH src/networking/lowlevel
*.cpp
)
ADD_LIBRARY(netlowlevel ${LIB_NET_LOW_LEVEL_FILES})
will do what https://github.com/vegastrike/Vega-Strike-Engine-Source/blob/master/engine/CMakeLists.txt#L51 through https://github.com/vegastrike/Vega-Strike-Engine-Source/blob/master/engine/CMakeLists.txt#L77 does and not require manual edits every time a new C++ file is added.
The problem, however, is that are several different targets pull files from that directory.
At a minimum, we should move the files around so that we can easily glob them like the above.
It would be good also if files were moved around based on sub-targets too.
Thoughts?
I'm going to also suggest too that we change up the location of CMakeFiles.txt so that it's at the base or the tree; we can layer them in sub-directories as needed. This will clean up the structure and bring things to standard more.
I'll take on the restructure if you all want to do it. If not; I'll leave things long.
One goal here would be to enable making different compiler targets and even tooling too.
Given the fact that a lot of the code is about the multiplayer and server, I would strongly urge that any major refactoring and restructuring begins with a complete removal of these components. I've done this (and broke something) in my repo (https://github.com/royfalk/vegastrike-code). The result would be a much smaller code base without any impact on game play.
A followup issue can remove warnings of unused code and variables.
Of course, this is something I expect someone to do after a unanimous decision only.
@BenjamenMeyer Restructuring the src directory structure, is what you are talking about? I'd be on board with that. Like @royfalk said, though, first things first.
One thing I did try, here, was including only specific files in the CMakeLists.txt, rather than an entire directory at a time. Very much a WIP: https://github.com/stephengtuggy/Vega-Strike-Engine-Source/tree/refac/cmake-on-windows
Most helpful comment
Given the fact that a lot of the code is about the multiplayer and server, I would strongly urge that any major refactoring and restructuring begins with a complete removal of these components. I've done this (and broke something) in my repo (https://github.com/royfalk/vegastrike-code). The result would be a much smaller code base without any impact on game play.
A followup issue can remove warnings of unused code and variables.
Of course, this is something I expect someone to do after a unanimous decision only.