disabledFlags

This commit is contained in:
Michael Snoyman 2013-02-13 15:52:39 +02:00
parent 7d7108b05a
commit 3b612807ec
3 changed files with 6 additions and 1 deletions

View File

@ -128,7 +128,9 @@ loadPackageDB settings core deps = do
where
checkCond' (Var (OS os)) = os == buildOS
checkCond' (Var (Arch arch)) = arch == buildArch
checkCond' (Var (Flag flag)) = flag `elem` flags'
checkCond' (Var (Flag flag@(FlagName flag'))) =
flag' `Set.notMember` disabledFlags settings &&
flag `elem` flags'
checkCond' (Var (Impl compiler range)) =
compiler == GHC && withinRange targetCompilerVersion range
checkCond' (Lit b) = b

View File

@ -23,6 +23,7 @@ defaultSelectSettings = SelectSettings
, requireHaskellPlatform = True
, excludedPackages = empty
, flags = Set.fromList $ words "blaze_html_0_5"
, disabledFlags = Set.fromList $ words "bytestring-in-base"
, allowedPackage = const $ Right ()
, useGlobalDatabase = False
}

View File

@ -93,6 +93,8 @@ data SelectSettings = SelectSettings
{ haskellPlatformCabal :: FilePath
, flags :: Set String
-- ^ Compile flags which should be turned on.
, disabledFlags :: Set String
-- ^ Compile flags which should always be disabled.
, extraCore :: Set PackageName
, requireHaskellPlatform :: Bool
, allowedPackage :: GenericPackageDescription -> Either String ()