Bindgen.NET
1.0.0
진행중인 작업
Nuget 패키지를 다운로드하십시오.
dotnet add package Bindgen.NET --version *-*Clangsharp 기본 종속성을 해결하려면 런타임 ID가 필요합니다. 프로젝트 파일은 다음과 같아야합니다.
< Project Sdk = " Microsoft.NET.Sdk " >
< PropertyGroup >
< OutputType >Exe</ OutputType >
< TargetFramework >net7.0</ TargetFramework >
<!-- This line is required -->
< RuntimeIdentifier Condition = " '$(RuntimeIdentifier)' == '' " >$(NETCoreSdkRuntimeIdentifier)</ RuntimeIdentifier >
</ PropertyGroup >
< ItemGroup >
< PackageReference Include = " Bindgen.NET " Version = " *-* " />
</ ItemGroup >
</ Project >바인딩 옵션을 구성하고 생성하십시오!
예:
using Bindgen . NET ;
BindingOptions exampleConfig = new ( )
{
Namespace = "ExampleNamespace" ,
Class = "ExampleClass" ,
DllImportPath = "libexample" ,
// Pass raw source code instead
// TreatInputFileAsRawSourceCode = true,
InputFile = "path/header.h" ,
OutputFile = "path/Header.cs" ,
IncludeDirectories = { "path/include" } ,
SystemIncludeDirectories = { "path/include" } ,
GenerateFunctionPointers = true ,
GenerateMacros = true ,
GenerateStructEqualityFunctions = true
} ;
string output = BindingGenerator . Generate ( exampleConfig ) ;실행 가능한 예는 여기에서 찾을 수 있습니다.
생성 된 바인딩의 기본 예는 여기에서 찾을 수 있습니다.
생성 된 바인딩의 실제 예는 여기에서 flecs.net Repo에서 볼 수 있습니다.