Finite.Cpp.Sdk icon indicating copy to clipboard operation
Finite.Cpp.Sdk copied to clipboard

ProjectReference support

Open FiniteReality opened this issue 5 years ago • 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.

FiniteReality avatar Feb 18 '20 21:02 FiniteReality

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 :stuck_out_tongue:

FiniteReality avatar Aug 25 '20 09:08 FiniteReality

@(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.

FiniteReality avatar Feb 12 '21 07:02 FiniteReality

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.

FiniteReality avatar Mar 08 '21 18:03 FiniteReality