Bladeren bron

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.
Robert Maynard 5 jaren geleden
bovenliggende
commit
c4cc21d20b
1 gewijzigde bestanden met toevoegingen van 3 en 2 verwijderingen
  1. 3 2
      Source/cmVisualStudio10TargetGenerator.cxx

+ 3 - 2
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");
     }