cmVisualStudio10TargetGenerator: Do not segfault on empty config

The VS generator should error out earlier when no configurations
are specified, but for now cover this symptom.
This commit is contained in:
Robert Maynard
2020-06-24 08:34:08 -04:00
committed by Brad King
parent 01fdd421bb
commit c4cc21d20b

View File

@@ -4131,8 +4131,9 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences(Elem& e0)
}
// Don't reference targets that don't produce any output.
if (dt->GetManagedType(this->Configurations[0]) ==
cmGeneratorTarget::ManagedType::Undefined) {
if (this->Configurations.empty() ||
dt->GetManagedType(this->Configurations[0]) ==
cmGeneratorTarget::ManagedType::Undefined) {
e2.Element("ReferenceOutputAssembly", "false");
e2.Element("CopyToOutputDirectory", "Never");
}