Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flags in cabal files

Tags:

haskell

cabal

I am following the user-guide for package developing: https://www.haskell.org/cabal/users-guide/developing-packages.html#quickstart

I got stuck in the Flags section. How do I pass flags to my files? Is it just at build time? I have tried to search for it, but found no useful information - just the command option --flags.

cabal build -f debug doesn't work

Flag Debug
    Description: Enable debug support
    Manual: True
    Default: False

BenchMark bench-foo
    ghc-options:        -Wall
    type:               exitcode-stdio-1.0
    default-language:   Haskell2010
    build-depends:      base, time
    main-is:            bench-foo.hs
    if flag(debug) && os(windows)
        main-is:        bench-bar.hs
like image 494
Afonso Matos Avatar asked Aug 05 '15 01:08

Afonso Matos


1 Answers

Pass the flags to cabal configure, e.g.:

cabal configure -f debug
like image 172
ErikR Avatar answered Sep 29 '22 14:09

ErikR