Commit cfb2f750 authored by Stephen Kelly's avatar Stephen Kelly

Use cmGeneratorTarget for property access.

parent b857f0d8
......@@ -109,7 +109,7 @@ std::string cmCommonTargetGenerator::ComputeFortranModuleDirectory() const
{
std::string mod_dir;
const char* target_mod_dir =
this->Target->GetProperty("Fortran_MODULE_DIRECTORY");
this->GeneratorTarget->GetProperty("Fortran_MODULE_DIRECTORY");
const char* moddir_flag =
this->Makefile->GetDefinition("CMAKE_Fortran_MODDIR_FLAG");
if(target_mod_dir && moddir_flag)
......@@ -214,7 +214,7 @@ cmCommonTargetGenerator
this->LocalGenerator->GetFortranFormat(srcfmt);
if(format == cmLocalGenerator::FortranFormatNone)
{
const char* tgtfmt = this->Target->GetProperty("Fortran_FORMAT");
const char* tgtfmt = this->GeneratorTarget->GetProperty("Fortran_FORMAT");
format = this->LocalGenerator->GetFortranFormat(tgtfmt);
}
const char* var = 0;
......
......@@ -4859,7 +4859,7 @@ bool cmGeneratorTarget::ComputeOutputDir(const std::string& config,
// Skip per-configuration subdirectory.
conf = "";
}
else if(const char* outdir = this->Target->GetProperty(propertyName))
else if(const char* outdir = this->GetProperty(propertyName))
{
// Use the user-specified output directory.
cmGeneratorExpression ge;
......
......@@ -197,7 +197,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
this->ConfigName);
if(this->Target->GetPropertyAsBool("WIN32_EXECUTABLE"))
if(this->GeneratorTarget->GetPropertyAsBool("WIN32_EXECUTABLE"))
{
this->LocalGenerator->AppendFlags
(linkFlags, this->Makefile->GetDefinition("CMAKE_CREATE_WIN32_EXE"));
......@@ -226,11 +226,11 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
// Add target-specific linker flags.
this->LocalGenerator->AppendFlags
(linkFlags, this->Target->GetProperty("LINK_FLAGS"));
(linkFlags, this->GeneratorTarget->GetProperty("LINK_FLAGS"));
std::string linkFlagsConfig = "LINK_FLAGS_";
linkFlagsConfig += cmSystemTools::UpperCase(this->ConfigName);
this->LocalGenerator->AppendFlags
(linkFlags, this->Target->GetProperty(linkFlagsConfig));
(linkFlags, this->GeneratorTarget->GetProperty(linkFlagsConfig));
this->AddModuleDefinitionFlag(linkFlags);
......
......@@ -166,11 +166,11 @@ void cmMakefileLibraryTargetGenerator::WriteSharedLibraryRules(bool relink)
std::string extraFlags;
this->LocalGenerator->AppendFlags
(extraFlags, this->Target->GetProperty("LINK_FLAGS"));
(extraFlags, this->GeneratorTarget->GetProperty("LINK_FLAGS"));
std::string linkFlagsConfig = "LINK_FLAGS_";
linkFlagsConfig += cmSystemTools::UpperCase(this->ConfigName);
this->LocalGenerator->AppendFlags
(extraFlags, this->Target->GetProperty(linkFlagsConfig));
(extraFlags, this->GeneratorTarget->GetProperty(linkFlagsConfig));
this->LocalGenerator->AddConfigVariableFlags
(extraFlags, "CMAKE_SHARED_LINKER_FLAGS", this->ConfigName);
......@@ -190,11 +190,11 @@ void cmMakefileLibraryTargetGenerator::WriteModuleLibraryRules(bool relink)
std::string extraFlags;
this->LocalGenerator->AppendFlags(extraFlags,
this->Target->GetProperty("LINK_FLAGS"));
this->GeneratorTarget->GetProperty("LINK_FLAGS"));
std::string linkFlagsConfig = "LINK_FLAGS_";
linkFlagsConfig += cmSystemTools::UpperCase(this->ConfigName);
this->LocalGenerator->AppendFlags
(extraFlags, this->Target->GetProperty(linkFlagsConfig));
(extraFlags, this->GeneratorTarget->GetProperty(linkFlagsConfig));
this->LocalGenerator->AddConfigVariableFlags
(extraFlags, "CMAKE_MODULE_LINKER_FLAGS", this->ConfigName);
this->AddModuleDefinitionFlag(extraFlags);
......@@ -213,11 +213,11 @@ void cmMakefileLibraryTargetGenerator::WriteFrameworkRules(bool relink)
std::string extraFlags;
this->LocalGenerator->AppendFlags(extraFlags,
this->Target->GetProperty("LINK_FLAGS"));
this->GeneratorTarget->GetProperty("LINK_FLAGS"));
std::string linkFlagsConfig = "LINK_FLAGS_";
linkFlagsConfig += cmSystemTools::UpperCase(this->ConfigName);
this->LocalGenerator->AppendFlags
(extraFlags, this->Target->GetProperty(linkFlagsConfig));
(extraFlags, this->GeneratorTarget->GetProperty(linkFlagsConfig));
this->LocalGenerator->AddConfigVariableFlags
(extraFlags, "CMAKE_MACOSX_FRAMEWORK_LINKER_FLAGS", this->ConfigName);
......@@ -569,7 +569,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
if (this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY &&
this->Makefile->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS"))
{
if(this->Target->GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS"))
if(this->GeneratorTarget->GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS"))
{
std::string name_of_def_file =
this->GeneratorTarget->GetSupportDirectory();
......
......@@ -667,7 +667,7 @@ cmMakefileTargetGenerator
if (!compileCommands.empty() && (lang == "C" || lang == "CXX"))
{
std::string const iwyu_prop = lang + "_INCLUDE_WHAT_YOU_USE";
const char *iwyu = this->Target->GetProperty(iwyu_prop);
const char *iwyu = this->GeneratorTarget->GetProperty(iwyu_prop);
if (iwyu && *iwyu)
{
std::string run_iwyu = "$(CMAKE_COMMAND) -E __run_iwyu --iwyu=";
......@@ -681,7 +681,7 @@ cmMakefileTargetGenerator
if (!compileCommands.empty() && (lang == "C" || lang == "CXX"))
{
std::string const clauncher_prop = lang + "_COMPILER_LAUNCHER";
const char *clauncher = this->Target->GetProperty(clauncher_prop);
const char *clauncher = this->GeneratorTarget->GetProperty(clauncher_prop);
if (clauncher && *clauncher)
{
std::vector<std::string> launcher_cmd;
......@@ -1513,7 +1513,7 @@ void cmMakefileTargetGenerator
// Add user-specified dependencies.
if(const char* linkDepends =
this->Target->GetProperty("LINK_DEPENDS"))
this->GeneratorTarget->GetProperty("LINK_DEPENDS"))
{
cmSystemTools::ExpandListArgument(linkDepends, depends);
}
......
......@@ -218,7 +218,8 @@ cmNinjaDeps cmNinjaTargetGenerator::ComputeLinkDeps() const
}
// Add user-specified dependencies.
if (const char* linkDepends = this->Target->GetProperty("LINK_DEPENDS"))
if (const char* linkDepends =
this->GeneratorTarget->GetProperty("LINK_DEPENDS"))
{
std::vector<std::string> linkDeps;
cmSystemTools::ExpandListArgument(linkDepends, linkDeps);
......@@ -410,7 +411,7 @@ cmNinjaTargetGenerator
if (!compileCmds.empty() && (lang == "C" || lang == "CXX"))
{
std::string const iwyu_prop = lang + "_INCLUDE_WHAT_YOU_USE";
const char *iwyu = this->Target->GetProperty(iwyu_prop);
const char *iwyu = this->GeneratorTarget->GetProperty(iwyu_prop);
if (iwyu && *iwyu)
{
std::string run_iwyu =
......@@ -427,7 +428,7 @@ cmNinjaTargetGenerator
if (!compileCmds.empty() && (lang == "C" || lang == "CXX"))
{
std::string const clauncher_prop = lang + "_COMPILER_LAUNCHER";
const char *clauncher = this->Target->GetProperty(clauncher_prop);
const char *clauncher = this->GeneratorTarget->GetProperty(clauncher_prop);
if (clauncher && *clauncher)
{
std::vector<std::string> launcher_cmd;
......
......@@ -90,7 +90,8 @@ void cmNinjaUtilityTargetGenerator::Generate()
} else {
std::string command =
this->GetLocalGenerator()->BuildCommandLine(commands);
const char *echoStr = this->GetTarget()->GetProperty("EchoString");
const char *echoStr =
this->GetGeneratorTarget()->GetProperty("EchoString");
std::string desc;
if (echoStr)
desc = echoStr;
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment