From 3ca44029668c057fb208c5f153c4d398bee954cb Mon Sep 17 00:00:00 2001 From: Florian Maushart Date: Tue, 26 Jun 2018 21:24:19 +0200 Subject: ctest: Fix --build-and-test without --build-target on Xcode --- Source/cmGlobalXCodeGenerator.cxx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index e9b82cf..97d8bdb 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -348,11 +348,13 @@ void cmGlobalXCodeGenerator::GenerateBuildCommand( makeCommand.add( 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; std::string realTarget = targetName; -- cgit v0.12