diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2006-03-24 14:15:05 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2006-03-24 14:15:05 (GMT) |
commit | f7c1723135f140eaac1ee02c31c0339761778f22 (patch) | |
tree | ae4858167f38f2e57c3dcf442fbfe83aeea1cc82 /Source/cmGlobalXCodeGenerator.cxx | |
parent | cec6543d0d7e0f8302b092f3ff66fb240bc212c4 (diff) | |
download | CMake-f7c1723135f140eaac1ee02c31c0339761778f22.zip CMake-f7c1723135f140eaac1ee02c31c0339761778f22.tar.gz CMake-f7c1723135f140eaac1ee02c31c0339761778f22.tar.bz2 |
ENH: add support for universal binaries
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 37 |
1 files changed, 27 insertions, 10 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index bccf362..cf7a96d 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -62,9 +62,6 @@ public: #endif -//TODO -// add OSX application stuff - //---------------------------------------------------------------------------- cmGlobalXCodeGenerator::cmGlobalXCodeGenerator() { @@ -1096,16 +1093,12 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target, this->CreateString("mh_bundle")); buildSettings->AddAttribute("GCC_DYNAMIC_NO_PIC", this->CreateString("NO")); + buildSettings->AddAttribute("PREBINDING", + this->CreateString("NO")); buildSettings->AddAttribute("GCC_SYMBOLS_PRIVATE_EXTERN", this->CreateString("NO")); buildSettings->AddAttribute("GCC_INLINES_ARE_PRIVATE_EXTERN", this->CreateString("NO")); - std::string outflag = "-o \\\"$(CONFIGURATION_BUILD_DIR)/"; - outflag += productName; - outflag += "\\\""; - extraLinkOptions += " "; - extraLinkOptions += outflag; - // Add the flags to create an executable. std::string createFlags = this->LookupFlags("CMAKE_", lang, "_LINK_FLAGS", ""); @@ -1980,7 +1973,31 @@ void cmGlobalXCodeGenerator::CreateXCodeObjects(cmLocalGenerator* root, configlist->AddAttribute("defaultConfigurationIsVisible", this->CreateString("0")); configlist->AddAttribute("defaultConfigurationName", this->CreateString("Debug")); cmXCodeObject* buildSettings = - this->CreateObject(cmXCodeObject::ATTRIBUTE_GROUP); + this->CreateObject(cmXCodeObject::ATTRIBUTE_GROUP); + const char* osxArch = + this->CurrentMakefile->GetDefinition("CMAKE_OSX_ARCHITECTURES"); + const char* sysroot = + this->CurrentMakefile->GetDefinition("CMAKE_OSX_SYSROOT"); + if(osxArch && sysroot) + { + std::vector<std::string> archs; + cmSystemTools::ExpandListArgument(std::string(osxArch), + archs); + if(archs.size() > 1) + { + buildSettings->AddAttribute("SDKROOT", + this->CreateString(sysroot)); + std::string archString; + for( std::vector<std::string>::iterator i = archs.begin(); + i != archs.end(); ++i) + { + archString += *i; + archString += " "; + } + buildSettings->AddAttribute("ARCHS", + this->CreateString(archString.c_str())); + } + } configDebug->AddAttribute("name", this->CreateString("Debug")); configDebug->AddAttribute("buildSettings", buildSettings); configRelease->AddAttribute("name", this->CreateString("Release")); |