-
Notifications
You must be signed in to change notification settings - Fork 0
/
foreign.cabal
92 lines (82 loc) · 2.41 KB
/
foreign.cabal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
cabal-version: 2.4
name: foreign
version: 0.2.1.0
synopsis: A collection of helpers for ffi.
description:
Please see the README on Github at <https://github.com/4eUeP/foreign#readme>
license: BSD-3-Clause
license-file: LICENSE
copyright: Copyright (c)
author: mu
maintainer: mu@laxcat.xyz
tested-with: GHC ==8.10.7 || ==9.2.5
category: Foreign
homepage: https://github.com/4eUeP/foreign
bug-reports: https://github.com/4eUeP/foreign/issues
build-type: Simple
extra-source-files:
ChangeLog.md
include/**/*.h
README.md
source-repository head
type: git
location: https://github.com/4eUeP/foreign
common common
default-language: Haskell2010
default-extensions:
DeriveGeneric
DerivingStrategies
EmptyDataDeriving
GADTSyntax
GeneralizedNewtypeDeriving
LambdaCase
OverloadedStrings
RecordWildCards
ScopedTypeVariables
TypeApplications
UnliftedFFITypes
UnliftedNewtypes
ghc-options:
-Wall -Wcompat -Widentities -Wincomplete-record-updates
-Wincomplete-uni-patterns -Wpartial-fields -Wredundant-constraints
library
import: common
hs-source-dirs: src
include-dirs: include
cxx-sources: cbits/hs_cpp_std.cpp
includes: hs_foreign.h
exposed-modules:
HsForeign
HsForeign.AsyncFFI
HsForeign.CppStd
HsForeign.Primitive
HsForeign.String
HsForeign.Utils
-- We need to use primitive-unlifted < 1.0 to support ghc-9.*
-- See: https://gitlab.haskell.org/ghc/ghc/-/issues/20908
build-depends:
, base >=4.14 && <5
, bytestring >=0.10 && <0.12.0
, ghc-prim >=0.5 && <1.0
, primitive ^>=0.7
, primitive-unlifted >=0.1.3.1 && <0.2
cxx-options: -std=c++17 -Werror=switch
extra-libraries: stdc++
test-suite foreign-test
import: common
type: exitcode-stdio-1.0
main-is: Spec.hs
other-modules:
HsForeign.AsyncFFISpec
HsForeign.PrimitiveSpec
HsForeign.StringSpec
hs-source-dirs: test
c-sources: test/cbits/ffi.c
build-depends:
, base >=4.14 && <5
, foreign
, hspec
, QuickCheck
, quickcheck-instances
build-tool-depends: hspec-discover:hspec-discover >=2 && <3
ghc-options: -threaded -rtsopts -with-rtsopts=-N