FiniteReality / Finite.Cpp.Sdk

(Work in Progress) C/C++ compilation support for .NET Core projects
Other
23 stars 2 forks source link

Two way C# <-> C/C++ bindings #8

Open FiniteReality opened 3 years ago

FiniteReality commented 3 years ago

Two-way bindings without much hassle should be possible, eventually. I think this will likely take the form of a separate package reference to extend the build based on which SDK is being used.

For sharing types between managed and unmanaged, there are multiple routes that would likely need to be taken:

Some examples of the desired XML:

<Project Sdk="Finite.Cpp.Sdk">
  <ItemGroup>
    <PackageReference Include="Finite.Cpp.Sdk.DotNetExports" />
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="path/to/project.csproj" GenerateExports="true" />
  </ItemGroup>
</Project>
<Project Sdk="Microsoft.NET.Sdk">
  <ItemGroup>
    <PackageReference Include="Finite.Cpp.Sdk.NativeExports" />
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="path/to/project.cxxproj" GenerateExports="true" />
  </ItemGroup>
</Project>