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
This commit is contained in:
Bastien Schatt
2018-04-12 23:11:42 +02:00
committed by Brad King
parent 4984d8433e
commit c8e98974d8

View File

@@ -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);
}