FiniteReality / Finite.Cpp.Sdk

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

ProjectReference support #5

Open FiniteReality opened 4 years ago

FiniteReality commented 4 years ago

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 commented 4 years ago

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 commented 3 years ago

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

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

FiniteReality commented 3 years ago

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.