-
Notifications
You must be signed in to change notification settings - Fork 77
/
rebar.config.script
76 lines (59 loc) · 2.47 KB
/
rebar.config.script
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
NifSharedSources = ["c_src/esqlite3_nif.c"].
NifStaticSources = NifSharedSources ++ ["c_src/sqlite3/sqlite3.c"].
CFlagsDefault = "$CFLAGS -Os -DSQLITE_DQS=0 -DSQLITE_THREADSAFE=1 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_USE_ALLOCA -DSQLITE_OMIT_AUTOINIT -DSQLITE_USE_URI -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_MATH_FUNCTIONS -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_GEOPOLY".
DrvLdFlagsDefault = "-shared -lsqlite3".
DrvLdFlags =
case os:getenv("ESQLITE_CFLAGS") of
NotDefined when NotDefined == false; NotDefined == [] -> DrvLdFlagsDefault;
DrvLdFlagsOverride -> DrvLdFlagsOverride
end.
{NifSources, LdEnv, CFlagsExt} =
case os:getenv("ESQLITE_USE_SYSTEM") of
NotDefined when NotDefined == false; NotDefined == [] -> {NifStaticSources, [], " -Ic_src/sqlite3"};
_Defined -> {NifSharedSources, [{"DRV_LDFLAGS", DrvLdFlags}], []}
end.
CFlags =
case os:getenv("ESQLITE_CFLAGS") of
NotDefined when NotDefined == false; NotDefined == [] -> CFlagsDefault ++ CFlagsExt;
CFlagsOverride -> CFlagsOverride
end.
[
{minimum_otp_vsn, "22.0"},
{erl_opts, [debug_info]},
{xref_checks, [undefined_function_calls,
undefined_functions,
locals_not_used,
deprecated_function_calls,
deprecated_functions]},
{port_env, [
%% Default darwin ldflags causes loading of system sqlite. Removed -bundle flag.
{"darwin", "DRV_LDFLAGS",
"-flat_namespace -undefined suppress $ERL_LDFLAGS"},
{"solaris", "CFLAGS",
"$CFLAGS -std=c99"},
{"linux", "CFLAGS",
"$CFLAGS -std=c11"},
{"CFLAGS", CFlags}
] ++ LdEnv},
{port_specs, [
{"priv/esqlite3_nif.so", NifSources}
]},
{plugins, [{pc, "~> 1.15"}]},
{provider_hooks,
[{post,
[{compile, {pc, compile}},
{clean, {pc, clean}}]}]},
{dialyzer, [
{warnings, [
unmatched_returns,
error_handling,
race_conditions,
underspecs,
unknown
]}
]},
{edoc_opts, [{preprocess, true},
{stylesheet, "style.css"},
{sort_functions, false}]},
{hex, [{doc, edoc}]}
].