Explorar el Código

ctest: Fix --build-and-test without --build-target on Xcode

Florian Maushart hace 7 años
padre
commit
3ca4402966
Se han modificado 1 ficheros con 7 adiciones y 5 borrados
  1. 7 5
      Source/cmGlobalXCodeGenerator.cxx

+ 7 - 5
Source/cmGlobalXCodeGenerator.cxx

@@ -348,11 +348,13 @@ void cmGlobalXCodeGenerator::GenerateBuildCommand(
   makeCommand.add(
   makeCommand.add(
     this->SelectMakeProgram(makeProgram, this->GetXcodeBuildCommand()));
     this->SelectMakeProgram(makeProgram, this->GetXcodeBuildCommand()));
 
 
-  makeCommand.add("-project");
-  std::string projectArg = projectName;
-  projectArg += ".xcode";
-  projectArg += "proj";
-  makeCommand.add(projectArg);
+  if (!projectName.empty()) {
+    makeCommand.add("-project");
+    std::string projectArg = projectName;
+    projectArg += ".xcode";
+    projectArg += "proj";
+    makeCommand.add(projectArg);
+  }
 
 
   bool clean = false;
   bool clean = false;
   std::string realTarget = targetName;
   std::string realTarget = targetName;