⬑
在ArchLinux中创建Cabal项目
要点
ghc-option要加上"-dynamic"
如果有多个executable可以把相同的部分写进common里面
示例
cabal-version: 2.4
name: projectName
version: 0.1.0.0
author: Mistivia
maintainer: i@mistivia.com
extra-source-files: CHANGELOG.md
common deps
other-modules: MyMod
build-depends: base ^>=4.16.4.0,
bytestring ==0.11.4.0,
containers ==0.6.5.1,
network ==3.2.7.0,
utf8-string ==1.0.2,
base16-bytestring ==1.0.2.0,
hs-source-dirs: app
default-language: Haskell2010
ghc-options: -dynamic
executable exec1
import: deps
main-is: Exec1.hs
executable exec2
import: deps
main-is: Exec2.hs
项目文件:
- app
- Exec1.hs
- Exec2.hd
- MyMod.hs
- projectName.cabal