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
Pass the flags to cabal configure
, e.g.:
cabal configure -f debug
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With