Commit 69c58f8a authored by David Eichmann's avatar David Eichmann 🏋 Committed by Marge Bot

Hadrian: need CPP preprocessor dependencies #16660

Use the new -include-cpp-deps ghc option (#16521)
when generating .dependencies files in hadrian.
This is version gated as -include-cpp-deps is a
relatively new option.
parent 8a48a8a4
Pipeline #6764 passed with stages
in 539 minutes and 11 seconds
{-# LANGUAGE ScopedTypeVariables #-}
module Settings.Builders.Ghc (ghcBuilderArgs, haddockGhcArgs) where
import Data.List.Extra (splitOn)
import Hadrian.Haskell.Cabal
import Hadrian.Haskell.Cabal.Type
......@@ -131,7 +135,16 @@ ghcLinkArgs = builder (Ghc LinkHs) ? do
findHsDependencies :: Args
findHsDependencies = builder (Ghc FindHsDependencies) ? do
ways <- getLibraryWays
stage <- getStage
ghcVersion :: [Int] <- fmap read . splitOn "." <$> expr (ghcVersionStage stage)
mconcat [ arg "-M"
-- "-include-cpp-deps" is a new ish feature so is version gated.
-- Without this feature some dependencies will be missing in stage0.
-- TODO Remove version gate when minimum supported Stage0 compiler
-- is >= 8.9.0.
, ghcVersion > [8,9,0] ? arg "-include-cpp-deps"
, commonGhcArgs
, arg "-include-pkg-deps"
, arg "-dep-makefile", arg =<< getOutput
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment