From 8af2688ea2de3172a7ef6d91b47d2a78fd365916 Mon Sep 17 00:00:00 2001 From: David Waern Date: Tue, 12 Aug 2008 23:11:12 +0000 Subject: Follow changes to parseDynamic/StaticFlags --- src/Haddock/GHC.hs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/Haddock/GHC.hs') 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' -- cgit v1.2.3