-
Notifications
You must be signed in to change notification settings - Fork 2
Local Nuget package building
- CMake
>=3.8
- C compiler (supported: CLang, MSVC, GCC; however mainstream is CLang)
- dotnet (Supporting .Net Standard 1.1)
For now this commands should be executed with admin privileges, e.g. from the root project directory
cmake . -Bcmake-build-release -DCMAKE_BUILD_TYPE=Release
cmake --build cmake-build-release --config=Release
In the src/CpuFeaturesDotNet
directory should be created next structure:
runtimes/%{{rid}}/native/
(i.e. src/CpuFeaturesDotNet/runtimes/${{rid}}/native/
)
Each binary file should be placed respectively to it's Runtime Identifier
(rid
can be found at Microsoft documentation).
For example at the moment cpu_features.NET pipeline creates such files:
src/CpuFeaturesDotNet/runtimes/osx-x64/native/cpu_features_dotnet.x64.dylib
src/CpuFeaturesDotNet/runtimes/win-x64/native/cpu_features_dotnet.x64.dll
src/CpuFeaturesDotNet/runtimes/linux-x64/native/cpu_features_dotnet.x64.so
In src/CpuFeaturesDotNet/CpuFeaturesDotNet.csproj
should be placed configuration for each binary that is used.
⚠️ Be careful:cmake
generating overridescsproj
for local development with config for only current host OS & arch
<ItemGroup>
<Content Include="runtimes\win-x64\native\cpu_features_dotnet.x64.dll">
<PackagePath>runtimes\win-x64\native\cpu_features_dotnet.x64.dll</PackagePath>
<Pack>true</Pack>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
Just few commands in root project directory
dotnet build "src/CpuFeaturesDotNet/CpuFeaturesDotNet.csproj" -c Release
dotnet pack -c Release -o out
Your nuget package should be located in out
folder (or whatever folder you set in previous step).