Compile part of all dependencies as shared libraries

Say I got (regular sources) libraries Aand Band an executable E, which depends on both.

Now I want to Einclude object files Adirectly, while I Bshould add as a shared library (specific use: Bcontains common types of plugin architecture). How do I do this with existing tools, preferably stack?

Is this possible or is it rather the choice of "all or nothing" (use only shared libraries or link everything into the same binary file)?


Optimally, I would like to indicate for each dependency if it should be connected statically or dynamically. In addition, this should probably go into the file .cabal, but we should work with what we got ...

(Well, technically, both are statically linked, but in the second case, the object code is separated in different files, you get the idea).

+4
source share

Source: https://habr.com/ru/post/1653872/


All Articles