summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-09-19 14:14:31 (GMT)
committerBrad King <brad.king@kitware.com>2009-09-19 14:14:31 (GMT)
commit180c60a86f5c44085a1a66865bfc8b9479c72e8a (patch)
tree33e7fc0647387c8a73a49e9a7e40c6d672fd5fee /Source/cmLocalGenerator.cxx
parent196d9a54aa7083c2d063147ac431c7efd11f393d (diff)
downloadCMake-180c60a86f5c44085a1a66865bfc8b9479c72e8a.zip
CMake-180c60a86f5c44085a1a66865bfc8b9479c72e8a.tar.gz
CMake-180c60a86f5c44085a1a66865bfc8b9479c72e8a.tar.bz2
Fix check for -isysroot on OS X
Previously we checked for this flag by parsing the version number of GCC out of 'gcc --version', but this is not reliable because the format can vary greatly. Now we run 'gcc -v --help' and look for '-isysroot' in the list of options. We also now store the result on a per-language basis in the per-compiler info file "CMake<LANG>Compiler.cmake". This is necessary to make it accessible from try-compile projects so that they generate correctly.
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r--Source/cmLocalGenerator.cxx9
1 files changed, 2 insertions, 7 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 800bb48..0ab4787 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1760,13 +1760,8 @@ 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;
- }
+ std::string isysrootVar = std::string("CMAKE_") + lang + "_HAS_ISYSROOT";
+ bool hasIsysroot = this->Makefile->IsOn(isysrootVar.c_str());
bool flagsUsed = false;
if(osxArch && sysroot && lang && (lang[0] =='C' || lang[0] == 'F'))
{