Commit c8e98974 authored by Bastien Schatt's avatar Bastien Schatt Committed by Brad King
Browse files

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
parent 4984d843
......@@ -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);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment