diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 54 | ||||
-rw-r--r-- | Source/cmLocalGenerator.cxx | 5 |
2 files changed, 28 insertions, 31 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 4131dfc..cf60bd9 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -2675,6 +2675,20 @@ void cmGlobalXCodeGenerator this->CreateObject(cmXCodeObject::ATTRIBUTE_GROUP); const char* osxArch = this->CurrentMakefile->GetDefinition("CMAKE_OSX_ARCHITECTURES"); + if(strlen(osxArch) == 0) + { + if(this->XcodeVersion >= 32) + { + osxArch = "$(ARCHS_STANDARD_32_64_BIT)"; + } + else + { + osxArch = "$(ARCHS_STANDARD_32_BIT)"; + } + buildSettings->AddAttribute("ONLY_ACTIVE_ARCH", + this->CreateString("YES")); + } + const char* sysroot = this->CurrentMakefile->GetDefinition("CMAKE_OSX_SYSROOT"); const char* sysrootDefault = @@ -2688,33 +2702,19 @@ void cmGlobalXCodeGenerator this->Architectures.clear(); cmSystemTools::ExpandListArgument(std::string(osxArch), this->Architectures); - bool addArchFlag = true; - if(this->Architectures.size() == 1) - { - const char* archOrig = - this-> - CurrentMakefile->GetSafeDefinition("CMAKE_OSX_ARCHITECTURES_DEFAULT"); - if(this->Architectures[0] == archOrig) - { - addArchFlag = false; - } - } - if(addArchFlag) - { - flagsUsed = true; - buildSettings->AddAttribute("SDKROOT", - this->CreateString(sysroot)); - std::string archString; - for( std::vector<std::string>::iterator i = - this->Architectures.begin(); - i != this->Architectures.end(); ++i) - { - archString += *i; - archString += " "; - } - buildSettings->AddAttribute("ARCHS", - this->CreateString(archString.c_str())); - } + flagsUsed = true; + buildSettings->AddAttribute("SDKROOT", + this->CreateString(sysroot)); + std::string archString; + for( std::vector<std::string>::iterator i = + this->Architectures.begin(); + i != this->Architectures.end(); ++i) + { + archString += *i; + archString += " "; + } + buildSettings->AddAttribute("ARCHS", + this->CreateString(archString.c_str())); if(!flagsUsed && sysrootDefault && strcmp(sysroot, sysrootDefault) != 0) { diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 4d7bfdb..9338706 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1770,10 +1770,7 @@ void cmLocalGenerator::AddLanguageFlags(std::string& flags, bool addArchFlag = true; if(archs.size() == 1) { - const char* archOrig = - this->Makefile->GetSafeDefinition("CMAKE_OSX_ARCHITECTURES_DEFAULT"); - - if(archs[0] == archOrig) + if(archs[0] == "") { addArchFlag = false; } |