-
Notifications
You must be signed in to change notification settings - Fork 167
/
meson.build
99 lines (84 loc) · 2.7 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
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
93
94
95
96
97
98
99
project(
'edlib',
'cpp', 'c',
version : '1.2.6',
default_options : [
'buildtype=release',
'warning_level=3',
'cpp_std=c++14',
'b_ndebug=if-release',
'default_library=static'
],
license : 'MIT',
meson_version : '>= 0.52.0',
)
project_version_major = meson.project_version().split('.')[0]
###### Libraries ######
edlib_lib_compile_args = ['-DEDLIB_BUILD']
if get_option('default_library') != 'static'
edlib_lib_compile_args += ['-DEDLIB_SHARED']
endif
# If default_library == 'static', library() builds and returns static library.
# If default_library == 'shared', library() builds and returns shared library.
# If default_library == 'both', library() builds both static and shared libraries,
# but only shared one is returned as value and therefore used in the rest of the build.
if (get_option('default_library') == 'both')
error('\'both\' as a value for default_library option is not supported because it would'
+ ' build static library with shared library flags, exporting symbols!'
+ 'Instead, build twice, once with \'static\' and once with \'shared\'.')
endif
edlib_lib = library('edlib',
sources : files(['edlib/src/edlib.cpp']),
include_directories : include_directories('edlib/include'),
dependencies : [],
install : true,
cpp_args : edlib_lib_compile_args,
gnu_symbol_visibility : 'inlineshidden',
soversion : project_version_major # Used only for shared library.
)
edlib_dep = declare_dependency(
include_directories : include_directories('edlib/include'),
link_with : edlib_lib,
compile_args : edlib_lib_compile_args
)
###### Executables ######
hello_main = executable(
'hello-world',
files(['apps/hello-world/helloWorld.c']),
dependencies : [edlib_dep],
)
if build_machine.system() != 'windows'
aligner_main = executable(
'edlib-aligner',
files(['apps/aligner/aligner.cpp']),
dependencies : [edlib_dep],
install : true,
)
endif
runTests_main = executable(
'runTests',
files(['test/runTests.cpp']),
dependencies : [edlib_dep],
include_directories : include_directories('test'),
)
###### Tests ######
test('runTests', runTests_main)
test('hello', hello_main)
if build_machine.system() != 'windows'
test('aligner', aligner_main,
args : [
files('apps/aligner/test_data/query.fasta',
'apps/aligner/test_data/target.fasta'),
],
)
endif
###### Install ######
install_headers('edlib/include/edlib.h')
pkg = import('pkgconfig')
pkg.generate(edlib_lib,
name: 'edlib',
url: 'https://github.com/Martinsos/edlib',
filebase : 'edlib-' + project_version_major,
extra_cflags : edlib_lib_compile_args,
description : 'Lightweight and super fast C/C++ library for sequence alignment using edit distance',
)