Skip to content
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

Fix missing targets file issue in some C++ nuget packages #2025

Merged
merged 1 commit into from
Apr 12, 2023

Conversation

hanagasira
Copy link
Contributor

@hanagasira hanagasira commented Jan 22, 2023

What does this PR do?

Projects using the C++ nuget package import the targets file packages\\{package_id}.{version}\\build\\native\\{package_id}.targets is imported,
but there are some packages that have .targets files in other locations or need to import .props files other than .targets.

Example.

The targets file for the WinPixEventRuntime package targets file exists in
packages\WinPixEventRuntime.1.0.220810001\build\WinPixEventRuntime.targets. not
packages\WinPixEventRuntime.1.0.220810001\build\native\WinPixEventRuntime.targets.

Microsoft.Direct3D.D3D12 package needs to import
packages\Microsoft.Direct3D.D3D12.1.608.2\build\native\Microsoft.Direct3D.D3D12.props file as well as
packages\Microsoft.Direct3D.D3D12.1.608.2\build\native\Microsoft.Direct3D.D3D12.targets file.

How does this PR change Premake's behavior?

  • Create packageAPIInfo.packageEntries variable for package nuget even when it is not a C# project
  • In a project using the nuget package, look for .props and .targets files in the packageAPIInfo.packageEntries variable and import them.

Anything else we should know?

May slow down project generation to search for targets and props files.

Closes #1497

Did you check all the boxes?

  • Focus on a single fix or feature; remove any unrelated formatting or code changes
  • Add unit tests showing fix or feature works; all tests pass
  • Mention any related issues (put closes #XXXX in comment to auto-close issue when PR is merged)
  • Follow our coding conventions
  • Minimize the number of commits
  • Align documentation to your changes

You can now support Premake on our OpenCollective. Your contributions help us spend more time responding to requests like these!

@nickclark2016
Copy link
Member

Does this work with C# nuget packages still?

@hanagasira
Copy link
Contributor Author

Yes, I have confirmed that I can build my project using the nuget package in C#

@GloriousPtr
Copy link

Thanks for this, works like charm, no wonky workarounds with PIX and Agility sdk copying files at wrong locations.
Hope to see it merge soon.

GloriousPtr added a commit to GloriousPtr/ArcGameEngine that referenced this pull request Apr 2, 2023
@samsinsane samsinsane merged commit d150691 into premake:master Apr 12, 2023
@hanagasira hanagasira deleted the nuget_refactor branch April 13, 2023 12:44
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.

NuGet target file missing
4 participants