[Cmake-commits] [cmake-commits] hoffman committed cmGlobalXCodeGenerator.cxx 1.187 1.188 cmLocalGenerator.cxx 1.270 1.271
cmake-commits at cmake.org
cmake-commits at cmake.org
Mon Apr 28 13:53:16 EDT 2008
Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv7695/Source
Modified Files:
cmGlobalXCodeGenerator.cxx cmLocalGenerator.cxx
Log Message:
ENH: allow users to set sysroot
Index: cmGlobalXCodeGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalXCodeGenerator.cxx,v
retrieving revision 1.187
retrieving revision 1.188
diff -C 2 -d -r1.187 -r1.188
*** cmGlobalXCodeGenerator.cxx 8 Apr 2008 04:06:46 -0000 1.187
--- cmGlobalXCodeGenerator.cxx 28 Apr 2008 17:53:13 -0000 1.188
***************
*** 2452,2463 ****
const char* sysroot =
this->CurrentMakefile->GetDefinition("CMAKE_OSX_SYSROOT");
if(osxArch && sysroot)
{
// recompute this as it may have been changed since enable language
this->Architectures.clear();
cmSystemTools::ExpandListArgument(std::string(osxArch),
this->Architectures);
! if(this->Architectures.size() > 1)
{
buildSettings->AddAttribute("SDKROOT",
this->CreateString(sysroot));
--- 2452,2478 ----
const char* sysroot =
this->CurrentMakefile->GetDefinition("CMAKE_OSX_SYSROOT");
+ const char* sysrootDefault =
+ this->CurrentMakefile->GetDefinition("CMAKE_OSX_SYSROOT_DEFAULT");
if(osxArch && sysroot)
{
+ bool flagsUsed = false;
// recompute this as it may have been changed since enable language
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));
***************
*** 2473,2476 ****
--- 2488,2497 ----
this->CreateString(archString.c_str()));
}
+ if(!flagsUsed && sysrootDefault &&
+ strcmp(sysroot, sysrootDefault) != 0)
+ {
+ buildSettings->AddAttribute("SDKROOT",
+ this->CreateString(sysroot));
+ }
}
for( std::vector<cmXCodeObject*>::iterator i = configs.begin();
Index: cmLocalGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalGenerator.cxx,v
retrieving revision 1.270
retrieving revision 1.271
diff -C 2 -d -r1.270 -r1.271
*** cmLocalGenerator.cxx 28 Mar 2008 19:54:20 -0000 1.270
--- cmLocalGenerator.cxx 28 Apr 2008 17:53:14 -0000 1.271
***************
*** 1628,1631 ****
--- 1628,1634 ----
const char* sysroot =
this->Makefile->GetDefinition("CMAKE_OSX_SYSROOT");
+ const char* sysrootDefault =
+ this->Makefile->GetDefinition("CMAKE_OSX_SYSROOT_DEFAULT");
+ bool flagsUsed = false;
if(osxArch && sysroot && lang && lang[0] =='C')
{
***************
*** 1657,1664 ****
flags += " -isysroot ";
flags += sysroot;
}
}
}
- this->AddConfigVariableFlags(flags, flagsVar.c_str(), config);
}
--- 1660,1674 ----
flags += " -isysroot ";
flags += sysroot;
+ flagsUsed = true;
}
}
+ if(!flagsUsed && sysroot && sysrootDefault &&
+ strcmp(sysroot, sysrootDefault) != 0)
+ {
+ flags += " -isysroot ";
+ flags += sysroot;
+ }
+ this->AddConfigVariableFlags(flags, flagsVar.c_str(), config);
}
}
More information about the Cmake-commits
mailing list