diff options
Diffstat (limited to 'src/CabalHelper')
-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 |