Skip to content

Commit

Permalink
Add SharpLSL.Native.win-x86, SharpLSL.Native.win-x64
Browse files Browse the repository at this point in the history
  • Loading branch information
myd7349 committed Jul 22, 2024
1 parent 0b8311e commit 603eb0f
Show file tree
Hide file tree
Showing 8 changed files with 214 additions and 26 deletions.
12 changes: 12 additions & 0 deletions SharpLSL.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharpLSL", "Source\SharpLSL
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharpLSL.Test", "Tests\SharpLSL.Test\SharpLSL.Test.csproj", "{3B7B2CE6-36CE-4CD5-BF7B-B9C5AACF47F5}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharpLSL.Native.win-x86", "Source\SharpLSL.Native\SharpLSL.Native.win-x86.csproj", "{90129B6E-A393-4E10-BE70-9F083DA1FEE3}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharpLSL.Native.win-x64", "Source\SharpLSL.Native\SharpLSL.Native.win-x64.csproj", "{CA51C9A5-AE7A-4A1C-968B-6C82E2E7AE7F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -21,6 +25,14 @@ Global
{3B7B2CE6-36CE-4CD5-BF7B-B9C5AACF47F5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3B7B2CE6-36CE-4CD5-BF7B-B9C5AACF47F5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3B7B2CE6-36CE-4CD5-BF7B-B9C5AACF47F5}.Release|Any CPU.Build.0 = Release|Any CPU
{90129B6E-A393-4E10-BE70-9F083DA1FEE3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{90129B6E-A393-4E10-BE70-9F083DA1FEE3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{90129B6E-A393-4E10-BE70-9F083DA1FEE3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{90129B6E-A393-4E10-BE70-9F083DA1FEE3}.Release|Any CPU.Build.0 = Release|Any CPU
{CA51C9A5-AE7A-4A1C-968B-6C82E2E7AE7F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CA51C9A5-AE7A-4A1C-968B-6C82E2E7AE7F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CA51C9A5-AE7A-4A1C-968B-6C82E2E7AE7F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CA51C9A5-AE7A-4A1C-968B-6C82E2E7AE7F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
54 changes: 54 additions & 0 deletions Source/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<Project>

<PropertyGroup Label="Build">
<AnalysisLevel>latest</AnalysisLevel>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>

<PropertyGroup Label="Source Link">
<!-- Optional: Declare that the Repository URL can be published to NuSpec -->
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<!-- Optional: Embed source files that are not tracked by the source control manager to the PDB -->
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<!-- Optional: Include PDB in the built .nupkg -->
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
</PropertyGroup>

<PropertyGroup Label="Package">
<LSLTagVersion>1.16.2</LSLTagVersion>
<PackageVersion>$(LSLTagVersion)</PackageVersion>
<Version>$(LSLTagVersion)</Version>
<Authors>myd7349</Authors>
<Company>myd7349</Company>
<Copyright>Copyright © myd7349. All rights Reserved</Copyright>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageProjectUrl>https://github.com/myd7349/SharpLSL</PackageProjectUrl>
<!--
<PackageIcon>Icon.png</PackageIcon>
-->
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageTags>labstreaminglayer;lsl;liblsl</PackageTags>
<RepositoryUrl>https://github.com/myd7349/SharpLSL.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageReleaseNotes>https://github.com/myd7349/SharpLSL/releases</PackageReleaseNotes>
</PropertyGroup>

<ItemGroup Label="Package References">
<PackageReference Include="GitVersion.MsBuild" Version="5.12.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
27 changes: 27 additions & 0 deletions Source/SharpLSL.Native/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<Project>

<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />

<PropertyGroup Label="Build">
<TargetFramework>net6.0</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
</PropertyGroup>

<PropertyGroup Label="Package">
<PackageLicenseFile>LICENSE</PackageLicenseFile>
</PropertyGroup>

<PropertyGroup>
<RidArch Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)' == 'Arm'">arm</RidArch>
<RidArch Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)' == 'Arm64'">arm64</RidArch>
<RidArch Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)' == 'X64'">x64</RidArch>
<RidArch Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)' == 'X86'">x86</RidArch>
</PropertyGroup>

<ItemGroup>
<None Include="./LICENSE" Pack="true" PackagePath="/" />
<None Include="./README.md" Pack="true" PackagePath="/" />
</ItemGroup>

</Project>
15 changes: 15 additions & 0 deletions Source/SharpLSL.Native/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Copyright (C) 2012 Christian A. Kothe

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

This software uses the following libraries:


pugixml (https://pugixml.org), MIT. pugixml is Copyright (C) 2006-2018 Arseny Kapoulkine.
Boost (https://boost.org), Boost Software License
Loguru (https://github.com/emilk/loguru), Public Domain
Catch2 (https://github.com/catchorg/Catch2), Boost Software License
19 changes: 19 additions & 0 deletions Source/SharpLSL.Native/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# SharpLSL Native Assets Packages

The following NuGet packages contain pre-compiled binaries of [liblsl](https://github.com/sccn/liblsl) for various platforms:

| Platform | NuGet Package<sup>1</sup> |
| ---------------------------------- | :----------------------------------------------------------: |
| **Windows 32-bit** | [![SharpLSL.Native.win-x86-badge]][SharpLSL.Native.win-x86-nuget] |
| **Windows 64-bit** | [![SharpLSL.Native.win-x64-badge]][SharpLSL.Native.win-x64-nuget] |

[SharpLSL.Native.win-x86-badge]: https://img.shields.io/nuget/v/SharpLSL.Native.win-x86.svg
[SharpLSL.Native.win-x86-nuget]: https://www.nuget.org/packages/SharpLSL.Native.win-x86
[SharpLSL.Native.win-x64-badge]: https://img.shields.io/nuget/v/SharpLSL.Native.win-x64.svg
[SharpLSL.Native.win-x64-nuget]: https://www.nuget.org/packages/SharpLSL.Native.win-x64

<sup>1</sup> The version number of these NuGet packages is in sync with liblsl' version number.

# License

These packages only bundle the dynamic libraries of [liblsl](https://github.com/sccn/liblsl), thus using the same licensing agreement as liblsl. Please refer to the [LICENSE](./LICENSE) file for more information.
43 changes: 43 additions & 0 deletions Source/SharpLSL.Native/SharpLSL.Native.win-x64.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<Project Sdk="Microsoft.NET.Sdk" InitialTargets="DownloadNativeAssets">

<PropertyGroup>
<RID>win-x64</RID>
<LSLAssetArchive>liblsl-$(LSLTagVersion)-Win_amd64.zip</LSLAssetArchive>
<LSLAssetFile>lsl.dll</LSLAssetFile>
<LSLAssetUrl>https://github.com/sccn/liblsl/releases/download/v$(LSLTagVersion)/$(LSLAssetArchive)</LSLAssetUrl>
</PropertyGroup>

<PropertyGroup>
<PackageId>SharpLSL.Native.$(RID)</PackageId>
<Description>liblsl native assets for $(RID).</Description>
</PropertyGroup>

<ItemGroup>
<None Include="$(BaseIntermediateOutputPath)bin/$(LSLAssetFile)"
Link="runtimes/$(RID)/native/$(LSLAssetFile)">
<Pack>true</Pack>
<PackagePath>runtimes/$(RID)/native</PackagePath>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

<ItemGroup Condition="$([MSBuild]::IsOsPlatform('Windows')) AND $(RidArch) == 'x64'">
<None Include="$(BaseIntermediateOutputPath)bin/$(LSLAssetFile)"
Link="%(Filename)%(Extension)"
CopyToOutputDirectory="PreserveNewest"
Condition="Exists('$(BaseIntermediateOutputPath)bin/$(LSLAssetFile)')" />
</ItemGroup>

<Target Name="DownloadNativeAssets" Condition="$(SkipLocalBuild) != true">
<DownloadFile SourceUrl="$(LSLAssetUrl)"
DestinationFolder="$(BaseIntermediateOutputPath)"
DestinationFileName="$(LSLAssetArchive)"
Condition="!Exists('$(BaseIntermediateOutputPath)$(LSLAssetArchive)')" />

<Unzip SourceFiles="$(BaseIntermediateOutputPath)$(LSLAssetArchive)"
DestinationFolder="$(BaseIntermediateOutputPath)"
OverwriteReadOnlyFiles="true"
Condition="!Exists('$(BaseIntermediateOutputPath)bin/$(LSLAssetFile)')" />
</Target>

</Project>
43 changes: 43 additions & 0 deletions Source/SharpLSL.Native/SharpLSL.Native.win-x86.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<Project Sdk="Microsoft.NET.Sdk" InitialTargets="DownloadNativeAssets">

<PropertyGroup>
<RID>win-x86</RID>
<LSLAssetArchive>liblsl-$(LSLTagVersion)-Win_i386.zip</LSLAssetArchive>
<LSLAssetFile>lsl.dll</LSLAssetFile>
<LSLAssetUrl>https://github.com/sccn/liblsl/releases/download/v$(LSLTagVersion)/$(LSLAssetArchive)</LSLAssetUrl>
</PropertyGroup>

<PropertyGroup>
<PackageId>SharpLSL.Native.$(RID)</PackageId>
<Description>liblsl native assets for $(RID).</Description>
</PropertyGroup>

<ItemGroup>
<None Include="$(BaseIntermediateOutputPath)bin/$(LSLAssetFile)"
Link="runtimes/$(RID)/native/$(LSLAssetFile)">
<Pack>true</Pack>
<PackagePath>runtimes/$(RID)/native</PackagePath>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

<ItemGroup Condition="$([MSBuild]::IsOsPlatform('Windows')) AND $(RidArch) == 'x86'">
<None Include="$(BaseIntermediateOutputPath)bin/$(LSLAssetFile)"
Link="%(Filename)%(Extension)"
CopyToOutputDirectory="PreserveNewest"
Condition="Exists('$(BaseIntermediateOutputPath)bin/$(LSLAssetFile)')" />
</ItemGroup>

<Target Name="DownloadNativeAssets" Condition="$(SkipLocalBuild) != true">
<DownloadFile SourceUrl="$(LSLAssetUrl)"
DestinationFolder="$(BaseIntermediateOutputPath)"
DestinationFileName="$(LSLAssetArchive)"
Condition="!Exists('$(BaseIntermediateOutputPath)$(LSLAssetArchive)')" />

<Unzip SourceFiles="$(BaseIntermediateOutputPath)$(LSLAssetArchive)"
DestinationFolder="$(BaseIntermediateOutputPath)"
OverwriteReadOnlyFiles="true"
Condition="!Exists('$(BaseIntermediateOutputPath)bin/$(LSLAssetFile)')" />
</Target>

</Project>
27 changes: 1 addition & 26 deletions Source/SharpLSL/SharpLSL.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,43 +7,18 @@
<Nullable>enable</Nullable>
-->
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<PackageId>SharpLSL</PackageId>
<PackageVersion>0.0.1</PackageVersion>
<Version>0.0.1</Version>
<Authors>myd7349</Authors>
<Description>SharpLSL is a cross-platform C# binding of Lab Streaming Layer.</Description>
<Copyright>© myd7349. All rights reserved.</Copyright>
<PackageProjectUrl>https://github.com/myd7349/SharpLSL</PackageProjectUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/myd7349/SharpLSL.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>labstreaminglayer;lsl;liblsl</PackageTags>
<PackageReleaseNotes></PackageReleaseNotes>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
</PropertyGroup>

<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>

<ItemGroup>
<None Include="../../README.md" Pack="true" PackagePath="/" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="GitVersion.MsBuild" Version="5.12.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>

</ItemGroup>
</Project>

0 comments on commit 603eb0f

Please sign in to comment.