-
Notifications
You must be signed in to change notification settings - Fork 27
/
meson.build
122 lines (102 loc) · 2.91 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
project(
'pbmm2',
['c', 'cpp'],
version : '1.13.1',
default_options : [
'buildtype=release',
'warning_level=3',
'cpp_std=c++20',
'c_std=gnu17',
'b_ndebug=if-release'],
license : 'BSD-3',
meson_version : '>= 0.57.0')
# CXXFLAGS
pbmm2_flags = []
cpp = meson.get_compiler('cpp')
foreach cflag: [
'-Wno-missing-field-initializers',
'-Wno-c99-extensions',
'-Wno-deprecated-declarations' # rely on std::tmpnam()
]
if cpp.has_argument(cflag)
pbmm2_flags += cflag
endif
endforeach
pbmm2_c_flags = []
c = meson.get_compiler('c')
foreach cflag: [
'-Wc++-compat',
'-Wno-unused-parameter',
'-Wno-unused-variable',
'-Wno-sign-compare']
if c.has_argument(cflag)
pbmm2_c_flags += cflag
endif
endforeach
if host_machine.cpu_family() == 'x86_64'
if get_option('sse41')
if cpp.has_argument('-msse4.1')
pbmm2_flags += '-msse4.1'
else
error('Requested SSE4.1, but the C++ compiler does not support -msse4.1')
endif
if c.has_argument('-msse4.1')
pbmm2_c_flags += '-msse4.1'
else
error('Requested SSE4.1, but the C compiler does not support -msse4.1')
endif
endif
endif
# dependencies
## threads
pbmm2_thread_dep = dependency('threads')
## boost
pbmm2_boost_dep = dependency('boost', include_type : 'system')
## zlib
pbmm2_zlib_dep = dependency('zlib', include_type : 'system', fallback : ['zlib', 'zlib_dep'])
## pbbam
pbmm2_pbbam_dep = dependency('pbbam', fallback : ['pbbam', 'pbbam_dep'])
## pbcopper
pbmm2_pbcopper_dep = dependency('pbcopper', fallback : ['pbcopper', 'pbcopper_dep'])
## minimap2
pbmm2_minimap2_dep = dependency('minimap2', required : false)
if not pbmm2_minimap2_dep.found()
pbmm2_minimap2_subproject = subproject('minimap2')
pbmm2_minimap2_dep = pbmm2_minimap2_subproject.get_variable('mm2_dep')
endif
# htslib
pbmm2_htslib_dep = dependency('htslib', include_type : 'system', version : '>=1.4', fallback : ['htslib', 'htslib_dep'])
pbmm2_lib_deps = [
pbmm2_thread_dep,
pbmm2_boost_dep,
pbmm2_zlib_dep,
pbmm2_pbbam_dep,
pbmm2_pbcopper_dep,
pbmm2_minimap2_dep,
pbmm2_htslib_dep]
# include
subdir('include')
# sources
subdir('src')
# tests
if (not meson.is_subproject()) and get_option('tests')
pbmm2_pbtestutils_dep = dependency('pbtestutils', fallback : ['pbtestutils', 'pbtestutils_dep'])
pbmm2_cram_script = subproject('pbtestutils').get_variable('cram_script')
subdir('tests')
endif
# dependency info
if (not meson.is_subproject())
import('pkgconfig').generate(
libraries : pbmm2_lib,
version : meson.project_version(),
name : 'pbmm2',
filebase : 'pbmm2',
description : 'PacBio C++ library wrapping minimap2 for PacBio native data formats')
endif
pbmm2_dep = declare_dependency(
include_directories : pbmm2_include_directories,
link_with : pbmm2_lib,
dependencies : pbmm2_lib_deps,
sources: pbmm2_gen_headers,
version : meson.project_version(),
compile_args : pbmm2_flags)