I am a cabal newbie. I have a cabal project and in its root there is a folder clib/*
with dynamic libraries for multiple OSes:
clib/
`---my/
`---libSomething.so
`---Something.dll
`---...
And I have to link the application with these libraries (they are written in C, Go...). I refer them with extra-libraries:
cabal setting. But now I have to set the folder where they are located (./clib/my/
). I tried extra-lib-dirs:
setting in the cabal.project
but it may not be relative - so it does not work.
I supposed there is some placeholder like ${projectroot}
or similar that can be used as a prefix, but I cannot find one in cabal's documentation.
The path cannot be absolute because the code base is shared with several developers in Git repository and all of them use different OSes and file system layouts as well.
What is the convenient way to link shared objects located in sub-directories of the project (not in system standard places) for different OSes (Mac, Windows, Linux)?
If you can build from source, I recommend that. Have a look at the c-sources
/cc-options
and cxx-sources
/cxx-options
fields. If not, then newer cabal provides an extra-bundled-libraries
field that is like extra-libraries
for relative paths but appears from the documentation to be extremely restrictive on the name and location of your library.