summaryrefslogtreecommitdiff
path: root/compiler/main/DynFlags.hs
diff options
context:
space:
mode:
authorDavid Eichmann <EichmannD@gmail.com>2019-04-09 13:17:34 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-05-21 16:57:37 -0400
commit8fc654c3a00ab0cd842c3e8316f832170ea561d6 (patch)
treecb8e052c93d2709411d2b05760790953735bf1c2 /compiler/main/DynFlags.hs
parent54095bbd3a5481e906b05c80ea68841165c7a2b3 (diff)
downloadhaskell-8fc654c3a00ab0cd842c3e8316f832170ea561d6.tar.gz
Include CPP preprocessor dependencies in -M output
Issue #16521
Diffstat (limited to 'compiler/main/DynFlags.hs')
-rw-r--r--compiler/main/DynFlags.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index e94798aede..15f254ad7c 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -1022,6 +1022,7 @@ data DynFlags = DynFlags {
-- For ghc -M
depMakefile :: FilePath,
depIncludePkgDeps :: Bool,
+ depIncludeCppDeps :: Bool,
depExcludeMods :: [ModuleName],
depSuffixes :: [String],
@@ -2010,6 +2011,7 @@ defaultDynFlags mySettings (myLlvmTargets, myLlvmPasses) =
-- ghc -M values
depMakefile = "Makefile",
depIncludePkgDeps = False,
+ depIncludeCppDeps = False,
depExcludeMods = [],
depSuffixes = [],
-- end of ghc -M values
@@ -2684,6 +2686,9 @@ addOptP f = alterSettings (\s -> s { sOpt_P = f : sOpt_P s
setDepMakefile :: FilePath -> DynFlags -> DynFlags
setDepMakefile f d = d { depMakefile = f }
+setDepIncludeCppDeps :: Bool -> DynFlags -> DynFlags
+setDepIncludeCppDeps b d = d { depIncludeCppDeps = b }
+
setDepIncludePkgDeps :: Bool -> DynFlags -> DynFlags
setDepIncludePkgDeps b d = d { depIncludePkgDeps = b }
@@ -3100,6 +3105,8 @@ dynamic_flags_deps = [
-------- ghc -M -----------------------------------------------------
, make_ord_flag defGhcFlag "dep-suffix" (hasArg addDepSuffix)
, make_ord_flag defGhcFlag "dep-makefile" (hasArg setDepMakefile)
+ , make_ord_flag defGhcFlag "include-cpp-deps"
+ (noArg (setDepIncludeCppDeps True))
, make_ord_flag defGhcFlag "include-pkg-deps"
(noArg (setDepIncludePkgDeps True))
, make_ord_flag defGhcFlag "exclude-module" (hasArg addDepExcludeMod)