diff options
author | Gregor Jasny <gjasny@googlemail.com> | 2019-02-10 10:22:38 (GMT) |
---|---|---|
committer | Gregor Jasny <gjasny@googlemail.com> | 2019-02-16 14:20:39 (GMT) |
commit | afb325018ebe7c41933b652732a43e4bb4777588 (patch) | |
tree | dd4162ef023032f8f1ac2c77727ab3e53b37c33b /Source/cmGlobalXCodeGenerator.cxx | |
parent | 657b30905a9d03869c99064872ec715c9934312a (diff) | |
download | CMake-afb325018ebe7c41933b652732a43e4bb4777588.zip CMake-afb325018ebe7c41933b652732a43e4bb4777588.tar.gz CMake-afb325018ebe7c41933b652732a43e4bb4777588.tar.bz2 |
Xcode: Require at least Xcode 5
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 72 |
1 files changed, 12 insertions, 60 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 51c001e..4e4e1bb 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -217,7 +217,7 @@ cmGlobalGenerator* cmGlobalXCodeGenerator::Factory::CreateGlobalGenerator( sscanf(version_string.c_str(), "%u.%u", &v[0], &v[1]); unsigned int version_number = 10 * v[0] + v[1]; - if (version_number < 30) { + if (version_number < 50) { cm->IssueMessage(MessageType::FATAL_ERROR, "Xcode " + version_string + " not supported."); return nullptr; @@ -256,15 +256,11 @@ std::string const& cmGlobalXCodeGenerator::GetXcodeBuildCommand() std::string cmGlobalXCodeGenerator::FindXcodeBuildCommand() { - if (this->XcodeVersion >= 40) { - std::string makeProgram = cmSystemTools::FindProgram("xcodebuild"); - if (makeProgram.empty()) { - makeProgram = "xcodebuild"; - } - return makeProgram; + std::string makeProgram = cmSystemTools::FindProgram("xcodebuild"); + if (makeProgram.empty()) { + makeProgram = "xcodebuild"; } - // Use cmakexbuild wrapper to suppress environment dump from output. - return cmSystemTools::GetCMakeCommand() + "xbuild"; + return makeProgram; } bool cmGlobalXCodeGenerator::SetGeneratorToolset(std::string const& ts, @@ -550,12 +546,7 @@ void cmGlobalXCodeGenerator::AddExtraTargets( // run the depend check makefile as a post build rule // this will make sure that when the next target is built // things are up-to-date - if (target->GetType() == cmStateEnums::OBJECT_LIBRARY || - (this->XcodeVersion < 50 && - (target->GetType() == cmStateEnums::EXECUTABLE || - target->GetType() == cmStateEnums::STATIC_LIBRARY || - target->GetType() == cmStateEnums::SHARED_LIBRARY || - target->GetType() == cmStateEnums::MODULE_LIBRARY))) { + if (target->GetType() == cmStateEnums::OBJECT_LIBRARY) { makeHelper.back() = // fill placeholder this->PostBuildMakeTarget(target->GetName(), "$(CONFIGURATION)"); cmCustomCommandLines commandLines; @@ -1183,23 +1174,6 @@ bool cmGlobalXCodeGenerator::CreateXCodeTarget( } } - if (this->XcodeVersion < 50) { - // Add object library contents as external objects. (Equivalent to - // the externalObjFiles above, except each one is not a cmSourceFile - // within the target.) - std::vector<cmSourceFile const*> objs; - gtgt->GetExternalObjects(objs, ""); - for (auto sourceFile : objs) { - if (sourceFile->GetObjectLibrary().empty()) { - continue; - } - std::string const& obj = sourceFile->GetFullPath(); - cmXCodeObject* xsf = - this->CreateXCodeSourceFileFromPath(obj, gtgt, "", nullptr); - externalObjFiles.push_back(xsf); - } - } - // some build phases only apply to bundles and/or frameworks bool isFrameworkTarget = gtgt->IsFrameworkOnApple(); bool isBundleTarget = gtgt->GetPropertyAsBool("MACOSX_BUNDLE"); @@ -2123,9 +2097,6 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt, default: break; } - if (this->XcodeVersion < 40) { - buildSettings->AddAttribute("PREBINDING", this->CreateString("NO")); - } BuildObjectListOrString dirs(this, true); BuildObjectListOrString fdirs(this, true); @@ -2775,8 +2746,7 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target) // Loop over configuration types and set per-configuration info. for (auto const& configName : this->CurrentConfigurationTypes) { - // Get the current configuration name. - if (this->XcodeVersion >= 50) { + { // Add object library contents as link flags. std::string linkObjs; const char* sep = ""; @@ -2886,7 +2856,7 @@ bool cmGlobalXCodeGenerator::CreateGroups( // Put cmSourceFile instances in proper groups: for (auto const& si : gtgt->GetAllConfigSources()) { cmSourceFile const* sf = si.Source; - if (this->XcodeVersion >= 50 && !sf->GetObjectLibrary().empty()) { + if (!sf->GetObjectLibrary().empty()) { // Object library files go on the link line instead. continue; } @@ -3076,16 +3046,8 @@ bool cmGlobalXCodeGenerator::CreateXCodeObjects( v << std::setfill('0') << std::setw(4) << XcodeVersion * 10; group->AddAttribute("LastUpgradeCheck", this->CreateString(v.str())); this->RootObject->AddAttribute("attributes", group); - if (this->XcodeVersion >= 32) { - this->RootObject->AddAttribute("compatibilityVersion", - this->CreateString("Xcode 3.2")); - } else if (this->XcodeVersion >= 31) { - this->RootObject->AddAttribute("compatibilityVersion", - this->CreateString("Xcode 3.1")); - } else { - this->RootObject->AddAttribute("compatibilityVersion", - this->CreateString("Xcode 3.0")); - } + this->RootObject->AddAttribute("compatibilityVersion", + this->CreateString("Xcode 3.2")); // Point Xcode at the top of the source tree. { std::string pdir = @@ -3540,13 +3502,7 @@ void cmGlobalXCodeGenerator::WriteXCodePBXProj(std::ostream& fout, cmXCodeObject::Indent(1, fout); fout << "};\n"; cmXCodeObject::Indent(1, fout); - if (this->XcodeVersion >= 32) { - fout << "objectVersion = 46;\n"; - } else if (this->XcodeVersion >= 31) { - fout << "objectVersion = 45;\n"; - } else { - fout << "objectVersion = 44;\n"; - } + fout << "objectVersion = 46;\n"; cmXCode21Object::PrintList(this->XCodeObjects, fout); cmXCodeObject::Indent(1, fout); fout << "rootObject = " << this->RootObject->GetId() @@ -3714,11 +3670,7 @@ void cmGlobalXCodeGenerator::AppendFlag(std::string& flags, // Flag value with escaped quotes and backslashes. for (auto c : flag) { if (c == '\'') { - if (this->XcodeVersion >= 40) { - flags += "'\\''"; - } else { - flags += "\\'"; - } + flags += "'\\''"; } else if (c == '\\') { flags += "\\\\"; } else { |