Skip to content

Commit

Permalink
Merge pull request #3576 from commercialhaskell/apply-specific-ghc-op…
Browse files Browse the repository at this point in the history
…tions-after-general-3573

Apply package specific "ghc-options" after more general ones #3573
  • Loading branch information
snoyberg authored Nov 27, 2017
2 parents 839378a + 66d8950 commit 4f33657
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ Behavior changes:
* Stack will ask before saving hackage credentials to file. This new
prompt can be avoided by using the `save-hackage-creds` setting. Please
see [#2159](https://github.com/commercialhaskell/stack/issues/2159).
* `ghc-options:` for specific packages will now come after the options
specified for all packages / particular sets of packages. See
[#3573](https://github.com/commercialhaskell/stack/issues/3573).
* The `pvp-bounds` feature is no longer fully functional, due to some
issues with the Cabal library's printer. See
[#3550](https://github.com/commercialhaskell/stack/issues/3550).
Expand Down
10 changes: 5 additions & 5 deletions src/Stack/Build/Source.hs
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,14 @@ getLocalFlags bconfig boptsCli name = Map.unions
-- configuration and commandline.
getGhcOptions :: BuildConfig -> BuildOptsCLI -> PackageName -> Bool -> Bool -> [Text]
getGhcOptions bconfig boptsCli name isTarget isLocal = concat
[ Map.findWithDefault [] name (configGhcOptionsByName config)
, if isTarget
then Map.findWithDefault [] AGOTargets (configGhcOptionsByCat config)
else []
[ Map.findWithDefault [] AGOEverything (configGhcOptionsByCat config)
, if isLocal
then Map.findWithDefault [] AGOLocals (configGhcOptionsByCat config)
else []
, Map.findWithDefault [] AGOEverything (configGhcOptionsByCat config)
, if isTarget
then Map.findWithDefault [] AGOTargets (configGhcOptionsByCat config)
else []
, Map.findWithDefault [] name (configGhcOptionsByName config)
, concat [["-fhpc"] | isLocal && toCoverage (boptsTestOpts bopts)]
, if boptsLibProfile bopts || boptsExeProfile bopts
then ["-fprof-auto","-fprof-cafs"]
Expand Down

0 comments on commit 4f33657

Please sign in to comment.