diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2009-09-18 18:22:20 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2009-09-18 18:22:20 (GMT) |
commit | 58818d5168bb9b6402a1c3651a3a97173123e4ae (patch) | |
tree | d0bdaff63700dbeefea78811f5d2a681a3e2c0ad /Source/cmLocalGenerator.cxx | |
parent | 3c32c904b33b3c16e2d050c10b217d6b7e327024 (diff) | |
download | CMake-58818d5168bb9b6402a1c3651a3a97173123e4ae.zip CMake-58818d5168bb9b6402a1c3651a3a97173123e4ae.tar.gz CMake-58818d5168bb9b6402a1c3651a3a97173123e4ae.tar.bz2 |
Add detection of gcc versions that do not support isysroot option and do not use it for them.
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 1b4cea3..e685b5a 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1759,9 +1759,14 @@ void cmLocalGenerator::AddLanguageFlags(std::string& flags, this->Makefile->GetDefinition("CMAKE_OSX_SYSROOT_DEFAULT"); const char* deploymentTarget = this->Makefile->GetDefinition("CMAKE_OSX_DEPLOYMENT_TARGET"); - + const char* gccHasIsysroot = + this->Makefile->GetRequiredDefinition("CMAKE_OSX_GCC_SUPPORT_ISYSROOT"); + bool hasIsysroot = true; + if(cmSystemTools::IsOff(gccHasIsysroot)) + { + hasIsysroot = false; + } bool flagsUsed = false; - if(osxArch && sysroot && lang && (lang[0] =='C' || lang[0] == 'F')) { std::vector<std::string> archs; @@ -1787,16 +1792,17 @@ void cmLocalGenerator::AddLanguageFlags(std::string& flags, flags += " -arch "; flags += *i; } - - flags += " -isysroot "; - flags += sysroot; - + if(hasIsysroot) + { + flags += " -isysroot "; + flags += sysroot; + } flagsUsed = true; } } if(!flagsUsed && sysroot && sysrootDefault && - strcmp(sysroot, sysrootDefault) != 0) + strcmp(sysroot, sysrootDefault) != 0 && hasIsysroot) { flags += " -isysroot "; flags += sysroot; |