aboutsummaryrefslogtreecommitdiffstats
path: root/meson.build
blob: af2e1b3df30cbe8bbe2228d4dfbed742ff8ea562 (plain)
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
project('librin', 'c',
	license : 'LGPL2.1',
	default_options : ['c_std=gnu89', 'buildtype=release'])

inc = include_directories('include')

if get_option('gpio')
	thread_dep = dependency('threads')
else
	thread_dep = []
endif

deps = thread_dep

subdir('include')
subdir('src')

if ((not get_option('static')) and (not get_option('shared')))
	librin = library('rin', sources, version : '0.0.0', include_directories : inc, install : true, dependencies : deps)
endif

if get_option('static')
	librin = static_library('rin', sources, version : '0.0.0', include_directories : inc, install : true, dependencies : deps)
endif

if get_option('shared')
	librin = shared_library('rin', sources, version : '0.0.0', include_directories : inc, install : true, dependencies : deps)
endif


if get_option('tests')
	subdir('test')
	test_e = executable('test executable', test_sources, include_directories : inc, link_with : librin)
	test('float sign', test_e, args : ['float', 'signbitf'])
	test('double sign', test_e, args : ['float', 'signbitd'])
	test('flaot to string', test_e, args : ['float', 'floattohexstring'])
	test('double to string', test_e, args : ['float', 'doubletohexstring'])
	test('compare floats', test_e, args : ['float', 'comparefloat'])
	test('compare doubles', test_e, args : ['float', 'comparedouble'])
	test('diagnostic', test_e, args : ['diagnostic', 'none'])
	test('gpio', test_e, args : ['gpio', 'none'])
endif