mockingbirdnest / Principia

𝑛-Body and Extended Body Gravitation for Kerbal Space Program
MIT License
774 stars 70 forks source link

Use Shared Items Projects to gather the .cpp files exported by each project #3796

Closed pleroy closed 1 year ago

pleroy commented 1 year ago

This PR attempts to alleviate the pain of having "cbrt.cpp in every project". It doesn't try to do anything with modularization so it's not a fix for #3323: it only move the shared .cpp files to shared project, not all the non-test files as intended by #3323.

For each project such as numerics that exports .cpp files for use by other projects, I am creating a shared project located at shared\numerics.vcxproj. The shared project contains cbrt.cpp (which still lives at numerics\cbrt.cpp) and is referenced by all the projects which need cbrt.cpp (or any other .cpp file from numerics). In the Visual Studio Solution Explorer shared projects are located in a virtual folder and things look like this:

solution

Note that I am not doing this for ksp_plugin. That one is special, we'll see what we want to do.

Benefits:

Drawbacks: