diff options
author | Brad King <brad.king@kitware.com> | 2024-02-09 14:54:00 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2024-02-09 16:32:13 (GMT) |
commit | 3ece4553c271fdb0d6d9a9846a135c4b78a03d5a (patch) | |
tree | 2ed219bc9051cf4b44e588eb3bdadedf61d7a18f | |
parent | 9e80593bca0968e7d35a9c97d625da58a07b7a08 (diff) | |
download | CMake-3ece4553c271fdb0d6d9a9846a135c4b78a03d5a.zip CMake-3ece4553c271fdb0d6d9a9846a135c4b78a03d5a.tar.gz CMake-3ece4553c271fdb0d6d9a9846a135c4b78a03d5a.tar.bz2 |
cmLocalGenerator: Avoid unnecessary lookup without a deployment target
-rw-r--r-- | Source/cmLocalGenerator.cxx | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 3e98341..04d2f50 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1978,14 +1978,16 @@ void cmLocalGenerator::AddArchitectureFlags(std::string& flags, cmValue deploymentTarget = this->Makefile->GetDefinition("CMAKE_OSX_DEPLOYMENT_TARGET"); - std::string deploymentTargetFlagVar = - "CMAKE_" + lang + "_OSX_DEPLOYMENT_TARGET_FLAG"; - cmValue deploymentTargetFlag = - this->Makefile->GetDefinition(deploymentTargetFlagVar); - if (cmNonempty(deploymentTargetFlag) && cmNonempty(deploymentTarget)) { - flags += " "; - flags += *deploymentTargetFlag; - flags += *deploymentTarget; + if (cmNonempty(deploymentTarget)) { + std::string deploymentTargetFlagVar = + "CMAKE_" + lang + "_OSX_DEPLOYMENT_TARGET_FLAG"; + cmValue deploymentTargetFlag = + this->Makefile->GetDefinition(deploymentTargetFlagVar); + if (cmNonempty(deploymentTargetFlag)) { + flags += " "; + flags += *deploymentTargetFlag; + flags += *deploymentTarget; + } } } } |