Skip to content

Conversation

@jlaanstra
Copy link
Contributor

@jlaanstra jlaanstra commented Oct 27, 2020

For Universal Windows templates the xaml build targets and C++ build targets add the platform WinMDs to the reference list. However this doesn't happen for desktop templates , because the TargetPlatformIdentifier is not set to UAP.

We have two options:

  • Set TargetPlatform to UAP
  • Explicitly add the references.

Since these are desktop templates, option 2 seems preferable.

A possibly even better solution would be the WinRT targets to add the references. However we would have to fight the default C++ build targets to have them stop automatically adding the references and that would be quite a bit of work and possibly break xaml.

Fixes #780

@jlaanstra jlaanstra requested a review from kennykerr October 27, 2020 00:27
@kennykerr
Copy link
Collaborator

Will this also fix #774 (comment)? cc @DHowett

@DHowett
Copy link
Member

DHowett commented Oct 27, 2020

We've been told by the VC project system folks in no uncertain terms that wildcards are explicitly disallowed in vcxprojs (outside of a Target that generates them!) and they'll go out of their way to break them. This solution may conflict with that.

@jlaanstra
Copy link
Contributor Author

jlaanstra commented Oct 27, 2020

I am personally not a fan of this solution either. Problem is that there is no good way to add them one by one explicitly as the folder location differs per version and the C++ targets don't add any WinMDs for non-UAP projects.

If C++/WinRT targets add a set of default WinMDs, they will conflict what the C++ targets add for UAP.
If C++/WinRT targets don't add a set of default WinMDs, desktop projects have no references.

@kennykerr
Copy link
Collaborator

The project system isn't exactly abounding in support for C++ developers. Much of this is making the best of some bad choices.

@jlaanstra
Copy link
Contributor Author

Let's hold off on merging this for now. I'm gonna add a target that adds the platform winmds and then have desktop templates opt-in. That's probably a better solution.

@jlaanstra
Copy link
Contributor Author

isn't exactly abounding in support for C++ developers. Much of this is making the best of some bad choices.

I'll try to find a good (or at least much better) choice here.

@jlaanstra
Copy link
Contributor Author

We've been told by the VC project system folks in no uncertain terms that wildcards are explicitly disallowed in vcxprojs (outside of a Target that generates them!) and they'll go out of their way to break them. This solution may conflict with that.

Thanks for calling this out @DHowett

@jlaanstra
Copy link
Contributor Author

Updated with a target that mimics what the xaml targets do, including keeping the support for the existing overrides. I don't think we have to document this as we already have CppWinRTOverrideSDKReferences.

Copy link
Collaborator

@kennykerr kennykerr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No generated code for console app

4 participants