Fix for bug #9466. Change the implementation of OSX arch lists. If no ARCHs are specified by the user then no flags are set. We no longer use CMAKE_OSX_ARCHITECTURES_DEFAULT.
This commit is contained in:
parent
8e8c9b7242
commit
ea282284d5
@ -149,16 +149,12 @@ IF(_CMAKE_OSX_MACHINE MATCHES "Power")
|
|||||||
SET(_CMAKE_OSX_MACHINE ppc)
|
SET(_CMAKE_OSX_MACHINE ppc)
|
||||||
ENDIF(_CMAKE_OSX_MACHINE MATCHES "Power")
|
ENDIF(_CMAKE_OSX_MACHINE MATCHES "Power")
|
||||||
|
|
||||||
# set the default based on uname and not the environment variable
|
|
||||||
# as that is what is used to change it!
|
|
||||||
SET(CMAKE_OSX_ARCHITECTURES_DEFAULT ${_CMAKE_OSX_MACHINE})
|
|
||||||
|
|
||||||
# check for environment variable CMAKE_OSX_ARCHITECTURES
|
# check for environment variable CMAKE_OSX_ARCHITECTURES
|
||||||
# if it is set.
|
# if it is set.
|
||||||
IF(NOT "$ENV{CMAKE_OSX_ARCHITECTURES}" STREQUAL "")
|
IF(NOT "$ENV{CMAKE_OSX_ARCHITECTURES}" STREQUAL "")
|
||||||
SET(CMAKE_OSX_ARCHITECTURES_VALUE "$ENV{CMAKE_OSX_ARCHITECTURES}")
|
SET(CMAKE_OSX_ARCHITECTURES_VALUE "$ENV{CMAKE_OSX_ARCHITECTURES}")
|
||||||
ELSE(NOT "$ENV{CMAKE_OSX_ARCHITECTURES}" STREQUAL "")
|
ELSE(NOT "$ENV{CMAKE_OSX_ARCHITECTURES}" STREQUAL "")
|
||||||
SET(CMAKE_OSX_ARCHITECTURES_VALUE ${CMAKE_OSX_ARCHITECTURES_DEFAULT})
|
SET(CMAKE_OSX_ARCHITECTURES_VALUE "")
|
||||||
ENDIF(NOT "$ENV{CMAKE_OSX_ARCHITECTURES}" STREQUAL "")
|
ENDIF(NOT "$ENV{CMAKE_OSX_ARCHITECTURES}" STREQUAL "")
|
||||||
|
|
||||||
# now put _CMAKE_OSX_MACHINE into the cache
|
# now put _CMAKE_OSX_MACHINE into the cache
|
||||||
|
@ -2675,6 +2675,20 @@ void cmGlobalXCodeGenerator
|
|||||||
this->CreateObject(cmXCodeObject::ATTRIBUTE_GROUP);
|
this->CreateObject(cmXCodeObject::ATTRIBUTE_GROUP);
|
||||||
const char* osxArch =
|
const char* osxArch =
|
||||||
this->CurrentMakefile->GetDefinition("CMAKE_OSX_ARCHITECTURES");
|
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 =
|
const char* sysroot =
|
||||||
this->CurrentMakefile->GetDefinition("CMAKE_OSX_SYSROOT");
|
this->CurrentMakefile->GetDefinition("CMAKE_OSX_SYSROOT");
|
||||||
const char* sysrootDefault =
|
const char* sysrootDefault =
|
||||||
@ -2688,33 +2702,19 @@ void cmGlobalXCodeGenerator
|
|||||||
this->Architectures.clear();
|
this->Architectures.clear();
|
||||||
cmSystemTools::ExpandListArgument(std::string(osxArch),
|
cmSystemTools::ExpandListArgument(std::string(osxArch),
|
||||||
this->Architectures);
|
this->Architectures);
|
||||||
bool addArchFlag = true;
|
flagsUsed = true;
|
||||||
if(this->Architectures.size() == 1)
|
buildSettings->AddAttribute("SDKROOT",
|
||||||
|
this->CreateString(sysroot));
|
||||||
|
std::string archString;
|
||||||
|
for( std::vector<std::string>::iterator i =
|
||||||
|
this->Architectures.begin();
|
||||||
|
i != this->Architectures.end(); ++i)
|
||||||
{
|
{
|
||||||
const char* archOrig =
|
archString += *i;
|
||||||
this->
|
archString += " ";
|
||||||
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()));
|
|
||||||
}
|
}
|
||||||
|
buildSettings->AddAttribute("ARCHS",
|
||||||
|
this->CreateString(archString.c_str()));
|
||||||
if(!flagsUsed && sysrootDefault &&
|
if(!flagsUsed && sysrootDefault &&
|
||||||
strcmp(sysroot, sysrootDefault) != 0)
|
strcmp(sysroot, sysrootDefault) != 0)
|
||||||
{
|
{
|
||||||
|
@ -1770,10 +1770,7 @@ void cmLocalGenerator::AddLanguageFlags(std::string& flags,
|
|||||||
bool addArchFlag = true;
|
bool addArchFlag = true;
|
||||||
if(archs.size() == 1)
|
if(archs.size() == 1)
|
||||||
{
|
{
|
||||||
const char* archOrig =
|
if(archs[0] == "")
|
||||||
this->Makefile->GetSafeDefinition("CMAKE_OSX_ARCHITECTURES_DEFAULT");
|
|
||||||
|
|
||||||
if(archs[0] == archOrig)
|
|
||||||
{
|
{
|
||||||
addArchFlag = false;
|
addArchFlag = false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user