I made my own cabal package (let's call it package-1) with two targets, a library and a executable. The library section has a build-depends list, and the executable has another build-depends list that is much larger.
Now I create package-2, which lists package-1 in its build-depends section. I would like to only bring in the dependencies listed in the library target of package-1. But it seems to bring in all the dependencies listed in all the sections of package-1, including the dependencies for the executable target.
Is there any way to prune the dependency graph to just the library inside package-1, or do I have to resort to breaking out that library target into a separate standalone package?
You can put Buildable: False
to executable, and then build it explicitly when needed with cabal build Foo
, or via flag (cabal configure -fbuild-foo
or -fbuild-executables
).
Example that might be helpful: Cabal Multiple Executables
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With