-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Feature/attach to gmf #3387
Feature/attach to gmf #3387
Conversation
This overlaps with #3386. Did you mean to include only the first commit in this PR? |
I pushed only the second as a PR from the Github UI. I.e. the changes to |
Please rebase. |
d4dcf38
to
56d0049
Compare
Done. |
Please provide some details why this change is needed. |
If you build {fmt} as a module, you're basically compiling it as a static library that happens to export its interface in a binary form called BMI. All declarations and definitions are attached to to the module, all signatures and symbols carry an additional part that says so. In msvc this is a suffix Suppose you have a program in transition: parts are using {fmt} in module form, the rest is still using it through #includes. This means you have one set of declarations and symbols (all of them!) attached to the module, and another, additional set (brought in by the #includes) attached to the so-called global module. Both can coexist in the same program because their signatures and symbols are different. But you pay for all those duplications. If you define macro |
I have this feature in my Asio module to support exactly this kind of scenario. |
Makes sense, thanks for the explanation. Please add a short comment clarifying this before the |
src/fmt.cc
Outdated
// All library-provided declarations and definitions must be in the module | ||
// purview to be exported. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this comment applies to FMT_ATTACH_TO_GLOBAL_MODULE
which is not right. Should it be moved some place else?
…dule fmt` This allows coexistence with TUs that use {fmt} through #include without duplicating declarations, definitions, linker symbols, and object code.
56d0049
to
17ce9f7
Compare
Merged, thanks! |
No description provided.