Cabal - Expose all modules while building library

后端 未结 2 1359
死守一世寂寞
死守一世寂寞 2021-02-04 02:35

Is it possible to tell Cabal to expose all modules while building a library?

Right now I have to provide very long list of modules in the exposed-modul

2条回答
  •  野的像风
    2021-02-04 02:41

    You have to list all modules in the cabal configuration file. In your case, you just put the list of modules after exposed-modules:. There is no simpler way to write a list of modules.

    Cabal cannot automatically find the files that are part of an executable or library, so it relies on the list of modules in the configuration file. Unlike GHC, cabal cannot find modules based on import statements in the source code. If you don't list every module, then you may be able to build the project (because GHC can find source files), but other commands such as cabal sdist will not access the source files that aren't listed.

提交回复
热议问题