From 4804e39144dc0ded9b38dbb3442b6016ac719a1a Mon Sep 17 00:00:00 2001 From: Tamar Christina Date: Mon, 19 Feb 2018 04:34:49 +0000 Subject: Haddock: support splitted include paths. (#689) --- haddock-api/src/Haddock/GhcUtils.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'haddock-api/src/Haddock') 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 -- cgit v1.2.3