File: meson.build

package info (click to toggle)
pbseqlib 5.3.4%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 7,020 kB
  • sloc: cpp: 77,246; python: 331; sh: 103; makefile: 42
file content (144 lines) | stat: -rw-r--r-- 3,513 bytes parent folder | download
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
project(
  'libblasr',
  'cpp',
  version : '5.3.4',
  default_options : [
    'buildtype=release',
    'warning_level=3',
    'cpp_std=c++14',
    'b_ndebug=false'],
  license : 'BSD-3',
  meson_version : '>= 0.46.0')

# TODO:
# try to reenable 'b_ndebug=true'
# this will require replacing a number of asserts
# with proper throw statements

############
# CXXFLAGS #
############

libblasr_warning_flags = []
cpp = meson.get_compiler('cpp')
foreach cflag: [
  '-Wno-delete-non-virtual-dtor',
  '-Wno-unused-variable',
  '-Wno-non-virtual-dtor']
    if cpp.has_argument(cflag)
      libblasr_warning_flags += cflag
    endif
endforeach

if cpp.get_id() == 'clang'
  foreach cflag: [
    '-Wno-unused-local-typedef',
    '-Wno-overloaded-virtual',
    '-Wno-keyword-macro']
      if cpp.has_argument(cflag)
        libblasr_warning_flags += cflag
      endif
  endforeach
endif

################
# dependencies #
################

# boost
libblasr_boost_dep = dependency('boost', required : true)

# pbbam
libblasr_pbbam_dep = dependency('pbbam', fallback : ['pbbam', 'pbbam_dep'])

# zlib
libblasr_zlib_dep = dependency('zlib', required : true, fallback : ['zlib', 'zlib_dep'])

# htslib
libblasr_htslib_dep = dependency('htslib', required : true, version : '>=1.4', fallback : ['htslib', 'htslib_dep'])

# clock_gettime on old glibc systems
libblasr_rt_dep = cpp.find_library('rt', required : false)

libblasr_deps = [
  libblasr_boost_dep,
  libblasr_pbbam_dep,
  libblasr_zlib_dep,
  libblasr_htslib_dep,
  libblasr_rt_dep]

##########
# Config #
##########

libblasr_libconfig_h_config = configuration_data()
libblasr_libconfig_h_config.set('USE_PBBAM', 1)
libblasr_libconfig_h = configure_file(output : 'LibBlasrConfig.h', configuration : libblasr_libconfig_h_config)

if not meson.is_subproject()
  install_headers(
    libblasr_libconfig_h,
    subdir : 'libblasr')
endif

#####################
# sources + library #
#####################

# install library if
# - either running as a proper project
# - or using shared libraries
libblasr_lib_install = (not meson.is_subproject()) or (get_option('default_library') == 'shared')

libblasr_sources = [libblasr_libconfig_h]
libblasr_include_directories = include_directories('.')

subdir('hdf')
subdir('alignment')
subdir('pbdata')

libblasr_lib = library(
  'blasr', [
    libblasr_libconfig_h,
    libblasr_sources],
  install : libblasr_lib_install,
  # use boost SONAME practice:
  #   cause ld startup issues before
  #   you even have the chance of running
  #   into ABI issues.
  soversion : meson.project_version(),
  version : meson.project_version(),
  include_directories : libblasr_include_directories,
  dependencies : libblasr_deps,
  cpp_args : libblasr_warning_flags)

#########
# tests #
#########

if (not meson.is_subproject()) and get_option('tests')
  libblasr_clang_formatter = find_program('tools/check-formatting')
  subdir('unittest')
endif

###################
# dependency info #
###################

if not meson.is_subproject()
  import('pkgconfig').generate(
    libraries : libblasr_lib,
    version : meson.project_version(),
    name : 'libblasr',
    requires : 'pbbam',
    filebase : 'libblasr',
    subdirs : 'libblasr',
    description : 'Library routines used by the PacBio BLASR aligner')
endif

libblasr_dep = declare_dependency(
  include_directories : libblasr_include_directories,
  link_with : libblasr_lib,
  dependencies : libblasr_deps,
  version : meson.project_version(),
  sources : libblasr_libconfig_h)