diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-08-04 17:19:45 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-08-05 16:20:46 (GMT) |
commit | f0aa660772565545cbcda9ed8ae946b8d5097416 (patch) | |
tree | bb2cebad21b46bd465c4e5aaf16654a40e88576e | |
parent | 766839c56da82e12b6986fb5cf7c8d86442615bc (diff) | |
download | CMake-f0aa660772565545cbcda9ed8ae946b8d5097416.zip CMake-f0aa660772565545cbcda9ed8ae946b8d5097416.tar.gz CMake-f0aa660772565545cbcda9ed8ae946b8d5097416.tar.bz2 |
cmGeneratorTarget: Move HasSOName from cmTarget.
-rw-r--r-- | Source/cmExportFileGenerator.cxx | 2 | ||||
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 14 | ||||
-rw-r--r-- | Source/cmGeneratorTarget.h | 3 | ||||
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 2 | ||||
-rw-r--r-- | Source/cmMakefileLibraryTargetGenerator.cxx | 2 | ||||
-rw-r--r-- | Source/cmNinjaNormalTargetGenerator.cxx | 2 | ||||
-rw-r--r-- | Source/cmTarget.cxx | 11 | ||||
-rw-r--r-- | Source/cmTarget.h | 3 |
8 files changed, 20 insertions, 19 deletions
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index 8a2cf4b..e3652c5 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -889,7 +889,7 @@ cmExportFileGenerator { std::string prop; std::string value; - if(target->Target->HasSOName(config)) + if(target->HasSOName(config)) { if(mf->IsOn("CMAKE_PLATFORM_HAS_INSTALLNAME")) { diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 31c2df1..2b3ebee 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -657,6 +657,18 @@ void cmGeneratorTarget::GetSourceFiles(std::vector<cmSourceFile*> &files, } //---------------------------------------------------------------------------- +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 { if(this->Target->IsImported()) @@ -1407,7 +1419,7 @@ void cmGeneratorTarget::GetLibraryNames(std::string& name, // Check for library version properties. const char* version = this->GetProperty("VERSION"); const char* soversion = this->GetProperty("SOVERSION"); - if(!this->Target->HasSOName(config) || + if(!this->HasSOName(config) || this->Target->IsFrameworkOnApple()) { // Versioning is supported only for shared libraries and modules, diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index 7fb7c32..9254265 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -160,6 +160,9 @@ public: std::vector<cmSourceFile*> 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 * via SET_TARGET_PROPERTIES when the property is a list of source files. diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index b44848c..d7ae36d 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -1944,7 +1944,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target, const char* version = target.GetProperty("VERSION"); const char* soversion = target.GetProperty("SOVERSION"); - if(!target.HasSOName(configName) || target.IsFrameworkOnApple()) + if(!gtgt->HasSOName(configName) || target.IsFrameworkOnApple()) { version = 0; soversion = 0; diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx index 26273ee..7d0dc49 100644 --- a/Source/cmMakefileLibraryTargetGenerator.cxx +++ b/Source/cmMakefileLibraryTargetGenerator.cxx @@ -653,7 +653,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules vars.Target = target.c_str(); vars.LinkLibraries = linkLibs.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.TargetSOName= targetNameSO.c_str(); diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 5d86091..2586b31 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -531,7 +531,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() vars["LANGUAGE_COMPILE_FLAGS"] = t; } - if (target.HasSOName(cfgName)) + if (this->GetGeneratorTarget()->HasSOName(cfgName)) { vars["SONAME_FLAG"] = mf->GetSONameFlag(this->TargetLinkLanguage); vars["SONAME"] = this->TargetNameSO; diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 60fe7e4..e1b3e94 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -3535,17 +3535,6 @@ std::string cmTarget::GetCompilePDBPath(const std::string& config) const } //---------------------------------------------------------------------------- -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 install_name_is_rpath = false; diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 15dfb4a..e89a212 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -386,9 +386,6 @@ public: /** Get the path for the MSVC /Fd option for this target. */ 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. */ bool HasMacOSXRpathInstallNameDir(const std::string& config) const; |