diff options
author | Daniel Gröber <dxld@darkboxed.org> | 2019-01-21 23:48:46 +0100 |
---|---|---|
committer | Daniel Gröber <dxld@darkboxed.org> | 2019-01-22 03:06:51 +0100 |
commit | 59ff4e364dbd8973937c08066254dfdec1130810 (patch) | |
tree | 7bdc50a5e6874ab52644fca233751cdc6c9c961a | |
parent | 43cac04350f830676f357cead966ab68fa7851a8 (diff) |
Fix package-envs conflicting with -package flags
-rw-r--r-- | src/CabalHelper/Compiletime/Program/GHC.hs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/CabalHelper/Compiletime/Program/GHC.hs b/src/CabalHelper/Compiletime/Program/GHC.hs index e21a258..79dd1b3 100644 --- a/src/CabalHelper/Compiletime/Program/GHC.hs +++ b/src/CabalHelper/Compiletime/Program/GHC.hs @@ -139,13 +139,16 @@ invokeGhc GhcInvocation {..} = do , "-o", giOutput ] , map ("-optP"++) giCPPOptions - , case giPackageSource of - GPSAmbient -> [] - GPSPackageDBs dbs -> map ("-package-conf="++) $ unPackageDbDir <$> dbs + , if giHideAllPackages then ["-hide-all-packages"] else [] + , let packageFlags = concatMap (\p -> ["-package", p]) giPackages in + case giPackageSource of + GPSAmbient -> packageFlags + GPSPackageDBs dbs -> concat + [ map ("-package-conf="++) $ unPackageDbDir <$> dbs + , packageFlags + ] GPSPackageEnv env -> [ "-package-env=" ++ unPackageEnvFile env ] , map ("-i"++) $ nub $ "" : giIncludeDirs - , if giHideAllPackages then ["-hide-all-packages"] else [] - , concatMap (\p -> ["-package", p]) giPackages , giWarningFlags , ["--make"] , giInputs |