aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMateusz Kowalczyk <fuuzetsu@fuuzetsu.co.uk>2013-09-04 21:21:40 +0100
committerSimon Hengel <sol@typeful.net>2013-09-18 22:43:34 +0200
commitc953c649da38f78249fe67986d55784a020a1965 (patch)
tree5161f55f30fc2829314aee7f5aac8e3ee33ef452 /src
parent51315107171402cf2bef93d5ff06c87d070a078b (diff)
Fixes #256
We inject -dynamic-too into flags before we run all our actions in the GHC monad.
Diffstat (limited to 'src')
-rw-r--r--src/Haddock.hs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/Haddock.hs b/src/Haddock.hs
index 5f5b1156..1deb6408 100644
--- a/src/Haddock.hs
+++ b/src/Haddock.hs
@@ -136,7 +136,14 @@ haddock args = handleTopExceptions $ do
shortcutFlags flags
qual <- case qualification flags of {Left msg -> throwE msg; Right q -> return q}
- withGhc' flags $ do
+ -- inject dynamic-too into flags before we proceed
+ flags' <- withGhc' flags $ do
+ df <- getDynFlags
+ case lookup "GHC Dynamic" (compilerInfo df) of
+ Just "YES" -> return $ Flag_OptGhc "-dynamic-too" : flags
+ _ -> return flags
+
+ withGhc' flags' $ do
dflags <- getDynFlags