refactor: carry run paths as directories, not -Wl,-rpath flags
ExternalOutputs put an -Wl,-rpath,<dir> per library directory of a CMake external into its link flags, and the flags travelled up the dependency graph in BuildResult::libs to every link that consumed them: an executable's or a shared library's, and that of the project.so LoadProject links against a project file's pragma dependencies. Whether a program should record those directories depends on how it is packaged: a Flatpak has to load its libraries from its own files/lib instead, and has to know the directories to copy them from. ExternalBuildResult and BuildResult now carry them as runPaths, merged up the graph beside libs, and all three links turn each into an -Wl,-rpath as before, so the link commands differ only in the order of their flags. PragmaSharedExternal holds project.so's link to them.
This commit is contained in:
parent
06ee1da796
commit
aa6b555395
5 changed files with 37 additions and 11 deletions
|
|
@ -53,6 +53,10 @@ export namespace Crafter {
|
|||
// dirs so headers a dep exposes in its public modules are reachable
|
||||
// when a consumer #includes them directly. Propagates transitively.
|
||||
std::set<std::string> publicCompileFlags;
|
||||
// Absolute directories the shared libraries this links against are
|
||||
// loaded from at run time, its dependencies' included. An executable
|
||||
// or shared library linked from them records each one as a run path.
|
||||
std::set<std::string> runPaths;
|
||||
};
|
||||
|
||||
struct Define {
|
||||
|
|
|
|||
Loading…
Reference in a new issue