Skip to content

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
csukuangfj committed May 3, 2023
1 parent 2f4b376 commit 3965594
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
project(sherpa-ncnn)

set(SHERPA_NCNN_VERSION "1.8.5")
set(SHERPA_NCNN_VERSION "1.8.6")

# Disable warning about
#
Expand Down
10 changes: 8 additions & 2 deletions sherpa-ncnn/csharp-api/sherpa-ncnn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,11 @@ public class OnlineRecognizer : IDisposable {

private HandleRef _handle;

// private const string dllName = "sherpa-ncnn-c-api.dll";
#if LINUX
private const string dllName = "libsherpa-ncnn-c-api.so";
#else
private const string dllName = "sherpa-ncnn-c-api";
#endif

[DllImport(dllName, EntryPoint="CreateRecognizer")]
public static extern IntPtr CreateOnlineRecognizer(ref OnlineRecognizerConfig config);
Expand Down Expand Up @@ -167,8 +170,11 @@ public class OnlineStream : IDisposable {
private HandleRef _handle;
public IntPtr Handle => _handle.Handle;

// private const string dllName = "sherpa-ncnn-c-api.dll";
#if LINUX
private const string dllName = "libsherpa-ncnn-c-api.so";
#else
private const string dllName = "sherpa-ncnn-c-api";
#endif

[DllImport(dllName, EntryPoint="DestroyStream")]
public static extern void DestroyOnlineStream(IntPtr handle);
Expand Down
8 changes: 8 additions & 0 deletions sherpa-ncnn/csharp-api/sherpa-ncnn.csproj.in
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@
<DelaySign>false</DelaySign>
</PropertyGroup>

<PropertyGroup>
<IsLinux Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))' == 'true'">true</IsLinux>
</PropertyGroup>

<PropertyGroup Condition="'$(IsLinux)'=='true'">
<DefineConstants>Linux</DefineConstants>
</PropertyGroup>


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

0 comments on commit 3965594

Please sign in to comment.