packages feed

inline-c-cpp-0.4.0.1: inline-c-cpp.cabal

cabal-version:       2.2
name:                inline-c-cpp
version:             0.4.0.1
synopsis:            Lets you embed C++ code into Haskell.
description:         Utilities to inline C++ code into Haskell using inline-c.  See
                     tests for example on how to build.
license:             MIT
license-file:        LICENSE
author:              Francesco Mazzoli
maintainer:          f@mazzo.li
copyright:           (c) 2015-2016 FP Complete Corporation, (c) 2017-2019 Francesco Mazzoli
category:            FFI
tested-with:         GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.5
build-type:          Simple

source-repository head
  type:     git
  location: https://github.com/fpco/inline-c

library
  exposed-modules:     Language.C.Inline.Cpp
                       Language.C.Inline.Cpp.Exceptions
  build-depends:       base >=4.7 && <5
                     , inline-c >= 0.9.0.0
                     , template-haskell
                     , safe-exceptions
                     , containers
  hs-source-dirs:      src
  default-language:    Haskell2010
  ghc-options:         -Wall -optc-xc++ -optc-std=c++11
  include-dirs:        include
  install-includes:    HaskellException.hxx HaskellStablePtr.hxx
  extra-libraries:     stdc++
  c-sources:           cxx-src/HaskellException.cxx cxx-src/HaskellStablePtr.cxx
  cc-options:          -Wall -std=c++11
  if os(darwin)
    -- avoid https://gitlab.haskell.org/ghc/ghc/issues/11829
    ld-options:        -Wl,-keep_dwarf_unwind
    ghc-options:       -pgmc=clang++

test-suite tests
  type:                exitcode-stdio-1.0
  hs-source-dirs:      test
  main-is:             tests.hs
  build-depends:       base >=4 && <5
                     , inline-c
                     , inline-c-cpp
                     , safe-exceptions
                     , hspec
                     , containers
  default-language:    Haskell2010
  ghc-options:
    -optc-std=c++11
  if os(darwin)
    ghc-options: -pgmc=clang++
  extra-libraries:     stdc++
  cc-options:          -Wall -Werror -optc-xc++ -std=c++11
  if os(darwin)
    ld-options: -Wl,-keep_dwarf_unwind