cmGeneratorTarget: Move HaveBuildTreeRPath from cmTarget.

This commit is contained in:
Stephen Kelly 2015-08-05 17:37:49 +02:00
parent d4a24c0e95
commit abe9505df9
5 changed files with 19 additions and 18 deletions

View File

@ -1925,7 +1925,7 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs,
(outputRuntime && this->Target->Target->HaveInstallTreeRPATH() &&
linking_for_install);
bool use_build_rpath =
(outputRuntime && this->Target->Target->HaveBuildTreeRPATH(this->Config) &&
(outputRuntime && this->Target->HaveBuildTreeRPATH(this->Config) &&
!linking_for_install);
bool use_link_rpath =
outputRuntime && linking_for_install &&

View File

@ -909,7 +909,7 @@ cmGeneratorTarget::NeedRelinkBeforeInstall(const std::string& config) const
// If either a build or install tree rpath is set then the rpath
// will likely change between the build tree and install tree and
// this target must be relinked.
return this->Target->HaveBuildTreeRPATH(config)
return this->HaveBuildTreeRPATH(config)
|| this->Target->HaveInstallTreeRPATH();
}
@ -4414,3 +4414,18 @@ cmGeneratorTarget::GetLinkImplementation(const std::string& config) const
}
return &impl;
}
//----------------------------------------------------------------------------
bool cmGeneratorTarget::HaveBuildTreeRPATH(const std::string& config) const
{
if (this->Target->GetPropertyAsBool("SKIP_BUILD_RPATH"))
{
return false;
}
if(cmLinkImplementationLibraries const* impl =
this->Target->GetLinkImplementationLibraries(config))
{
return !impl->Libraries.empty();
}
return false;
}

View File

@ -201,6 +201,8 @@ public:
cmLinkImplementation const*
GetLinkImplementation(const std::string& config) const;
bool HaveBuildTreeRPATH(const std::string& config) const;
/** Full path with trailing slash to the top-level directory
holding object files for this target. Includes the build
time config name placeholder if needed for the generator. */

View File

@ -2809,21 +2809,6 @@ void cmTarget::SetPropertyDefault(const std::string& property,
}
}
//----------------------------------------------------------------------------
bool cmTarget::HaveBuildTreeRPATH(const std::string& config) const
{
if (this->GetPropertyAsBool("SKIP_BUILD_RPATH"))
{
return false;
}
if(cmLinkImplementationLibraries const* impl =
this->GetLinkImplementationLibraries(config))
{
return !impl->Libraries.empty();
}
return false;
}
//----------------------------------------------------------------------------
bool cmTarget::HaveInstallTreeRPATH() const
{

View File

@ -294,7 +294,6 @@ public:
bool GetImplibGNUtoMS(std::string const& gnuName, std::string& out,
const char* newExt = 0) const;
bool HaveBuildTreeRPATH(const std::string& config) const;
bool HaveInstallTreeRPATH() const;
// Get the properties