Add a -fbuilding-cabal-package flag
authorIan Lynagh <igloo@earth.li>
Sun, 26 Jul 2009 18:19:34 +0000 (18:19 +0000)
committerIan Lynagh <igloo@earth.li>
Sun, 26 Jul 2009 18:19:34 +0000 (18:19 +0000)
This means GHC knows whether it's building a Cabal package, or just
Haskell sources. For example, it may wish to give different error
messages when building a Cabal package.

compiler/main/DynFlags.hs

index 9ff139c..0809d04 100644 (file)
@@ -315,6 +315,7 @@ data DynFlag
    | Opt_EmbedManifest
    | Opt_EmitExternalCore
    | Opt_SharedImplib
+   | Opt_BuildingCabalPackage
 
        -- temporary flags
    | Opt_RunCPS
@@ -1757,6 +1758,7 @@ fFlags = [
   ( "embed-manifest",                   Opt_EmbedManifest, const Supported ),
   ( "ext-core",                         Opt_EmitExternalCore, const Supported ),
   ( "shared-implib",                    Opt_SharedImplib, const Supported ),
+  ( "building-cabal-package",           Opt_BuildingCabalPackage, const Supported ),
   ( "implicit-import-qualified",        Opt_ImplicitImportQualified, const Supported )
   ]