diff options
author | David Cole <david.cole@kitware.com> | 2009-01-27 15:30:55 (GMT) |
---|---|---|
committer | David Cole <david.cole@kitware.com> | 2009-01-27 15:30:55 (GMT) |
commit | 1dee719cdc0fe007235f3105df880cc51b597828 (patch) | |
tree | 5a9a845c257192c640899366c635ba7df2e4fccd /Source/cmLocalGenerator.cxx | |
parent | 97ef91d57b46f43afb0c5474a091b9b9fd424b29 (diff) | |
download | CMake-1dee719cdc0fe007235f3105df880cc51b597828.zip CMake-1dee719cdc0fe007235f3105df880cc51b597828.tar.gz CMake-1dee719cdc0fe007235f3105df880cc51b597828.tar.bz2 |
BUG: Fix issue #6195. Add CMAKE_OSX_DEPLOYMENT_TARGET cache variable to specify the target deployment runtime OS version of the built executables on Mac OSX. Thanks to Mike Jackson for the patch.
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index b2132f1..141e934 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1685,6 +1685,7 @@ void cmLocalGenerator::AddLanguageFlags(std::string& flags, std::string flagsVar = "CMAKE_"; flagsVar += lang; flagsVar += "_FLAGS"; + if(this->EmitUniversalBinaryFlags) { const char* osxArch = @@ -1693,9 +1694,13 @@ void cmLocalGenerator::AddLanguageFlags(std::string& flags, this->Makefile->GetDefinition("CMAKE_OSX_SYSROOT"); const char* sysrootDefault = this->Makefile->GetDefinition("CMAKE_OSX_SYSROOT_DEFAULT"); + const char* deploymentTarget = + this->Makefile->GetDefinition("CMAKE_OSX_DEPLOYMENT_TARGET"); + bool flagsUsed = false; - if(osxArch && sysroot && lang && (lang[0] =='C' || lang[0] == 'F')) - { + + if(osxArch && sysroot && lang && (lang[0] =='C' || lang[0] == 'F')) + { std::vector<std::string> archs; cmSystemTools::ExpandListArgument(std::string(osxArch), archs); @@ -1704,6 +1709,7 @@ void cmLocalGenerator::AddLanguageFlags(std::string& flags, { const char* archOrig = this->Makefile->GetSafeDefinition("CMAKE_OSX_ARCHITECTURES_DEFAULT"); + if(archs[0] == archOrig) { addArchFlag = false; @@ -1721,18 +1727,29 @@ void cmLocalGenerator::AddLanguageFlags(std::string& flags, flags += " -arch "; flags += *i; } + flags += " -isysroot "; flags += sysroot; + flagsUsed = true; } } + if(!flagsUsed && sysroot && sysrootDefault && strcmp(sysroot, sysrootDefault) != 0) { flags += " -isysroot "; flags += sysroot; } + + if (deploymentTarget && *deploymentTarget && + lang && (lang[0] =='C' || lang[0] == 'F')) + { + flags += " -mmacosx-version-min="; + flags += deploymentTarget; + } } + this->AddConfigVariableFlags(flags, flagsVar.c_str(), config); } |