Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 15 commits into from
Nov 18, 2023

Conversation

pleroy
Copy link
Member

@pleroy pleroy commented Nov 5, 2023

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:

  • 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.

@eggrobin eggrobin added the LGTM label Nov 18, 2023
@pleroy pleroy merged commit 12b0cf3 into mockingbirdnest:master Nov 18, 2023
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants