summaryrefslogtreecommitdiffstats
path: root/Source/cmComputeLinkInformation.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-02-01 13:56:00 (GMT)
committerBrad King <brad.king@kitware.com>2008-02-01 13:56:00 (GMT)
commit82fcaebe2804f88cfee258ab10003c34a9cee9da (patch)
tree8bb77511530f9da1e38e79ad85637cddeba77977 /Source/cmComputeLinkInformation.h
parentf28f1585f663314648e608e5f156d22d7b1e5811 (diff)
downloadCMake-82fcaebe2804f88cfee258ab10003c34a9cee9da.zip
CMake-82fcaebe2804f88cfee258ab10003c34a9cee9da.tar.gz
CMake-82fcaebe2804f88cfee258ab10003c34a9cee9da.tar.bz2
ENH: Pass dependent library search path to linker on some platforms.
- Move runtime path ordering out of cmComputeLinkInformation into its own class cmOrderRuntimeDirectories. - Create an instance of cmOrderRuntimeDirectories for runtime path ordering and another instance for dependent library path ordering. - Replace CMAKE_DEPENDENT_SHARED_LIBRARY_MODE with explicit CMAKE_LINK_DEPENDENT_LIBRARY_FILES boolean. - Create CMAKE_LINK_DEPENDENT_LIBRARY_DIRS boolean. - Create variables to specify -rpath-link flags: CMAKE_SHARED_LIBRARY_RPATH_LINK_<LANG>_FLAG CMAKE_EXECUTABLE_RPATH_LINK_<LANG>_FLAG - Enable -rpath-link flag on Linux and QNX. - Documentation and error message updates
Diffstat (limited to 'Source/cmComputeLinkInformation.h')
-rw-r--r--Source/cmComputeLinkInformation.h53
1 files changed, 12 insertions, 41 deletions
diff --git a/Source/cmComputeLinkInformation.h b/Source/cmComputeLinkInformation.h
index 2bbe05d..c5f3778 100644
--- a/Source/cmComputeLinkInformation.h
+++ b/Source/cmComputeLinkInformation.h
@@ -25,6 +25,7 @@ class cmGlobalGenerator;
class cmLocalGenerator;
class cmMakefile;
class cmTarget;
+class cmOrderRuntimeDirectories;
/** \class cmComputeLinkInformation
* \brief Compute link information for a target in one configuration.
@@ -33,6 +34,7 @@ class cmComputeLinkInformation
{
public:
cmComputeLinkInformation(cmTarget* target, const char* config);
+ ~cmComputeLinkInformation();
bool Compute();
struct Item
@@ -57,8 +59,12 @@ public:
std::string GetChrpathString();
std::string GetChrpathTool();
std::set<cmTarget*> const& GetSharedLibrariesLinked();
+
+ std::string const& GetRPathLinkFlag() const { return this->RPathLinkFlag; }
+ std::string GetRPathLinkString();
private:
- void AddItem(std::string const& item, cmTarget* tgt, bool isSharedDep);
+ void AddItem(std::string const& item, cmTarget* tgt);
+ void AddSharedDepItem(std::string const& item, cmTarget* tgt);
// Output information.
ItemVector Items;
@@ -96,6 +102,7 @@ private:
std::string RuntimeSep;
std::string RuntimeAlways;
bool RuntimeUseChrpath;
+ std::string RPathLinkFlag;
SharedDepMode SharedDependencyMode;
// Link type adjustment.
@@ -143,7 +150,6 @@ private:
void AddLinkerSearchDirectories(std::vector<std::string> const& dirs);
std::set<cmStdString> DirectoriesEmmitted;
std::set<cmStdString> ImplicitLinkDirs;
- std::vector<std::string> SharedDependencyDirectories;
// Linker search path compatibility mode.
std::vector<std::string> OldLinkDirs;
@@ -151,48 +157,13 @@ private:
bool HaveUserFlagItem;
// Runtime path computation.
- struct LibraryRuntimeEntry
- {
- // The file name of the library.
- std::string FileName;
-
- // The soname of the shared library if it is known.
- std::string SOName;
-
- // The directory in which the library is supposed to be found.
- std::string Directory;
-
- // The index assigned to the directory.
- int DirectoryIndex;
- };
- bool RuntimeSearchPathComputed;
- std::vector<LibraryRuntimeEntry> LibraryRuntimeInfo;
- std::set<cmStdString> LibraryRuntimeInfoEmmitted;
- std::vector<std::string> RuntimeDirectories;
- std::map<cmStdString, int> RuntimeDirectoryIndex;
- std::vector<int> RuntimeDirectoryVisited;
+ cmOrderRuntimeDirectories* OrderRuntimeSearchPath;
void AddLibraryRuntimeInfo(std::string const& fullPath, cmTarget* target);
void AddLibraryRuntimeInfo(std::string const& fullPath,
const char* soname = 0);
- void CollectRuntimeDirectories();
- int AddRuntimeDirectory(std::string const& dir);
- void FindConflictingLibraries();
- void FindDirectoriesForLib(unsigned int lri);
- void OrderRuntimeSearchPath();
- void VisitRuntimeDirectory(unsigned int i);
- void DiagnoseCycle();
- bool CycleDiagnosed;
- int WalkId;
-
- // Adjacency-list representation of runtime path ordering graph.
- // This maps from directory to those that must come *before* it.
- // Each entry that must come before is a pair. The first element is
- // the index of the directory that must come first. The second
- // element is the index of the runtime library that added the
- // constraint.
- typedef std::pair<int, int> RuntimeConflictPair;
- struct RuntimeConflictList: public std::vector<RuntimeConflictPair> {};
- std::vector<RuntimeConflictList> RuntimeConflictGraph;
+
+ // Dependent library path computation.
+ cmOrderRuntimeDirectories* OrderDependentRPath;
};
#endif