-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmeson.build
More file actions
126 lines (106 loc) · 2.88 KB
/
meson.build
File metadata and controls
126 lines (106 loc) · 2.88 KB
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
123
124
125
126
project(
'PBSAMOA',
['cpp', 'c'],
default_options: [
'b_ndebug=if-release',
'buildtype=release',
'c_std=c23',
'cpp_std=c++23',
'warning_level=3',
],
license: 'BSD-3',
meson_version: '>= 1.1.0',
version: '0.1.0',
)
############
# CXXFLAGS #
############
cpp = meson.get_compiler('cpp')
c = meson.get_compiler('c')
cpp_flags = cpp.get_supported_arguments(
# stupid warning https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96868#c3
'-Wno-missing-field-initializers',
# currently broken upstream https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61596
'-Wno-unused-local-typedefs',
'-Wdouble-promotion',
'-Wduplicated-cond',
'-Wformat=1',
'-Wlogical-op',
'-Wold-style-cast',
'-Wrestrict',
'-Wshadow',
'-Wsuggest-override',
'-Wunused-local-typedef',
'-Wunused-parameter',
'-Wuseless-cast',
# GCC 14 false positive: std::expected<T,E> move with T containing std::string
# triggers spurious -Wmaybe-uninitialized from standard library internals
'-Wno-maybe-uninitialized',
)
################
# dependencies #
################
# libdeflate
libdeflate_dep = dependency(
'libdeflate',
fallback: ['libdeflate', 'libdeflate_dep'],
include_type: 'system',
)
deps = [libdeflate_dep, dependency('threads')]
# Native CRAM implementation intentionally does not depend on htslib.
bzip2_dep = dependency('bzip2', required: false, include_type: 'system')
if bzip2_dep.found()
deps += bzip2_dep
add_project_arguments('-DPBSAMOA_HAVE_BZIP2=1', language: ['cpp'])
endif
liblzma_dep = dependency('liblzma', required: false, include_type: 'system')
if liblzma_dep.found()
deps += liblzma_dep
add_project_arguments('-DPBSAMOA_HAVE_LZMA=1', language: ['cpp'])
endif
libm_dep = c.find_library('m', required: false)
if libm_dep.found()
deps += libm_dep
endif
###########
# headers #
###########
subdir('include')
###############
# third-party #
###############
subdir('third-party')
##########################
# libraries & executable #
##########################
subdir('src')
#########
# tests #
#########
if (not meson.is_subproject()) and get_option('tests')
pbtestutils_dep = dependency(
'pbtestutils',
fallback: ['pbtestutils', 'pbtestutils_dep'],
)
cram_script = subproject('pbtestutils').get_variable('cram_script')
subdir('tests')
endif
###################
# dependency info #
###################
if not meson.is_subproject()
import('pkgconfig').generate(
lib,
description: 'PacBio SAM/BAM/BAI C++23 library',
filebase: 'pbsamoa',
name: 'pbsamoa',
version: meson.project_version(),
)
endif
pbsamoa_dep = declare_dependency(
dependencies: deps,
include_directories: [inc_dir, thirdparty_dir],
link_with: lib,
version: meson.project_version(),
)
meson.override_dependency('pbsamoa', pbsamoa_dep)