[commit: haddock] ghc-7.6: Add 'dev' flag to cabal file, that builds without -O2 (fbaa58b)

Simon Hengel <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.ghc
Message-ID <[email protected]>
Repository : ssh://darcs.haskell.org//srv/darcs/haddock

On branch  : ghc-7.6

http://hackage.haskell.org/trac/ghc/changeset/fbaa58ba1c62e3087f3fdb3c1c295d1d797d62ec

>---------------------------------------------------------------

commit fbaa58ba1c62e3087f3fdb3c1c295d1d797d62ec
Author: Simon Hengel <[email protected]>
Date:   Mon Oct 15 19:48:23 2012 +0200

    Add 'dev' flag to cabal file, that builds without -O2
    
    That way --disable-optimization can be used, which decreases build time
    considerably.

>---------------------------------------------------------------

 haddock.cabal |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/haddock.cabal b/haddock.cabal
index 67e8645..78a6ed7 100644
--- a/haddock.cabal
+++ b/haddock.cabal
@@ -52,11 +52,22 @@ flag in-ghc-tree
   default: False
   manual: True
 
+-- Using this disables -O2, and hence allows to use --disable-optimization,
+-- which is about twice as fast.  This should probably be the default, but we
+-- need some benchmarks first..
+flag dev
+  default: False
+  manual: True
+
 executable haddock
   default-language:     Haskell2010
   main-is:              Main.hs
   hs-source-dirs:       driver
-  ghc-options:          -funbox-strict-fields -O2 -Wall -fwarn-tabs
+
+  if flag(dev)
+    ghc-options:          -funbox-strict-fields -Wall -fwarn-tabs
+  else
+    ghc-options:          -funbox-strict-fields -Wall -fwarn-tabs -O2
 
   build-depends:
     base >= 4.3 && < 4.7
@@ -129,7 +140,10 @@ library
     build-depends: ghc-paths
 
   hs-source-dirs:       src
-  ghc-options:          -funbox-strict-fields -O2 -Wall -fwarn-tabs
+  if flag(dev)
+    ghc-options:          -funbox-strict-fields -Wall -fwarn-tabs
+  else
+    ghc-options:          -funbox-strict-fields -Wall -fwarn-tabs -O2
 
   exposed-modules:
     Documentation.Haddock
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.