cabal-version:       1.12
name:                text-benchmarks
version:             0.0.0.0
synopsis:            Benchmarks for the text package
description:         Benchmarks for the text package
homepage:            https://bitbucket.org/bos/text
license:             BSD2
license-file:        ../LICENSE
author:              Jasper Van der Jeugt <jaspervdj@gmail.com>,
                     Bryan O'Sullivan <bos@serpentine.com>,
                     Tom Harper <rtomharper@googlemail.com>,
                     Duncan Coutts <duncan@haskell.org>
maintainer:          jaspervdj@gmail.com
category:            Text
build-type:          Simple

flag bytestring-builder
  description: Depend on the bytestring-builder package for backwards compatibility.
  default: False
  manual: False

flag llvm
  description: use LLVM
  default: False
  manual: True

executable text-benchmarks
  ghc-options:    -Wall -O2 -rtsopts
  if flag(llvm)
    ghc-options:  -fllvm
  cpp-options:    -DINTEGER_GMP
  build-depends:  array,
                  base == 4.*,
                  binary,
                  blaze-builder,
                  bytestring-lexing >= 0.5.0,
                  containers,
                  criterion >= 0.10.0.0,
                  deepseq,
                  directory,
                  filepath,
                  ghc-prim,
                  integer-gmp,
                  stringsearch,
                  template-haskell,
                  transformers,
                  utf8-string,
                  vector

  if flag(bytestring-builder)
    build-depends: bytestring         >= 0.9    && < 0.10.4,
                   bytestring-builder >= 0.10.4
  else
    build-depends: bytestring         >= 0.10.4

  -- modules for benchmark proper
  c-sources:      cbits/time_iconv.c
  hs-source-dirs: haskell
  main-is:        Benchmarks.hs
  other-modules:
    Benchmarks.Builder
    Benchmarks.Concat
    Benchmarks.DecodeUtf8
    Benchmarks.EncodeUtf8
    Benchmarks.Equality
    Benchmarks.FileRead
    Benchmarks.FoldLines
    Benchmarks.Mul
    Benchmarks.Programs.BigTable
    Benchmarks.Programs.Cut
    Benchmarks.Programs.Fold
    Benchmarks.Programs.Sort
    Benchmarks.Programs.StripTags
    Benchmarks.Programs.Throughput
    Benchmarks.Pure
    Benchmarks.ReadNumbers
    Benchmarks.Replace
    Benchmarks.Search
    Benchmarks.Stream
    Benchmarks.WordFrequencies

  -- Source code for IUT (implementation under test)
  -- "borrowed" from parent folder
  include-dirs:   ../include
  c-sources:      ../cbits/cbits.c
  hs-source-dirs: ..
  other-modules:
    Data.Text
    Data.Text.Array
    Data.Text.Encoding
    Data.Text.Encoding.Error
    Data.Text.Foreign
    Data.Text.IO
    Data.Text.Internal
    Data.Text.Internal.Builder
    Data.Text.Internal.Builder.Functions
    Data.Text.Internal.Builder.Int.Digits
    Data.Text.Internal.Builder.RealFloat.Functions
    Data.Text.Internal.Encoding.Fusion
    Data.Text.Internal.Encoding.Fusion.Common
    Data.Text.Internal.Encoding.Utf16
    Data.Text.Internal.Encoding.Utf32
    Data.Text.Internal.Encoding.Utf8
    Data.Text.Internal.Functions
    Data.Text.Internal.Fusion
    Data.Text.Internal.Fusion.CaseMapping
    Data.Text.Internal.Fusion.Common
    Data.Text.Internal.Fusion.Size
    Data.Text.Internal.Fusion.Types
    Data.Text.Internal.IO
    Data.Text.Internal.Lazy
    Data.Text.Internal.Lazy.Encoding.Fusion
    Data.Text.Internal.Lazy.Fusion
    Data.Text.Internal.Lazy.Search
    Data.Text.Internal.Private
    Data.Text.Internal.Read
    Data.Text.Internal.Search
    Data.Text.Internal.Unsafe
    Data.Text.Internal.Unsafe.Char
    Data.Text.Internal.Unsafe.Shift
    Data.Text.Lazy
    Data.Text.Lazy.Builder
    Data.Text.Lazy.Builder.Int
    Data.Text.Lazy.Builder.RealFloat
    Data.Text.Lazy.Encoding
    Data.Text.Lazy.IO
    Data.Text.Lazy.Internal
    Data.Text.Lazy.Read
    Data.Text.Read
    Data.Text.Unsafe
    Data.Text.Show

  default-language: Haskell2010
  default-extensions: NondecreasingIndentation


executable text-multilang
  hs-source-dirs: haskell
  main-is:        Multilang.hs
  other-modules:  Timer
  ghc-options:    -Wall -O2
  build-depends:  base == 4.*,
                  bytestring,
                  text,
                  time

  default-language: Haskell2010
  default-extensions: NondecreasingIndentation
