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 where
checkCond' (Var (OS os)) = os == buildOS checkCond' (Var (OS os)) = os == buildOS
checkCond' (Var (Arch arch)) = arch == buildArch 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)) = checkCond' (Var (Impl compiler range)) =
compiler == GHC && withinRange targetCompilerVersion range compiler == GHC && withinRange targetCompilerVersion range
checkCond' (Lit b) = b checkCond' (Lit b) = b

View File

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

View File

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