Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions Cabal/Distribution/Simple/GHC.hs
Original file line number Diff line number Diff line change
Expand Up @@ -151,16 +151,21 @@ configure verbosity hcPath hcPkgPath conf0 = do

ghcInfo <- Internal.getGhcInfo verbosity implInfo ghcProg
let ghcInfoMap = Map.fromList ghcInfo
extensions = -- workaround https://ghc.haskell.org/ticket/11214
filterExt JavaScriptFFI $
-- see 'filterExtTH' comment below
filterExtTH $ extensions0

-- starting with GHC 8.0, `TemplateHaskell` will be omitted from
-- `--supported-extensions` when it's not available.
-- for older GHCs we can use the "Have interpreter" property to
-- filter out `TemplateHaskell`
extensions | ghcVersion < mkVersion [8]
, Just "NO" <- Map.lookup "Have interpreter" ghcInfoMap
= filter ((/= EnableExtension TemplateHaskell) . fst)
extensions0
| otherwise = extensions0
filterExtTH | ghcVersion < mkVersion [8]
, Just "NO" <- Map.lookup "Have interpreter" ghcInfoMap
= filterExt TemplateHaskell
| otherwise = id

filterExt ext = filter ((/= EnableExtension ext) . fst)

let comp = Compiler {
compilerId = CompilerId GHC ghcVersion,
Expand Down