cmGeneratorTarget: Move HasSOName from cmTarget.
This commit is contained in:
parent
766839c56d
commit
f0aa660772
|
@ -889,7 +889,7 @@ cmExportFileGenerator
|
||||||
{
|
{
|
||||||
std::string prop;
|
std::string prop;
|
||||||
std::string value;
|
std::string value;
|
||||||
if(target->Target->HasSOName(config))
|
if(target->HasSOName(config))
|
||||||
{
|
{
|
||||||
if(mf->IsOn("CMAKE_PLATFORM_HAS_INSTALLNAME"))
|
if(mf->IsOn("CMAKE_PLATFORM_HAS_INSTALLNAME"))
|
||||||
{
|
{
|
||||||
|
|
|
@ -656,6 +656,18 @@ void cmGeneratorTarget::GetSourceFiles(std::vector<cmSourceFile*> &files,
|
||||||
this->Target->GetSourceFiles(files, config);
|
this->Target->GetSourceFiles(files, config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
bool cmGeneratorTarget::HasSOName(const std::string& config) const
|
||||||
|
{
|
||||||
|
// soname is supported only for shared libraries and modules,
|
||||||
|
// and then only when the platform supports an soname flag.
|
||||||
|
return ((this->GetType() == cmTarget::SHARED_LIBRARY ||
|
||||||
|
this->GetType() == cmTarget::MODULE_LIBRARY) &&
|
||||||
|
!this->GetPropertyAsBool("NO_SONAME") &&
|
||||||
|
this->Makefile->GetSONameFlag(
|
||||||
|
this->Target->GetLinkerLanguage(config)));
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
std::string cmGeneratorTarget::GetSOName(const std::string& config) const
|
std::string cmGeneratorTarget::GetSOName(const std::string& config) const
|
||||||
{
|
{
|
||||||
|
@ -1407,7 +1419,7 @@ void cmGeneratorTarget::GetLibraryNames(std::string& name,
|
||||||
// Check for library version properties.
|
// Check for library version properties.
|
||||||
const char* version = this->GetProperty("VERSION");
|
const char* version = this->GetProperty("VERSION");
|
||||||
const char* soversion = this->GetProperty("SOVERSION");
|
const char* soversion = this->GetProperty("SOVERSION");
|
||||||
if(!this->Target->HasSOName(config) ||
|
if(!this->HasSOName(config) ||
|
||||||
this->Target->IsFrameworkOnApple())
|
this->Target->IsFrameworkOnApple())
|
||||||
{
|
{
|
||||||
// Versioning is supported only for shared libraries and modules,
|
// Versioning is supported only for shared libraries and modules,
|
||||||
|
|
|
@ -160,6 +160,9 @@ public:
|
||||||
std::vector<cmSourceFile*> const*
|
std::vector<cmSourceFile*> const*
|
||||||
GetSourceDepends(cmSourceFile const* sf) const;
|
GetSourceDepends(cmSourceFile const* sf) const;
|
||||||
|
|
||||||
|
/** Whether this library has soname enabled and platform supports it. */
|
||||||
|
bool HasSOName(const std::string& config) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Flags for a given source file as used in this target. Typically assigned
|
* Flags for a given source file as used in this target. Typically assigned
|
||||||
* via SET_TARGET_PROPERTIES when the property is a list of source files.
|
* via SET_TARGET_PROPERTIES when the property is a list of source files.
|
||||||
|
|
|
@ -1944,7 +1944,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
|
||||||
|
|
||||||
const char* version = target.GetProperty("VERSION");
|
const char* version = target.GetProperty("VERSION");
|
||||||
const char* soversion = target.GetProperty("SOVERSION");
|
const char* soversion = target.GetProperty("SOVERSION");
|
||||||
if(!target.HasSOName(configName) || target.IsFrameworkOnApple())
|
if(!gtgt->HasSOName(configName) || target.IsFrameworkOnApple())
|
||||||
{
|
{
|
||||||
version = 0;
|
version = 0;
|
||||||
soversion = 0;
|
soversion = 0;
|
||||||
|
|
|
@ -653,7 +653,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
|
||||||
vars.Target = target.c_str();
|
vars.Target = target.c_str();
|
||||||
vars.LinkLibraries = linkLibs.c_str();
|
vars.LinkLibraries = linkLibs.c_str();
|
||||||
vars.ObjectsQuoted = buildObjs.c_str();
|
vars.ObjectsQuoted = buildObjs.c_str();
|
||||||
if (this->Target->HasSOName(this->ConfigName))
|
if (this->GeneratorTarget->HasSOName(this->ConfigName))
|
||||||
{
|
{
|
||||||
vars.SONameFlag = this->Makefile->GetSONameFlag(linkLanguage);
|
vars.SONameFlag = this->Makefile->GetSONameFlag(linkLanguage);
|
||||||
vars.TargetSOName= targetNameSO.c_str();
|
vars.TargetSOName= targetNameSO.c_str();
|
||||||
|
|
|
@ -531,7 +531,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
|
||||||
vars["LANGUAGE_COMPILE_FLAGS"] = t;
|
vars["LANGUAGE_COMPILE_FLAGS"] = t;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (target.HasSOName(cfgName))
|
if (this->GetGeneratorTarget()->HasSOName(cfgName))
|
||||||
{
|
{
|
||||||
vars["SONAME_FLAG"] = mf->GetSONameFlag(this->TargetLinkLanguage);
|
vars["SONAME_FLAG"] = mf->GetSONameFlag(this->TargetLinkLanguage);
|
||||||
vars["SONAME"] = this->TargetNameSO;
|
vars["SONAME"] = this->TargetNameSO;
|
||||||
|
|
|
@ -3534,17 +3534,6 @@ std::string cmTarget::GetCompilePDBPath(const std::string& config) const
|
||||||
return dir + name;
|
return dir + name;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
|
||||||
bool cmTarget::HasSOName(const std::string& config) const
|
|
||||||
{
|
|
||||||
// soname is supported only for shared libraries and modules,
|
|
||||||
// and then only when the platform supports an soname flag.
|
|
||||||
return ((this->GetType() == cmTarget::SHARED_LIBRARY ||
|
|
||||||
this->GetType() == cmTarget::MODULE_LIBRARY) &&
|
|
||||||
!this->GetPropertyAsBool("NO_SONAME") &&
|
|
||||||
this->Makefile->GetSONameFlag(this->GetLinkerLanguage(config)));
|
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
bool cmTarget::HasMacOSXRpathInstallNameDir(const std::string& config) const
|
bool cmTarget::HasMacOSXRpathInstallNameDir(const std::string& config) const
|
||||||
{
|
{
|
||||||
|
|
|
@ -386,9 +386,6 @@ public:
|
||||||
/** Get the path for the MSVC /Fd option for this target. */
|
/** Get the path for the MSVC /Fd option for this target. */
|
||||||
std::string GetCompilePDBPath(const std::string& config="") const;
|
std::string GetCompilePDBPath(const std::string& config="") const;
|
||||||
|
|
||||||
/** Whether this library has soname enabled and platform supports it. */
|
|
||||||
bool HasSOName(const std::string& config) const;
|
|
||||||
|
|
||||||
/** Whether this library has \@rpath and platform supports it. */
|
/** Whether this library has \@rpath and platform supports it. */
|
||||||
bool HasMacOSXRpathInstallNameDir(const std::string& config) const;
|
bool HasMacOSXRpathInstallNameDir(const std::string& config) const;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue