summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r--Source/cmLocalGenerator.cxx30
1 files changed, 21 insertions, 9 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 75ec694..bd7eb3f 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -85,6 +85,7 @@ static auto ruleReplaceVars = { "CMAKE_${LANG}_COMPILER",
"CMAKE_RANLIB",
"CMAKE_LINKER",
"CMAKE_MT",
+ "CMAKE_TAPI",
"CMAKE_CUDA_HOST_COMPILER",
"CMAKE_CUDA_HOST_LINK_LAUNCHER",
"CMAKE_CL_SHOWINCLUDES_PREFIX" };
@@ -134,6 +135,13 @@ cmLocalGenerator::cmLocalGenerator(cmGlobalGenerator* gg, cmMakefile* makefile)
this->LinkerSysroot = this->Makefile->GetSafeDefinition("CMAKE_SYSROOT");
}
+ // OSX SYSROOT can be required by some tools, like tapi
+ {
+ cmValue osxSysroot = this->Makefile->GetDefinition("CMAKE_OSX_SYSROOT");
+ this->VariableMappings["CMAKE_OSX_SYSROOT"] =
+ osxSysroot.IsEmpty() ? "/" : this->EscapeForShell(*osxSysroot, true);
+ }
+
if (cmValue appleArchSysroots =
this->Makefile->GetDefinition("CMAKE_APPLE_ARCH_SYSROOTS")) {
std::string const& appleArchs =
@@ -827,13 +835,18 @@ cmStateSnapshot cmLocalGenerator::GetStateSnapshot() const
return this->Makefile->GetStateSnapshot();
}
-cmValue cmLocalGenerator::GetRuleLauncher(cmGeneratorTarget* target,
- const std::string& prop)
+std::string cmLocalGenerator::GetRuleLauncher(cmGeneratorTarget* target,
+ const std::string& prop,
+ const std::string& config)
{
+ cmValue value = this->Makefile->GetProperty(prop);
if (target) {
- return target->GetProperty(prop);
+ value = target->GetProperty(prop);
+ }
+ if (value) {
+ return cmGeneratorExpression::Evaluate(*value, this, config, target);
}
- return this->Makefile->GetProperty(prop);
+ return "";
}
std::string cmLocalGenerator::ConvertToIncludeReference(
@@ -1639,7 +1652,7 @@ static std::string GetFrameworkFlags(const std::string& lang,
cmLocalGenerator* lg = target->GetLocalGenerator();
cmMakefile* mf = lg->GetMakefile();
- if (!mf->IsOn("APPLE")) {
+ if (!target->IsApple()) {
return std::string();
}
@@ -1813,7 +1826,7 @@ std::string cmLocalGenerator::GetLinkLibsCMP0065(
// OLD behavior is to always add the flags, except on AIX where
// we compute symbol exports if ENABLE_EXPORTS is on.
add_shlib_flags =
- !(tgt.Target->IsAIX() && tgt.GetPropertyAsBool("ENABLE_EXPORTS"));
+ !(tgt.IsAIX() && tgt.GetPropertyAsBool("ENABLE_EXPORTS"));
break;
case cmPolicies::REQUIRED_IF_USED:
case cmPolicies::REQUIRED_ALWAYS:
@@ -1825,7 +1838,7 @@ std::string cmLocalGenerator::GetLinkLibsCMP0065(
// NEW behavior is to only add the flags if ENABLE_EXPORTS is on,
// except on AIX where we compute symbol exports.
add_shlib_flags =
- !tgt.Target->IsAIX() && tgt.GetPropertyAsBool("ENABLE_EXPORTS");
+ !tgt.IsAIX() && tgt.GetPropertyAsBool("ENABLE_EXPORTS");
break;
}
@@ -1859,7 +1872,7 @@ void cmLocalGenerator::AddArchitectureFlags(std::string& flags,
const std::string& filterArch)
{
// Only add Apple specific flags on Apple platforms
- if (this->Makefile->IsOn("APPLE") && this->EmitUniversalBinaryFlags) {
+ if (target->IsApple() && this->EmitUniversalBinaryFlags) {
std::vector<std::string> archs;
target->GetAppleArchs(config, archs);
if (!archs.empty() &&
@@ -2841,7 +2854,6 @@ void cmLocalGenerator::CopyPchCompilePdb(
auto cc = cm::make_unique<cmCustomCommand>();
cc->SetCommandLines(commandLines);
cc->SetComment(no_message);
- cc->SetCMP0116Status(cmPolicies::NEW);
cc->SetStdPipesUTF8(true);
if (this->GetGlobalGenerator()->IsVisualStudio()) {