diff options
author | Brad King <brad.king@kitware.com> | 2008-02-04 20:22:10 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-02-04 20:22:10 (GMT) |
commit | 847c8403fe23e241d7fd3a7478790938afc24a9e (patch) | |
tree | 3ef399b494caa9d489f87a4fbd683783970713c9 /Source/cmComputeLinkInformation.cxx | |
parent | c12a7e388d449e96107ba1eea8b8b2f2469ec20f (diff) | |
download | CMake-847c8403fe23e241d7fd3a7478790938afc24a9e.zip CMake-847c8403fe23e241d7fd3a7478790938afc24a9e.tar.gz CMake-847c8403fe23e241d7fd3a7478790938afc24a9e.tar.bz2 |
BUG: Added TARGET_ARCHIVES_MAY_BE_SHARED_LIBS global property to help compute proper rpath information on AIX when shared libraries have names like "libfoo.a".
Diffstat (limited to 'Source/cmComputeLinkInformation.cxx')
-rw-r--r-- | Source/cmComputeLinkInformation.cxx | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index b079f9d..10a0653 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -23,6 +23,7 @@ #include "cmLocalGenerator.h" #include "cmMakefile.h" #include "cmTarget.h" +#include "cmake.h" #include <ctype.h> @@ -222,6 +223,7 @@ cmComputeLinkInformation this->Makefile = this->Target->GetMakefile(); this->LocalGenerator = this->Makefile->GetLocalGenerator(); this->GlobalGenerator = this->LocalGenerator->GetGlobalGenerator(); + this->CMakeInstance = this->GlobalGenerator->GetCMakeInstance(); // The configuration being linked. this->Config = config; @@ -649,6 +651,11 @@ void cmComputeLinkInformation::AddSharedDepItem(std::string const& item, //---------------------------------------------------------------------------- void cmComputeLinkInformation::ComputeLinkTypeInfo() { + // Check whether archives may actually be shared libraries. + this->ArchivesMayBeShared = + this->CMakeInstance->GetPropertyAsBool( + "TARGET_ARCHIVES_MAY_BE_SHARED_LIBS"); + // First assume we cannot do link type stuff. this->LinkTypeEnabled = false; @@ -1260,8 +1267,20 @@ cmComputeLinkInformation::AddLibraryRuntimeInfo(std::string const& fullPath, std::string file = cmSystemTools::GetFilenameName(fullPath); if(!this->ExtractSharedLibraryName.find(file.c_str())) { - // This is not the name of a shared library. - return; + // On some platforms (AIX) a shared library may look static. + if(this->ArchivesMayBeShared) + { + if(!this->ExtractStaticLibraryName.find(file.c_str())) + { + // This is not the name of a shared library or archive. + return; + } + } + else + { + // This is not the name of a shared library. + return; + } } // Include this library in the runtime path ordering. |