getCompilerOptions handles package-db options.

This commit is contained in:
Kazu Yamamoto
2013-09-20 17:15:41 +09:00
parent 46245fb694
commit 5f0fcd0442
8 changed files with 76 additions and 62 deletions

View File

@@ -17,18 +17,16 @@ import Prelude
-- | Obtaining debug information.
debugInfo :: Options
-> Cradle
-> GHCVersion
-> FilePath -- ^ A target file.
-> IO String
debugInfo opt cradle ver fileName = unlines <$> withGHC fileName (debug opt cradle ver fileName)
debugInfo opt cradle fileName = unlines <$> withGHC fileName (debug opt cradle fileName)
-- | Obtaining debug information.
debug :: Options
-> Cradle
-> GHCVersion
-> FilePath -- ^ A target file.
-> Ghc [String]
debug opt cradle ver fileName = do
debug opt cradle fileName = do
CompilerOptions gopts incDir pkgs <-
if cabal then
liftIO (fromCabalFile ||> return simpleCompilerOption)
@@ -39,8 +37,7 @@ debug opt cradle ver fileName = do
setTargetFiles [fileName]
pure . canCheckFast <$> depanal [] False
return [
"GHC version: " ++ ver
, "Current directory: " ++ currentDir
"Current directory: " ++ currentDir
, "Cabal file: " ++ cabalFile
, "GHC options: " ++ unwords gopts
, "Include directories: " ++ unwords incDir