haskell - Cabal with multiple Library sections -
is possbile write cabal configuration file, contains multiple library sections?
i found in the documentation description of library section , executables sections, seems, impossible put more library section in 1 cabal configuration file.
but should if i'm developing several haskell libraries , several executables
simultaneously , want compile , test them all?
afaik, can't put more 1 library in cabal file. name specified in name field (at top level of cabal file) used name of library, there doesn't seem mechanism specifying names of additional libraries.
in practice, haven't found problem. develop each library in separate directory, own cabal file. once run cabal install on library you've developed, can referenced in cabal file executable (in build-depends section), same package on hackage.
so, example, if have 2 libraries cabal files this:
name: my-library-1 . . . and
name: my-library-2 . . . then cabal file executable can reference them this:
name: my-program . . . executable run-program main-is: main.hs build-depends: my-library1, my-library2, . . . you can require specific versions of libraries. example:
build-depends: my-library1==1.2.*, my-library2>=1.3
Comments
Post a Comment