Skip to content
Snippets Groups Projects
Commit 6b1fd0a1 authored by Duncan Coutts's avatar Duncan Coutts
Browse files

Add util function allBuildInfo :: PackageDescription -> [BuildInfo]

The 'BuildInfo' for the library (if there is one and it's buildable)
and all the buildable executables. Useful for gathering dependencies.
parent 98a14fe8
No related merge requests found
......@@ -75,6 +75,7 @@ module Distribution.PackageDescription (
BuildInfo(..),
emptyBuildInfo,
mapBuildInfo,
allBuildInfo,
-- ** Supplementary build information
HookedBuildInfo,
......@@ -614,6 +615,16 @@ mapBuildInfo f pkg = pkg {
emptyBuildInfo :: BuildInfo
emptyBuildInfo = nullBuildInfo { hsSourceDirs = [currentDir] }
-- | The 'BuildInfo' for the library (if there is one and it's buildable) and
-- all the buildable executables. Useful for gathering dependencies.
allBuildInfo :: PackageDescription -> [BuildInfo]
allBuildInfo pkg_descr = [ bi | Just lib <- [library pkg_descr]
, let bi = libBuildInfo lib
, buildable bi ]
++ [ bi | exe <- executables pkg_descr
, let bi = buildInfo exe
, buildable bi ]
-- see comment at libFillInDefaults
biFillInDefaults :: BuildInfo -> BuildInfo
biFillInDefaults bi =
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment