-
Notifications
You must be signed in to change notification settings - Fork 94
/
meson.build
67 lines (58 loc) · 1.26 KB
/
meson.build
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
project(
'libhydrogen',
'c',
license: 'ISC',
default_options: [
'buildtype=minsize',
'default_library=static',
'warning_level=2',
],
)
cc = meson.get_compiler('c')
cflags = cc.get_supported_arguments(
'-Wbad-function-cast',
'-Wcast-align',
'-Wcast-qual',
'-Wdiv-by-zero',
'-Wfloat-equal',
'-Wmissing-declarations',
'-Wmissing-prototypes',
'-Wnested-externs',
'-Wno-type-limits',
'-Wno-unknown-pragmas',
'-Wpointer-arith',
'-Wredundant-decls',
'-Wstrict-prototypes',
'-Wswitch-enum',
'-fno-exceptions',
'-mtune=native',
)
add_project_arguments(cflags, language: 'c')
include_dirs = include_directories('.')
sources = files(
'hydrogen.c',
)
libhydrogen = library(
'hydrogen',
sources,
include_directories: include_dirs,
install: true,
)
tests = executable(
'tests',
files('tests/tests.c'),
link_with: libhydrogen,
)
test('tests', tests)
install_headers(files('hydrogen.h'))
pkgconfig = import('pkgconfig')
pkgconfig.generate(
libhydrogen,
name: 'libhydrogen',
description: 'Lightweight, secure, easy-to-use crypto library suitable for constrained environments.',
url: 'https://libhydrogen.org/',
)
libhydrogen_dep = declare_dependency(
include_directories: include_dirs,
link_with: libhydrogen,
)