diff options
Diffstat (limited to 'hadrian')
-rw-r--r-- | hadrian/src/Hadrian/Haskell/Cabal/Parse.hs | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/hadrian/src/Hadrian/Haskell/Cabal/Parse.hs b/hadrian/src/Hadrian/Haskell/Cabal/Parse.hs index cee83164a3..2aad4d5de0 100644 --- a/hadrian/src/Hadrian/Haskell/Cabal/Parse.hs +++ b/hadrian/src/Hadrian/Haskell/Cabal/Parse.hs @@ -216,20 +216,15 @@ resolveContextData context@Context {..} = do -- Configure the package with the GHC for this stage (compiler, platform) <- configurePackageGHC package stage - flagList <- interpret (target context (Cabal Flags stage) [] []) =<< args <$> flavour - let flags = foldr addFlag mempty flagList - where - addFlag :: String -> C.FlagAssignment -> C.FlagAssignment - addFlag ('-':name) = C.insertFlagAssignment (C.mkFlagName name) False - addFlag ('+':name) = C.insertFlagAssignment (C.mkFlagName name) True - addFlag name = C.insertFlagAssignment (C.mkFlagName name) True - - let (Right (pd,_)) = C.finalizePD flags C.defaultComponentRequestedSpec - (const True) platform (C.compilerInfo compiler) [] gpd cPath <- Context.contextPath context lbi <- liftIO $ C.getPersistBuildConfig cPath + let flags = C.flagAssignment lbi + + (Right (pd,_)) = C.finalizePD flags C.defaultComponentRequestedSpec + (const True) platform (C.compilerInfo compiler) [] gpd + -- Note: the @cPath@ is ignored. The path that's used is the 'buildDir' path -- from the local build info @lbi@. pdi <- liftIO $ getHookedBuildInfo [pkgPath package, cPath -/- "build"] |