From f9e1fef6380ecc96b49e90eed7be74072c32a577 Mon Sep 17 00:00:00 2001 From: David Waern Date: Sat, 10 Jan 2009 20:22:25 +0000 Subject: Only use needsTemplateHaskell when compiling with GHC 6.10.2 or above --- src/Haddock/Interface.hs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/Haddock/Interface.hs') diff --git a/src/Haddock/Interface.hs b/src/Haddock/Interface.hs index aa77e042..49eef96c 100644 --- a/src/Haddock/Interface.hs +++ b/src/Haddock/Interface.hs @@ -87,6 +87,7 @@ createInterfaces' modules flags instIfaceMap = do setTargets targets modgraph <- depanal [] False +#if (__GLASGOW_HASKELL__ == 610 && __GHC_PATCHLEVEL__ >= 2) || __GLASGOW_HASKELL__ >= 611 -- If template haskell is used by the package, we can not use -- HscNothing as target since we might need to run code generated from -- one or more of the modules during typechecking. @@ -98,6 +99,9 @@ createInterfaces' modules flags instIfaceMap = do let addHscC m = m { ms_hspp_opts = (ms_hspp_opts m) { hscTarget = HscC } } return (map addHscC modgraph) else return modgraph +#else + let modgraph' = modgraph +#endif let orderedMods = flattenSCCs $ topSortModuleGraph False modgraph' Nothing (ifaces, _) <- foldM (\(ifaces, modMap) modsum -> do -- cgit v1.2.3