diff options
author | David Cole <david.cole@kitware.com> | 2010-01-29 16:56:35 (GMT) |
---|---|---|
committer | David Cole <david.cole@kitware.com> | 2010-01-29 16:56:35 (GMT) |
commit | 6ee87b2e5cd31b256c9f1d2f43bd24e665469732 (patch) | |
tree | 1383f9961df27fc160e1f0634f6faf96a90dbfc8 /Source | |
parent | 42c3eb85d62012bad8df85047df70b8fd9bbbeab (diff) | |
download | CMake-6ee87b2e5cd31b256c9f1d2f43bd24e665469732.zip CMake-6ee87b2e5cd31b256c9f1d2f43bd24e665469732.tar.gz CMake-6ee87b2e5cd31b256c9f1d2f43bd24e665469732.tar.bz2 |
Fix issue #10155 - default value of CMAKE_OSX_DEPLOYMENT_TARGET should always be the empty string. When the value of CMAKE_OSX_DEPLOYMENT_TARGET is the empty string, the -mmacosx-version-min flag should not show up on the compiler command line. The logic for selecting default value of CMAKE_OSX_SYSROOT is orthogonal to and independent of the value of the deployment target. The default value for CMAKE_OSX_SYSROOT is the SDK that corresponds to the current version of Mac OSX on which cmake is running.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 3339ee4..1937c2b 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1784,6 +1784,9 @@ void cmLocalGenerator::AddArchitectureFlags(std::string& flags, this->Makefile->GetDefinition("CMAKE_OSX_DEPLOYMENT_TARGET"); std::string isysrootVar = std::string("CMAKE_") + lang + "_HAS_ISYSROOT"; bool hasIsysroot = this->Makefile->IsOn(isysrootVar.c_str()); + std::string deploymentTargetFlagVar = std::string("CMAKE_") + lang + "_OSX_DEPLOYMENT_TARGET_FLAG"; + const char* deploymentTargetFlag = + this->Makefile->GetDefinition(deploymentTargetFlagVar.c_str()); bool flagsUsed = false; if(!archs.empty() && sysroot && lang && (lang[0] =='C' || lang[0] == 'F')) { @@ -1815,10 +1818,11 @@ void cmLocalGenerator::AddArchitectureFlags(std::string& flags, flags += sysroot; } - if (deploymentTarget && *deploymentTarget && - lang && (lang[0] =='C' || lang[0] == 'F')) + if (deploymentTargetFlag && *deploymentTargetFlag && + deploymentTarget && *deploymentTarget) { - flags += " -mmacosx-version-min="; + flags += " "; + flags += deploymentTargetFlag; flags += deploymentTarget; } } |