diff --git a/Cabal/Distribution/Simple/Configure.hs b/Cabal/Distribution/Simple/Configure.hs index 656ac110cf2..3322c66235b 100644 --- a/Cabal/Distribution/Simple/Configure.hs +++ b/Cabal/Distribution/Simple/Configure.hs @@ -1603,8 +1603,12 @@ checkForeignDeps pkg lbi verbosity = do ++ collectField PD.cppOptions ++ collectField PD.ccOptions ++ [ "-I" ++ dir - | dep <- deps - , dir <- Installed.includeDirs dep ] + | dir <- ordNub [ dir + | dep <- deps + , dir <- Installed.includeDirs dep ] + -- dedupe include dirs of dependencies + -- to prevent quadratic blow-up + ] ++ [ opt | dep <- deps , opt <- Installed.ccOptions dep ]