microsoft / angle

ANGLE: OpenGL ES to DirectX translation
Other
615 stars 166 forks source link

NuGet package does not work with project.json and UWP .vcxproj #107

Closed bbowman closed 5 years ago

bbowman commented 7 years ago

When using ANGLE nuget package in a UWP .vcxproj I have the following project.json:

{
  "dependencies": {
    "ANGLE.WindowsStore": "2.1.13"
  },
  "frameworks": {
    "uap10.0": {
      "imports": [
        "native"
      ]
    }
  },
  "runtimes": {
    "win10-arm": {},
    "win10-x86": {},
    "win10-arm-aot": {},
    "win10-x86-aot": {}
  }
}

unfortunately the frameworks section there causes nuget to import the UAP targets which appears that assume are only C# consumers (the Content item group doesn't get added to link automatically). switching the framework to native causes nuget to complain that the project has the wrong framework since the TargetFrameworkIdentifier is still UAP for the project ...

austinkinross commented 7 years ago

Hey Brian, are you trying to add ANGLE to a C# project? Are you able to send a standalone repro to me?

We've only really used ANGLE via the NuGet v2-style "packages.config" files. "project.json" was added as part of NuGet v3 in 2015, and initially it didn't really support C++/native NuGet packages like ANGLE. I'm not sure if NuGet v3's C++ support has improved since then, though.

Thanks!

bbowman commented 7 years ago

@austinkinross no not a C# app. As mentioned above I am adding to a .vcxproj this would be a C++ project. Its perfectly possible to add a project.json to a .vcxproj and in fact for VS2017 they are moving to use a PackageReference ItemGroup in MSBuild. You can look at their work at https://github.com/NuGet/Home.

The problem is simply that you are incorrectly assuming build\uap\ANGLE.WindowsStore.targets is only applicable to C# projects when it is used by both C# and C++ in a UWP project with a project.json file.

The native platform identifier is more geared toward Win32 desktop apps as far as I can tell so supporting C++ and C# UAP would make the most sense.

The standalone repro should be trivial for you to set up. Create a c++ UWP project and add a project.json file to it with the above contents. When running restore you should see that it is very sad. Attached is an example project that should show the issue.

App10.zip

bbowman commented 7 years ago

@austinkinross any updates here? Also @memontic-ms for fyi

austinkinross commented 7 years ago

Hey Brian, sorry no updates. We haven't had a chance to look at this yet.

Are you still able to work around this issue (albeit not very nicely)?

JimSEOW commented 7 years ago

@austinkinross We are using the latest ANGLE.WINDOWSTORE For c#, please take a look and comment/feedback.

austinkinross commented 5 years ago

Hi there, apologies but we have no plans to update the ANGLE NuGet package in the future so I'm closing this issue.

Please consider building ANGLE directly out of the main ANGLE repository instead: https://groups.google.com/forum/#!forum/angleproject