name: frontend
version: 0.1
cabal-version: >= 1.8
build-type: Simple

-- This ensures the platform-specific source files are also included in `cabal
-- sdist`.
extra-source-files: android-src/ActivityPath.hs
                    linux-src/ActivityPath.hs

library
  hs-source-dirs: src
  build-depends: base
               , common
               , obelisk-frontend
               , obelisk-route
               , jsaddle
               , reflex-dom-core
               , obelisk-executable-config-lookup
               , obelisk-generated-static
               , text
               , bytestring
               , tahoe-chk
               , req
               , extra
               , reflex-material
               , megaparsec
               , base32
               , cereal

  if os(android)
    -- Pull in the Android implementation of some platform-specific modules.
    hs-source-dirs: android-src
    -- And their dependencies.
    build-depends: android-activity
  else
    -- Here, get the Linux implementation of those platform-specific modules.
    hs-source-dirs: linux-src
    -- And their dependencies.
    build-depends: xdg-basedir
    build-depends: directory
  exposed-modules:
    Controller
    Frontend
    FrontendPaths
    Pages.Folder
    Pages.Splash
    Pages.TechDemo
  ghc-options: -Werror -Wall -Wredundant-constraints -Wincomplete-uni-patterns -Wincomplete-record-updates -O -fno-show-valid-hole-fits

executable frontend
  main-is: main.hs
  hs-source-dirs: src-bin
  build-depends: base
               , common
               , obelisk-frontend
               , obelisk-route
               , reflex-dom
               , obelisk-generated-static
               , frontend
  ghc-options: -threaded -O -Wredundant-constraints -Wincomplete-uni-patterns -Wincomplete-record-updates -fno-show-valid-hole-fits
  if impl(ghcjs)
    ghc-options: -dedupe
    cpp-options: -DGHCJS_BROWSER
  if os(darwin)
    ghc-options: -dynamic