aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/src/Haddock/GhcUtils.hs
diff options
context:
space:
mode:
authorTamar Christina <Mistuke@users.noreply.github.com>2018-02-19 04:34:49 +0000
committerAlexander Biehl <alexbiehl@gmail.com>2018-02-19 05:34:49 +0100
commit4804e39144dc0ded9b38dbb3442b6016ac719a1a (patch)
tree8e927e69b6b25a6002e161e89f723f3f7fca4e8e /haddock-api/src/Haddock/GhcUtils.hs
parent06fc4934e96bd2e647496ec0082d6ef362328f64 (diff)
Haddock: support splitted include paths. (#689)
Diffstat (limited to 'haddock-api/src/Haddock/GhcUtils.hs')
-rw-r--r--haddock-api/src/Haddock/GhcUtils.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/haddock-api/src/Haddock/GhcUtils.hs b/haddock-api/src/Haddock/GhcUtils.hs
index 17c92688..b3260fd5 100644
--- a/haddock-api/src/Haddock/GhcUtils.hs
+++ b/haddock-api/src/Haddock/GhcUtils.hs
@@ -28,6 +28,7 @@ import Module
import HscTypes
import GHC
import Class
+import DynFlags
moduleString :: Module -> String
@@ -282,7 +283,8 @@ minimalDef n = do
setObjectDir, setHiDir, setStubDir, setOutputDir :: String -> DynFlags -> DynFlags
setObjectDir f d = d{ objectDir = Just f}
setHiDir f d = d{ hiDir = Just f}
-setStubDir f d = d{ stubDir = Just f, includePaths = f : includePaths d }
+setStubDir f d = d{ stubDir = Just f
+ , includePaths = addGlobalInclude (includePaths d) [f] }
-- -stubdir D adds an implicit -I D, so that gcc can find the _stub.h file
-- \#included from the .hc file when compiling with -fvia-C.
setOutputDir f = setObjectDir f . setHiDir f . setStubDir f