mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
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:
committed by
Brad King
parent
4984d8433e
commit
c8e98974d8
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user