@@ -62,11 +62,13 @@ generateBuildModule flags pkg lbi = do
6262 let includeArgs = map ("-I"++) $ includeDirs libBI
6363
6464 -- CPP includes, i.e. include cabal_macros.h
65− let cppFlags = [ "-optP-include", "-optP" ++ libAutogenDir ++ "/cabal_macros.h" ]
65+ let cppFlags = map ("-optP"++) $
66+ [ "-include", libAutogenDir ++ "/cabal_macros.h" ]
67+ ++ cppOptions libBI
6668
6769 -- Actually we need to check whether testName suite == "doctests"
6870 -- pending https://github.com/haskell/cabal/pull/4229 getting into GHC HEAD tree
69− withTestLBI pkg lbi $ \suite suitecfg -> when (testName suite == testName suite) $ do
71+ withTestLBI pkg lbi $ \suite suitecfg -> when (testName suite == "doctests") $ do
7072
7173 -- get and create autogen dir
7274#if MIN_VERSION_Cabal(1,25,0)