summaryrefslogtreecommitdiff
path: root/compiler/main/GhcMake.hs
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2017-07-11 11:54:59 -0400
committerBen Gamari <ben@smart-cactus.org>2017-07-11 13:41:54 -0400
commitb0c9f34aa3da914524ef37294bba78afefc3ada7 (patch)
tree8f83950f52f446aaac7af5888b605c987cc80eeb /compiler/main/GhcMake.hs
parent7c9e356de1114ab3e31f2d6d03e83672076dd533 (diff)
downloadhaskell-b0c9f34aa3da914524ef37294bba78afefc3ada7.tar.gz
Improve Wmissing-home-modules warning under Cabal
Reviewers: hvr, alanz, austin Reviewed By: alanz Subscribers: rwbarton, thomie GHC Trac Issues: #13899 Differential Revision: https://phabricator.haskell.org/D3686
Diffstat (limited to 'compiler/main/GhcMake.hs')
-rw-r--r--compiler/main/GhcMake.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/main/GhcMake.hs b/compiler/main/GhcMake.hs
index 5935a771a7..4706672e55 100644
--- a/compiler/main/GhcMake.hs
+++ b/compiler/main/GhcMake.hs
@@ -195,7 +195,12 @@ warnMissingHomeModules hsc_env mod_graph =
missing = map (moduleName . ms_mod) $
filter (not . is_known_module) mod_graph
- msg = text "Modules are not listed in command line: "
+ msg
+ | gopt Opt_BuildingCabalPackage dflags
+ = text "These modules are needed for compilation but not listed in your .cabal file's other-modules: "
+ <> sep (map ppr missing)
+ | otherwise
+ = text "Modules are not listed in command line but needed for compilation: "
<> sep (map ppr missing)
warn = makeIntoWarning
(Reason Opt_WarnMissingHomeModules)