Commit d9b45c86 authored by ttuegel's avatar ttuegel Committed by tibbe

Fix backward compat option --enable-library-coverage

(cherry picked from commit 66dade37)
parent a9620bf5
......@@ -296,13 +296,7 @@ localBuildInfoFile distPref = distPref </> "setup-config"
configure :: (GenericPackageDescription, HookedBuildInfo)
-> ConfigFlags -> IO LocalBuildInfo
configure (pkg_descr0, pbi) cfg
= do unless (configLibCoverage cfg == NoFlag) $ do
let enable | fromFlag (configLibCoverage cfg) = "enable"
| otherwise = "disable"
die $ "Option --" ++ enable ++ "-library-coverage is obsolete! "
++ "Please use --" ++ enable ++ "-coverage instead."
let distPref = fromFlag (configDistPref cfg)
= do let distPref = fromFlag (configDistPref cfg)
buildDir' = distPref </> "build"
verbosity = fromFlag (configVerbosity cfg)
......@@ -315,6 +309,13 @@ configure (pkg_descr0, pbi) cfg
("The flag --" ++ enable ++ "-executable-profiling is deprecated. "
++ "Please use --" ++ enable ++ "-profiling instead.")
unless (configLibCoverage cfg == NoFlag) $ do
let enable | fromFlag (configLibCoverage cfg) = "enable"
| otherwise = "disable"
warn verbosity
("The flag --" ++ enable ++ "-library-coverage is deprecated. "
++ "Please use --" ++ enable ++ "-coverage instead.")
createDirectoryIfMissingVerbose (lessVerbose verbosity) True distPref
let programsConfig = mkProgramsConfig cfg (configPrograms cfg)
......@@ -653,7 +654,7 @@ configure (pkg_descr0, pbi) cfg
else return True
let lbi = LocalBuildInfo {
configFlags = cfg,
configFlags = cfg',
extraConfigArgs = [], -- Currently configure does not
-- take extra args, but if it
-- did they would go here.
......
......@@ -316,7 +316,7 @@ data ConfigFlags = ConfigFlags {
configTests :: Flag Bool, -- ^Enable test suite compilation
configBenchmarks :: Flag Bool, -- ^Enable benchmark compilation
configCoverage :: Flag Bool, -- ^Enable program coverage
configLibCoverage :: Flag Bool, -- ^OBSOLETE. Just used to signal error.
configLibCoverage :: Flag Bool, -- ^Enable program coverage (deprecated)
configExactConfiguration :: Flag Bool,
-- ^All direct dependencies and flags are provided on the command line by
-- the user via the '--dependency' and '--flags' options.
......@@ -584,7 +584,7 @@ configureOptions showOrParseArgs =
(boolOpt [] [])
,option "" ["library-coverage"]
"build package with Haskell Program Coverage. (GHC only) (OBSOLETE)"
"build package with Haskell Program Coverage. (GHC only) (DEPRECATED)"
configLibCoverage (\v flags -> flags { configLibCoverage = v })
(boolOpt [] [])
......
......@@ -389,6 +389,8 @@ filterConfigureFlags flags cabalLibVersion
, configProfExe = configProf flags
, configProfLib =
mappend (configProf flags) (configProfLib flags)
, configCoverage = NoFlag
, configLibCoverage = configCoverage flags
}
-- Cabal < 1.19.2 doesn't know about '--exact-configuration'.
flags_1_19_1 = flags_1_20_0 { configExactConfiguration = NoFlag }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment