Support GHC 9.12
[cabal.git] / Cabal / src / Distribution / Types / TargetInfo.hs
bloba743b0b21b0fd01bb0eeae58ebb006ff5cf583bd
1 {-# LANGUAGE DeriveGeneric #-}
2 {-# LANGUAGE TypeFamilies #-}
4 module Distribution.Types.TargetInfo
5 ( TargetInfo (..)
6 ) where
8 import Distribution.Compat.Prelude
9 import Prelude ()
11 import Distribution.Types.Component
12 import Distribution.Types.ComponentLocalBuildInfo
13 import Distribution.Types.UnitId
15 import Distribution.Compat.Graph (IsNode (..))
17 -- | The 'TargetInfo' contains all the information necessary to build a
18 -- specific target (e.g., component/module/file) in a package. In
19 -- principle, one can get the 'Component' from a
20 -- 'ComponentLocalBuildInfo' and 'LocalBuildInfo', but it is much more
21 -- convenient to have the component in hand.
22 data TargetInfo = TargetInfo
23 { targetCLBI :: ComponentLocalBuildInfo
24 , targetComponent :: Component
25 -- TODO: BuildTargets supporting parsing these is dumb,
26 -- we don't have support for compiling single modules or
27 -- file paths. Accommodating it now is premature
28 -- generalization. Figure it out later.
29 -- targetSub :: Maybe (Either ModuleName FilePath)
31 deriving (Generic, Show)
33 instance Binary TargetInfo
34 instance Structured TargetInfo
36 instance IsNode TargetInfo where
37 type Key TargetInfo = UnitId
38 nodeKey = nodeKey . targetCLBI
39 nodeNeighbors = nodeNeighbors . targetCLBI