Skip to content

Add option to force project references export #220

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

ShawnCZek
Copy link
Contributor

Similarly to #219, I am working on sharing the precompiled header between multiple projects. To make this possible, the other projects must be exported as a reference. MSVC does otherwise not wait for the compilation to finish.

Right now, project references are not exported for static libraries. And while ExportAdditionalLibrariesEvenForStaticLib exists as a configuration option, it does more things at once, often resulting in already defined in X.lib(X.dll); second definition ignored warnings.

Therefore, this pull request adds an option to force the export of these references regardless of the output type of the project.

@jspelletier
Copy link
Collaborator

jspelletier commented Mar 22, 2023

Hi,
Sorry for the lack of updates. Lambert left Ubisoft and we had to rebuild a new maintainer group.

We will take a look at this MR soon.

@bchampoux
Copy link
Member

@jspelletier is this related to #146? it's the same config option

@jspelletier jspelletier changed the base branch from dev to main April 6, 2023 12:54
@jspelletier
Copy link
Collaborator

@ShawnCZek could you add/modify some sample using this?

@ShawnCZek
Copy link
Contributor Author

@jspelletier I can take a look at trying to integrate this into existing samples. However, as pointed out earlier here, #253 basically collides with this PR. And if that one is merged, this can be closed.

@jspelletier
Copy link
Collaborator

@ShawnCZek The problem with #253 is it doesn't have an explicit option and will affect our existing generated files so it won't ever be merged in its current state,

@ShawnCZek
Copy link
Contributor Author

Perfect. Thank you for the answer! In the following days, I will take a look at modifying the existing samples to integrate this change. Once that is done, I will mention you here again.

ShawnCZek and others added 3 commits March 9, 2025 11:18
Disabling the project references forced export makes the solution fail to compile because of the shared precompiled header dependency.
@ShawnCZek
Copy link
Contributor Author

@jspelletier Sorry for the "slight" delay. I completely forgot about this issue and just noticed it when I was upgrading our version of Sharpmake. Anyway, I created a pretty robust example: 027386d

I copied our solution for using precompiled shared headers; this is useful for speeding up the build time when there are many projects (tens/hundreds) with many shared dependencies (Windows header file, external libraries, etc.). I am aware that this is a pretty niche use case, but it is the only sample where such an export is applicable, of which I can think of. The above mentioned C++20 modules might be a more appealing use case, but as I have never used them, coming up with a helpful sample is challenging for me.

Btw. I am not sure why the HelloClangCI sample is failing, but it does not seem to be connected to this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants