How to avoid recompiling in this cabal file?

我与影子孤独终老i 提交于 2019-11-30 04:44:48

In your executable section, add the library in Build-Depends so that the executable depends on the library.

There's a small gotcha, though: You also have to move the Main.hs of the executable (and any other source files specific to the executable) to a different subdirectory and specify a different Hs-Source-Dirs so that it doesn't pick up the library modules by being in the same folder.

executable HaSC
    Build-Depends: HaSC
    Main-Is: Main.hs
    Hs-Source-Dirs: foo -- Directory you moved Main.hs to

For this to work, you will need to specify Cabal-Version >= 1.8. See Cabal ticket #89 for the details.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!