Skip to content

Commit

Permalink
Only add lib component when there actually is a library
Browse files Browse the repository at this point in the history
  • Loading branch information
snoyberg committed Aug 18, 2015
1 parent 4159ec0 commit 603c791
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/Stack/Build/Execute.hs
Original file line number Diff line number Diff line change
Expand Up @@ -768,10 +768,16 @@ singleBuild ac@ActionContext {..} ee@ExecuteEnv {..} task@Task {..} =
extraOpts <- extraBuildOptions
cabal (console && configHideTHLoading config) $
(case taskType of
TTLocal lp -> "build"
: ("lib:" ++ packageNameString (packageName package))
: map (T.unpack . T.append "exe:")
(maybe [] Set.toList $ lpExeComponents lp)
TTLocal lp -> concat
[ ["build"]
, ["lib:" ++ packageNameString (packageName package)
-- TODO: get this information from target parsing instead,
-- which will allow users to turn off library building if
-- desired
| packageHasLibrary package]
, map (T.unpack . T.append "exe:")
(maybe [] Set.toList $ lpExeComponents lp)
]
TTUpstream _ _ -> ["build"]) ++ extraOpts

let doHaddock = shouldHaddockPackage eeBuildOpts eeWanted (packageName package) &&
Expand Down

0 comments on commit 603c791

Please sign in to comment.