diff options
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 58 |
1 files changed, 24 insertions, 34 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 79d77e7..6d15b8c 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -339,20 +339,22 @@ bool cmGlobalXCodeGenerator::Open(const std::string& bindir, } void cmGlobalXCodeGenerator::GenerateBuildCommand( - std::vector<std::string>& makeCommand, const std::string& makeProgram, + GeneratedMakeCommand& makeCommand, const std::string& makeProgram, const std::string& projectName, const std::string& /*projectDir*/, const std::string& targetName, const std::string& config, bool /*fast*/, int jobs, bool /*verbose*/, std::vector<std::string> const& makeOptions) { // now build the test - makeCommand.emplace_back( + makeCommand.add( this->SelectMakeProgram(makeProgram, this->GetXcodeBuildCommand())); - makeCommand.emplace_back("-project"); - std::string projectArg = projectName; - projectArg += ".xcode"; - projectArg += "proj"; - makeCommand.emplace_back(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; @@ -360,29 +362,22 @@ void cmGlobalXCodeGenerator::GenerateBuildCommand( clean = true; realTarget = "ALL_BUILD"; } - if (clean) { - makeCommand.emplace_back("clean"); - } else { - makeCommand.emplace_back("build"); - } - makeCommand.emplace_back("-target"); - if (!realTarget.empty()) { - makeCommand.emplace_back(realTarget); - } else { - makeCommand.emplace_back("ALL_BUILD"); - } - makeCommand.emplace_back("-configuration"); - makeCommand.emplace_back(!config.empty() ? config : "Debug"); + + makeCommand.add((clean ? "clean" : "build")); + makeCommand.add("-target", (realTarget.empty() ? "ALL_BUILD" : realTarget)); + makeCommand.add("-configuration", (config.empty() ? "Debug" : config)); if (jobs != cmake::NO_BUILD_PARALLEL_LEVEL) { - makeCommand.emplace_back("-jobs"); + makeCommand.add("-jobs"); if (jobs != cmake::DEFAULT_BUILD_PARALLEL_LEVEL) { - makeCommand.emplace_back(std::to_string(jobs)); + makeCommand.add(std::to_string(jobs)); } } - makeCommand.insert(makeCommand.end(), makeOptions.begin(), - makeOptions.end()); + if (this->XcodeVersion >= 70) { + makeCommand.add("-hideShellScriptEnvironment"); + } + makeCommand.add(makeOptions.begin(), makeOptions.end()); } ///! Create a local generator appropriate to this Global Generator @@ -538,10 +533,6 @@ void cmGlobalXCodeGenerator::AddExtraTargets( // now make the allbuild depend on all the non-utility targets // in the project for (auto& gen : gens) { - if (this->IsExcluded(root, gen)) { - continue; - } - for (auto target : gen->GetGeneratorTargets()) { if (target->GetType() == cmStateEnums::GLOBAL_TARGET) { continue; @@ -574,8 +565,7 @@ void cmGlobalXCodeGenerator::AddExtraTargets( false, "", false, cmMakefile::AcceptObjectLibraryCommands); } - if (target->GetType() != cmStateEnums::INTERFACE_LIBRARY && - !target->GetPropertyAsBool("EXCLUDE_FROM_ALL")) { + if (!this->IsExcluded(target)) { allbuild->AddUtility(target->GetName()); } } @@ -623,7 +613,7 @@ void cmGlobalXCodeGenerator::CreateReRunCMakeFile( std::string checkCache = root->GetBinaryDirectory(); checkCache += "/"; - checkCache += cmake::GetCMakeFilesDirectoryPostSlash(); + checkCache += "CMakeFiles/"; checkCache += "cmake.check_cache"; if (cm->DoWriteGlobVerifyTarget()) { @@ -1413,7 +1403,7 @@ void cmGlobalXCodeGenerator::ForceLinkerLanguage(cmGeneratorTarget* gtgt) // language. cmMakefile* mf = gtgt->Target->GetMakefile(); std::string fname = gtgt->GetLocalGenerator()->GetCurrentBinaryDirectory(); - fname += cmake::GetCMakeFilesDirectory(); + fname += "/CMakeFiles"; fname += "/"; fname += gtgt->GetName(); fname += "-CMakeForceLinker"; @@ -3586,7 +3576,7 @@ std::string cmGlobalXCodeGenerator::RelativeToSource(const char* p) std::string cmGlobalXCodeGenerator::RelativeToBinary(const char* p) { - return this->CurrentLocalGenerator->ConvertToRelativePath( + return this->CurrentLocalGenerator->MaybeConvertToRelativePath( cmSystemTools::JoinPath(this->ProjectOutputDirectoryComponents), p); } @@ -3721,7 +3711,7 @@ std::string cmGlobalXCodeGenerator::ComputeInfoPListLocation( cmGeneratorTarget* target) { std::string plist = target->GetLocalGenerator()->GetCurrentBinaryDirectory(); - plist += cmake::GetCMakeFilesDirectory(); + plist += "/CMakeFiles"; plist += "/"; plist += target->GetName(); plist += ".dir/Info.plist"; |