Copyright | Isaac Jones 2003-2004 |
---|---|
License | BSD3 |
Maintainer | cabal-devel@haskell.org |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
This has an enumeration of the various compilers that Cabal knows about. It also specifies the default compiler. Sadly you'll often see code that does case analysis on this compiler flavour enumeration like:
case compilerFlavor comp of GHC -> GHC.getInstalledPackages verbosity packageDb progdb
Obviously it would be better to use the proper Compiler
abstraction
because that would keep all the compiler-specific code together.
Unfortunately we cannot make this change yet without breaking the
UserHooks
api, which would break all custom Setup.hs
files, so for the
moment we just have to live with this deficiency. If you're interested, see
ticket #57.
Synopsis
- data CompilerFlavor
- buildCompilerId :: CompilerId
- buildCompilerFlavor :: CompilerFlavor
- defaultCompilerFlavor :: Maybe CompilerFlavor
- classifyCompilerFlavor :: String -> CompilerFlavor
- knownCompilerFlavors :: [CompilerFlavor]
- data PerCompilerFlavor v = PerCompilerFlavor v v
- perCompilerFlavorToList :: PerCompilerFlavor v -> [(CompilerFlavor, v)]
- data CompilerId = CompilerId CompilerFlavor Version
- data CompilerInfo = CompilerInfo {}
- unknownCompilerInfo :: CompilerId -> AbiTag -> CompilerInfo
- data AbiTag
- abiTagString :: AbiTag -> String
Compiler flavor
data CompilerFlavor Source #
Instances
defaultCompilerFlavor :: Maybe CompilerFlavor Source #
The default compiler flavour to pick when compiling stuff. This defaults to the compiler used to build the Cabal lib.
However if it's not a recognised compiler then it's Nothing
and the user
will have to specify which compiler they want.
Per compiler flavor
data PerCompilerFlavor v Source #
PerCompilerFlavor
carries only info per GHC and GHCJS
Cabal parses only ghc-options
and ghcjs-options
, others are omitted.
Instances
perCompilerFlavorToList :: PerCompilerFlavor v -> [(CompilerFlavor, v)] Source #
Compiler id
data CompilerId Source #
Instances
Compiler info
data CompilerInfo Source #
Compiler information used for resolving configurations. Some fields can be set to Nothing to indicate that the information is unknown.
CompilerInfo | |
|
Instances
unknownCompilerInfo :: CompilerId -> AbiTag -> CompilerInfo Source #
Make a CompilerInfo of which only the known information is its CompilerId, its AbiTag and that it does not claim to be compatible with other compiler id's.
Instances
Parsec AbiTag # | |
Defined in Distribution.Compiler parsec :: CabalParsing m => m AbiTag Source # | |
Pretty AbiTag # | |
Defined in Distribution.Compiler | |
Structured AbiTag # | |
Defined in Distribution.Compiler | |
Generic AbiTag # | |
Read AbiTag # | |
Show AbiTag # | |
Binary AbiTag # | |
Eq AbiTag # | |
type Rep AbiTag # | |
Defined in Distribution.Compiler type Rep AbiTag = D1 ('MetaData "AbiTag" "Distribution.Compiler" "Cabal-3.5.0.0" 'False) (C1 ('MetaCons "NoAbiTag" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "AbiTag" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String))) |
abiTagString :: AbiTag -> String Source #