Browse Source

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
Bastien Schatt 7 years ago
parent
commit
c8e98974d8
1 changed files with 2 additions and 4 deletions
  1. 2 4
      Source/cmVisualStudio10TargetGenerator.cxx

+ 2 - 4
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("</ProjectReference>\n", 2);
   }