• Iain Nicol's avatar
    Fix: "cabal haddock" uses CPP overzealously · ba4ae3d0
    Iain Nicol authored
    Until recently we supported ancient versions of Haddock, pre v2.0.  To
    support the CPP extension with such versions, cabal had to invoke the
    CPP before invoking Haddock on the output.  For simplicity cabal would
    invoke the CPP on all Haskell files, if any Haskell file required CPP.
    However, invoking CPP on a file which does not require it can cause
    build failures.
    Haddock v2.0+ supports the CPP via GHC, and even automatically
    preprocesses any file with the {-# LANGUAGE CPP #-} pragma. Hence we
    simply need only tell Haddock to enable the CPP when the CPP is a
    package level default extension.
    Fixes issue #1808.