-
Notifications
You must be signed in to change notification settings - Fork 2
/
rebar.config.script
85 lines (66 loc) · 2.14 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
77
78
79
80
81
82
83
84
85
NifSharedSources = ["c_src/educkdb_nif.c"].
NifStaticSources = NifSharedSources ++ ["c_src/duckdb/duckdb.cpp"].
CFlagsDefault = "$CFLAGS -Os".
CXXFlagsDefault = "$CXXFLAGS -Os -std=c++11".
DrvLdFlagsDefault = "-shared -lduckdb".
DrvLdFlags =
case os:getenv("ESQLITE_CFLAGS") of
NotDefined when NotDefined == false; NotDefined == [] ->
DrvLdFlagsDefault;
DrvLdFlagsOverride ->
DrvLdFlagsOverride
end.
{NifSources, LdEnv, CFlagsExt, CXXFlagsExt} =
{NifStaticSources, [], " -Ic_src/duckdb", ""}.
CFlags =
case os:getenv("EDUCKDB_CFLAGS") of
NotDefined when NotDefined == false; NotDefined == [] ->
CFlagsDefault ++ CFlagsExt;
CFlagsOverride ->
CFlagsOverride
end.
CXXFlags =
case os:getenv("EDUCKDB_CXXFLAGS") of
NotDefined when NotDefined == false; NotDefined == [] ->
CXXFlagsDefault ++ CXXFlagsExt;
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},
{"CXXFLAGS", CXXFlags}
] ++ LdEnv},
{port_specs, [
{"priv/educkdb_nif.so", NifSources}
]},
{plugins, [pc]},
{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}]}
].