From c4cc21d20b79d682a99cc28957cf973ebf1993ff Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Wed, 24 Jun 2020 08:34:08 -0400 Subject: 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. --- Source/cmVisualStudio10TargetGenerator.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index a3ccd2b..a191f70 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -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"); } -- cgit v0.12