How to create nuget package for native C++

前端 未结 2 746
攒了一身酷
攒了一身酷 2021-02-13 02:18

I want to publish package about sdl_mixer, it\'s a native package. I did as tutorial said. I put .dll .hand .lib files into pa

相关标签:
2条回答
  • 2021-02-13 03:03

    I searched around for days until I found there is really no help out there on the internet at all. I did managed to piece together how to do it, and through trial and error got it working well. Which I have documented here:

    https://digitalhouseblog.wordpress.com/2019/08/22/how-to-make-a-nuget-package-for-c/

    But I'll summarize here anyways:

    • Gather or stage your native library files into a folder of your choosing.
    • Create a *.nuspec file in that folder.
    • Edit the *.nuspec file to include the files you want to include in your package.
    • Create a *.props file
    • Call nuget pack to create the package.
    • Push the nuget package to a feed somewhere.
    • Create a packages.config file.
    • Edit the visual studio project file to import the *.props file

    Notice that the nuget tools inside the visual studio IDE are NEVER used. You have to do a LOT manually. See the link for full details and explanations.

    0 讨论(0)
  • 2021-02-13 03:12

    You can use CoApp PowerShell tools to create the Native Nuget packages easily.

    Creating Native Packages

    If you’re interested in publishing your native libraries via NuGet, you can choose to create the NuGet packages manually. However, there’s an easier way--the CoApp project volunteered to write C++ oriented tools to create NuGet packages, and they have released a beta version of their tools. These tools simplify the process of generating the MSBuild files and NuGet packages from existing header and library files--you just need to create a configuration script to describe the contents of the package and then run the tools to generate the NuGet package.

    Refer to this link for more detailed information: Support for Native Projects.

    0 讨论(0)
提交回复
热议问题