From c8e98974d8a71ff048eea60e2949382d39d51383 Mon Sep 17 00:00:00 2001 From: Bastien Schatt Date: Thu, 12 Apr 2018 23:11:42 +0200 Subject: VS: Disallow ReferenceOutputAssembly in ProjectReference if not possible Explicitly turn off `ReferenceOutputAssembly` in `ProjectReference` elements naming other project files whose types do not produce assemblies. We already do this for `C#` but it makes sense for other languages too. Fixes: #17906 --- Source/cmVisualStudio10TargetGenerator.cxx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 13af167..22dca62 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -3646,10 +3646,8 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences() "{" + this->GlobalGenerator->GetGUID(name) + "}", 3); this->WriteElem("Name", name, 3); this->WriteDotNetReferenceCustomTags(name); - if (csproj == this->ProjectType) { - if (!this->GlobalGenerator->TargetCanBeReferenced(dt)) { - this->WriteElem("ReferenceOutputAssembly", "false", 3); - } + if (!this->GlobalGenerator->TargetCanBeReferenced(dt)) { + this->WriteElem("ReferenceOutputAssembly", "false", 3); } this->WriteString("\n", 2); } -- cgit v0.12