Skip to content

Commit

Permalink
--coverage enables -fhpc despite apply-ghc-options
Browse files Browse the repository at this point in the history
  • Loading branch information
mgsloan committed Nov 24, 2015
1 parent d38f5ae commit fb92cd4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
7 changes: 0 additions & 7 deletions src/Stack/Options.hs
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,10 @@ benchOptsParser = BenchmarkOpts
<*> switch (long "no-run-benchmarks" <>
help "Disable running of benchmarks. (Benchmarks will still be built.)")

addCoverageFlags :: BuildOpts -> BuildOpts
addCoverageFlags bopts
| toCoverage $ boptsTestOpts bopts
= bopts { boptsGhcOptions = "-fhpc" : boptsGhcOptions bopts }
| otherwise = bopts

-- | Parser for build arguments.
buildOptsParser :: Command
-> Parser BuildOpts
buildOptsParser cmd =
fmap addCoverageFlags $
BuildOpts <$> target <*> libProfiling <*> exeProfiling <*>
haddock <*> haddockDeps <*> dryRun <*> ghcOpts <*>
flags <*> copyBins <*> preFetch <*> buildSubset <*>
Expand Down
1 change: 1 addition & 0 deletions src/Stack/Types/Build.hs
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,7 @@ configureOptsNoDir econfig bco deps wanted isLocal package = concat
allGhcOptions = concat
[ Map.findWithDefault [] Nothing (configGhcOptions config)
, Map.findWithDefault [] (Just $ packageName package) (configGhcOptions config)
, concat [["-fhpc", "-fforce-recomp"] | isLocal && toCoverage (boptsTestOpts bopts)]
, if includeExtraOptions
then boptsGhcOptions bopts
else []
Expand Down

0 comments on commit fb92cd4

Please sign in to comment.