Skip to content

Commit

Permalink
As in haskell#3974 and haskell#4105, but also dedupe PD.includeDirs
Browse files Browse the repository at this point in the history
… and `PD.extraLibDirs`.

Should help with big invocations as found in
NixOS/nixpkgs#41340.
  • Loading branch information
nh2 committed Jun 1, 2018
1 parent 5c9cade commit e23bab3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Cabal/Distribution/Simple/Configure.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1715,12 +1715,12 @@ checkForeignDeps pkg lbi verbosity =
-- should NOT be glomming everything together.)
++ [ "-I" ++ buildDir lbi </> "autogen" ]
-- `configure' may generate headers in the build directory
++ [ "-I" ++ buildDir lbi </> dir | dir <- collectField PD.includeDirs
++ [ "-I" ++ buildDir lbi </> dir | dir <- ordNub (collectField PD.includeDirs)
, not (isAbsolute dir)]
-- we might also reference headers from the packages directory.
++ [ "-I" ++ baseDir lbi </> dir | dir <- collectField PD.includeDirs
++ [ "-I" ++ baseDir lbi </> dir | dir <- ordNub (collectField PD.includeDirs)
, not (isAbsolute dir)]
++ [ "-I" ++ dir | dir <- collectField PD.includeDirs
++ [ "-I" ++ dir | dir <- ordNub (collectField PD.includeDirs)
, isAbsolute dir]
++ ["-I" ++ baseDir lbi]
++ collectField PD.cppOptions
Expand All @@ -1742,7 +1742,7 @@ checkForeignDeps pkg lbi verbosity =
| dep <- deps
, opt <- Installed.ccOptions dep ]

commonLdArgs = [ "-L" ++ dir | dir <- collectField PD.extraLibDirs ]
commonLdArgs = [ "-L" ++ dir | dir <- ordNub (collectField PD.extraLibDirs) ]
++ collectField PD.ldOptions
++ [ "-L" ++ dir
| dir <- ordNub [ dir
Expand Down

0 comments on commit e23bab3

Please sign in to comment.