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:
Note that I am not doing this for ksp_plugin. That one is special, we'll see what we want to do.
Benefits:
No more pollution of the Source Files filter with files that live elsewhere.
No need to import third_party_zfp.props in every project, that's done once in shared\base.vcxproj.
Less maintenance of the dependencies: if a new .cpp file gets exported from numerics, it just need to be added to shared\numerics.vcxproj and (possibly) a reference added to the client projects (in practice pretty much everyone pulls numerics already).
Clearer picture of the dependencies through the units exported by each shared project and the References imported by each project.
Drawbacks:
Possibly longer compilation times: if a project previously imported cbrt.cpp but not the elliptic functions, it will now import everything.
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 atshared\numerics.vcxproj
. The shared project containscbrt.cpp
(which still lives atnumerics\cbrt.cpp
) and is referenced by all the projects which needcbrt.cpp
(or any other.cpp
file fromnumerics
). In the Visual Studio Solution Explorer shared projects are located in a virtual folder and things look like this:Note that I am not doing this for
ksp_plugin
. That one is special, we'll see what we want to do.Benefits:
Source Files
filter with files that live elsewhere.third_party_zfp.props
in every project, that's done once inshared\base.vcxproj
..cpp
file gets exported fromnumerics
, it just need to be added toshared\numerics.vcxproj
and (possibly) a reference added to the client projects (in practice pretty much everyone pullsnumerics
already).Drawbacks:
cbrt.cpp
but not the elliptic functions, it will now import everything.