Add extra include paths when invoking ghc-cabal (#526)
authorAndrey Mokhov <andrey.mokhov@gmail.com>
Wed, 14 Mar 2018 19:34:29 +0000 (19:34 +0000)
committerGitHub <noreply@github.com>
Wed, 14 Mar 2018 19:34:29 +0000 (19:34 +0000)
See #523

src/Settings/Builders/GhcCabal.hs

index bfb84a7..78b4587 100644 (file)
@@ -56,13 +56,17 @@ configureArgs :: Args
 configureArgs = do
     top  <- expr topDirectory
     root <- getBuildRoot
+    pkg  <- getPackage
     let conf key expr = do
             values <- unwords <$> expr
             not (null values) ?
                 arg ("--configure-option=" ++ key ++ "=" ++ values)
         cFlags   = mconcat [ remove ["-Werror"] cArgs
                            , getStagedSettingList ConfCcArgs
-                           , arg $ "-I" ++ top -/- root -/- generatedDir ]
+                           , arg $ "-I" ++ top -/- root -/- generatedDir
+                           -- See https://github.com/snowleopard/hadrian/issues/523
+                           , arg $ "-I" ++ top -/- pkgPath pkg
+                           , arg $ "-I" ++ top -/- "includes" ]
         ldFlags  = ldArgs  <> (getStagedSettingList ConfGccLinkerArgs)
         cppFlags = cppArgs <> (getStagedSettingList ConfCppArgs)
     cldFlags <- unwords <$> (cFlags <> ldFlags)