FiniteReality/Finite.Cpp.Sdk

ProjectReference support

FiniteReality opened this issue · 3 comments

This is an absolute must because it makes MSBuild in .NET Core so much nicer to work with.

https://github.com/microsoft/msbuild/blob/master/documentation/ProjectReference-Protocol.md

Assuming this is up to date, we could reference it while implementing ProjectReference support for our own projects. We should be careful to not trip up everything else though.

Looks like ProjectReference mostly just works in our case, at least for native<->native dependencies.

I likely still need to write my own reference resolver to augment ResolveAssemblyReferences, because the built-in one expects .NET assemblies, which, well, won't work with native libraries 😛

@(AdditionalIncludeDirectory) should be exposed to references so that a library which uses them can safely be used by dependents, e.g.:

  • MyApplication (include A)
    • MySubLibrary (Include B)
      • MySubSubLibrary (Include C)

MyApplication should have access to A, B and C, while MySubLibrary should have B and C.

So as it turns out, as long as you manually specify ReferenceOutputAssembly="false", OutputItemType="None" and CopyToOutputDirectory="PreserveNewest", .NET applications can reference native libraries (and probably applications too) just fine. Neat.