Make `check` recognise `main-is` in conditional branches (#9768)
[cabal.git] / Cabal / src / Distribution / Types / ComponentInclude.hs
blob6999b6544d750b5718e0be21d23c1b24901dc220
1 module Distribution.Types.ComponentInclude
2 ( ComponentInclude (..)
3 , ci_id
4 , ci_pkgid
5 , ci_cname
6 ) where
8 import Distribution.Types.AnnotatedId
9 import Distribution.Types.ComponentName
10 import Distribution.Types.PackageId
12 -- Once ci_id is refined to an 'OpenUnitId' or 'DefUnitId',
13 -- the 'includeRequiresRn' is not so useful (because it
14 -- includes the requirements renaming that is no longer
15 -- needed); use 'ci_prov_renaming' instead.
16 data ComponentInclude id rn = ComponentInclude
17 { ci_ann_id :: AnnotatedId id
18 , ci_renaming :: rn
19 , ci_implicit :: Bool
20 -- ^ Did this come from an entry in @mixins@, or
21 -- was implicitly generated by @build-depends@?
24 ci_id :: ComponentInclude id rn -> id
25 ci_id = ann_id . ci_ann_id
27 ci_pkgid :: ComponentInclude id rn -> PackageId
28 ci_pkgid = ann_pid . ci_ann_id
30 -- | This should always return 'CLibName' or 'CSubLibName'
31 ci_cname :: ComponentInclude id rn -> ComponentName
32 ci_cname = ann_cname . ci_ann_id