Skip to content

Commit

Permalink
Check for ghc-options: -threaded in libraries
Browse files Browse the repository at this point in the history
It's totally unnecessary and messes up profiling in older ghc versions.
  • Loading branch information
dcoutts committed Jan 25, 2009
1 parent 8917d5f commit f70db08
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Distribution/PackageDescription/Check.hs
Expand Up @@ -455,6 +455,11 @@ checkGhcOptions pkg =
PackageDistSuspicious $
"Instead of 'ghc-options: -fglasgow-exts' it is preferable to use the 'extensions' field."

, check ("-threaded" `elem` lib_ghc_options) $
PackageDistSuspicious $
"'ghc-options: -threaded' has no effect for libraries. It should "
++ "only be used for executables."

, checkAlternatives "ghc-options" "extensions"
[ (flag, display extension) | flag <- all_ghc_options
, Just extension <- [ghcExtension flag] ]
Expand Down Expand Up @@ -491,6 +496,7 @@ checkGhcOptions pkg =
ghc_options = [ strs | bi <- allBuildInfo pkg
, (GHC, strs) <- options bi ]
all_ghc_options = concat ghc_options
lib_ghc_options = maybe [] (hcOptions GHC . libBuildInfo) (library pkg)

checkFlags :: [String] -> PackageCheck -> Maybe PackageCheck
checkFlags flags = check (any (`elem` flags) all_ghc_options)
Expand Down

0 comments on commit f70db08

Please sign in to comment.