diff options
author | Artem Pelenitsyn <a.pelenitsyn@gmail.com> | 2021-09-09 18:37:41 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-09-17 09:38:19 -0400 |
commit | bce230c20eb04c0b557f4a7e4650b009281e717b (patch) | |
tree | 94d11f9a61fde53a82d93d22beac2fbb8d6ef7d7 /compiler/GHC/Driver/MakeFile.hs | |
parent | 9300c736d58fdb8b3e2961f57aa9c4f117fb9c6f (diff) | |
download | haskell-bce230c20eb04c0b557f4a7e4650b009281e717b.tar.gz |
driver: -M allow omitting the -dep-suffix (means empty) (fix #15483)
Diffstat (limited to 'compiler/GHC/Driver/MakeFile.hs')
-rw-r--r-- | compiler/GHC/Driver/MakeFile.hs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/compiler/GHC/Driver/MakeFile.hs b/compiler/GHC/Driver/MakeFile.hs index 5719b7dc04..382d8d6b43 100644 --- a/compiler/GHC/Driver/MakeFile.hs +++ b/compiler/GHC/Driver/MakeFile.hs @@ -73,15 +73,17 @@ doMkDependHS srcs = do -- We therefore do the initial dependency generation with an empty -- way and .o/.hi extensions, regardless of any flags that might -- be specified. - let dflags = dflags0 + let dflags1 = dflags0 { targetWays_ = Set.empty , hiSuf_ = "hi" , objectSuf_ = "o" } - GHC.setSessionDynFlags dflags + GHC.setSessionDynFlags dflags1 - when (null (depSuffixes dflags)) $ liftIO $ - throwGhcExceptionIO (ProgramError "You must specify at least one -dep-suffix") + -- If no suffix is provided, use the default -- the empty one + let dflags = if null (depSuffixes dflags1) + then dflags1 { depSuffixes = [""] } + else dflags1 tmpfs <- hsc_tmpfs <$> getSession files <- liftIO $ beginMkDependHS logger tmpfs dflags |