Skip to content

CSharp: Fix regression in VS project type selection

Brad King requested to merge brad.king/cmake:fix-csharp-target-type into master

A target that contains only .cs sources should be generated as a .csproj project even if it links to non-CSharp static libraries. The latter case was broken by refactoring in !1805 (merged). The reason is that the HasLanguage method added by !1916 (merged) enforces its "exclusive" check on the combined set of source file languages and the link language. To restore the original TargetIsCSharpOnly semantics, update HasLanguage to enforce exclusiveness only on the list of sources.

Fixes: #18239 (closed)

Merge request reports