mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-05 21:31:08 -06:00
CSharp: Fix regression in VS project type selection
A that target 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 commit v3.12.0-rc1~160^2~7 (remove TargetIsCSharpOnly() and use methods from cmGeneratorTarget, 2018-03-19). The reason is that the `HasLanguage` method added by commit v3.12.0-rc1~239^2~6 (cmGeneratorTarget: add HasLanguage() as wrapper for GetLanguages(), 2018-03-19) 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
This commit is contained in:
@@ -366,7 +366,7 @@ public:
|
||||
|
||||
// Evaluate if the target uses the given language for compilation
|
||||
// and/or linking. If 'exclusive' is true, 'language' is expected
|
||||
// to be the only language used for the target.
|
||||
// to be the only language used in source files for the target.
|
||||
bool HasLanguage(std::string const& language, std::string const& config,
|
||||
bool exclusive = true) const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user