Provide the state of Cabal flags in an auto-generated module
Open
Cabal: other
old-milestone: ⊥
type: enhancement
- Dominant language
- Haskell
- Stars
- 1.7k
- Forks
- 750
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 28
Description
(Imported from [Trac #836](http://hackage.haskell.org/trac/hackage/ticket/836), reported by lemming on 2011-04-24)
I would like to query the state of cabal flags at configure time without CPP hackery. I would prefer to import an autogenerated module, that contains Bool variables with the names of the Cabal flags, just like the Paths module contains the paths of installed data files.
For instance if my Cabal file contains
Flag buildExamplesand I install the package by
description: Build example executables
default: False
Flag buildTests
description: Build test suite
default: True
Flag debug
description: Compile with debug messages
default: False
$ cabal install -fdebugthen the autogenerated module shall contain
module Flags_mypkg whereMaybe this feature would also solve #778.
-- | Build example executables
buildExamples :: Bool
buildExamples = False
-- | Build test suite
buildTests :: Bool
buildTests = True
-- | Compile with debug messages
debug :: Bool
debug = True
Contributor guide
Assessment
This issue has not been assessed yet.