Skip to content

CSharp: Fix regression in VS project type selection for custom target

A target created by add_custom_target should always be a .vcxproj file even if it has .cs sources involved in custom commands and such. The latter case was broken by refactoring in !1805 (merged). The reason is that the HasLanguage method added by !1916 (merged) does not check the target type and so is not a suitable check for deciding the project file extension.

The HasLanguage method was an attempt at an abstraction that turns out not to work very well. Replace it with a dedicated IsCSharpOnly method that considers the target type, sources, and non-transitive LINKER_LANGUAGE.

Fixes: #18515 (closed)

Edited by Brad King

Merge request reports