aboutsummaryrefslogtreecommitdiff
path: root/src/Haddock
diff options
context:
space:
mode:
Diffstat (limited to 'src/Haddock')
-rw-r--r--src/Haddock/GHC.hs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/Haddock/GHC.hs b/src/Haddock/GHC.hs
index 742c5f77..6ea72a29 100644
--- a/src/Haddock/GHC.hs
+++ b/src/Haddock/GHC.hs
@@ -31,7 +31,8 @@ import StaticFlags
-- compilation and linking.
startGhc :: String -> [String] -> IO (Session, DynFlags)
startGhc libDir flags = do
- restFlags <- parseStaticFlags flags
+ -- TODO: handle warnings?
+ (restFlags, _) <- parseStaticFlags flags
session <- newSession (Just libDir)
dynflags <- getSessionDynFlags session
let dynflags' = dopt_set dynflags Opt_Haddock
@@ -91,7 +92,12 @@ loadPackages session pkgStrs = do
-- | Try to parse dynamic GHC flags
parseGhcFlags dynflags flags origFlags = do
+ -- TODO: handle warnings?
+#if __GLASGOW_HASKELL__ >= 609
+ (dynflags', rest, _) <- parseDynamicFlags dynflags flags
+#else
(dynflags', rest) <- parseDynamicFlags dynflags flags
+#endif
if not (null rest)
then throwE ("Couldn't parse GHC options: " ++ (unwords origFlags))
else return dynflags'