-
Notifications
You must be signed in to change notification settings - Fork 264
Fix bug where CppWinRT would drop static library references. #506
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
Conversation
|
/azp run |
|
No pipelines are associated with this pull request. |
47fa94e to
f6c19de
Compare
|
/azp run |
|
No pipelines are associated with this pull request. |
… test for the scenario.
f6c19de to
fb3be54
Compare
|
/azp run |
|
No pipelines are associated with this pull request. |
ChrisGuzak
left a comment
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.
thank you for taking on this work
| and then remove them. --> | ||
| <Target Name="CppWinRTRemoveStaticLibraries" | ||
| DependsOnTargets="GetCppWinRTProjectWinMDReferences" | ||
| <!-- Static library reference WinMDs are merged into the project WinMD that |
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.
referenced
| references it and might have the same name because they often share namespace. | ||
| Therefore they shouldn't be copied to the output folder | ||
| because they might override files in the output folder with the | ||
| same name, causing missing types. --> |
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.
consider "missing types when linking"
A WinMD file produced by a static library gets merged into the WinMD of the Dll project consuming the library. Because they often share a root namespace, the files might have the same name and they can overwrite each other in the output folder.
The way this was fixed is to simply remove the static lib from the list of project references. However this causes issues for the case where a CX dll project references a C++/WinRT static library as it doesn't see the reference. A better fix is to mark the reference as private so it won't be copied to the output directory of the Dll project.
TODO:
Fixes #504