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 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
|
project(
'blasr',
'cpp',
version : '5.3.5',
default_options : [
'buildtype=release',
'warning_level=3',
'cpp_std=c++17',
'b_ndebug=false'],
license : 'BSD-3',
meson_version : '>= 0.52.0')
# TODO:
# try to reenable 'b_ndebug=true'
# this will require replacing a number of asserts
# with proper throw statements
############
# CXXFLAGS #
############
blasr_warning_flags = []
cpp = meson.get_compiler('cpp')
foreach cflag: [
'-Wno-delete-non-virtual-dtor',
'-Wno-non-virtual-dtor',
'-Wno-unused-but-set-variable',
'-Wno-unused-variable']
if cpp.has_argument(cflag)
blasr_warning_flags += cflag
endif
endforeach
if cpp.get_id() == 'clang'
foreach cflag: [
'-Wno-overloaded-virtual']
if cpp.has_argument(cflag)
blasr_warning_flags += cflag
endif
endforeach
endif
################
# dependencies #
################
# threads
blasr_thread_dep = dependency('threads', required : true)
# boost
blasr_boost_dep = dependency('boost', include_type : 'system', required : true)
# pbbam
blasr_pbbam_dep = cpp.find_library('pbbam')
# libblasr
blasr_libblasr_dep = dependency('libblasr', required : true)
# zlib
blasr_zlib_dep = dependency('zlib', required : true, fallback : ['zlib', 'zlib_dep'])
# htslib
blasr_htslib_dep = dependency('htslib', required : true, version : '>=1.4', fallback : ['htslib', 'htslib_dep'])
# missing libs for linker
blasr_pbcopper_deps = cpp.find_library('pbcopper')
blasr_deps = [
blasr_thread_dep,
blasr_boost_dep,
blasr_pbbam_dep,
blasr_libblasr_dep,
blasr_pbcopper_deps,
blasr_zlib_dep,
blasr_htslib_dep]
########################
# sources + executable #
########################
# replace version strings
blasr_ver_arr = meson.project_version().split('.')
blasr_major_version = blasr_ver_arr[0]
blasr_minor_version = blasr_ver_arr[1]
blasr_patch_version = blasr_ver_arr[2]
blasr_config = configuration_data()
blasr_config.set('BLASR_VERSION', meson.project_version())
blasr_config.set('BLASR_VERSION_MAJOR', blasr_major_version)
blasr_config.set('BLASR_VERSION_MINOR', blasr_minor_version)
blasr_config.set('BLASR_VERSION_PATCH', blasr_patch_version)
blasr_BlasrVersion_h = configure_file(
input : 'BlasrVersion.h.in',
output : 'BlasrVersion.h',
configuration : blasr_config)
# replace git commit id
blasr_BlasrGitHash_h = vcs_tag(
input : 'BlasrGitHash.h.in',
output : 'BlasrGitHash.h',
command : ['git', 'describe', '--always', '--dirty=*'],
fallback : '',
replace_string : '@BLASR_GIT_SHA1@')
blasr_sources = []
blasr_include_directories = [include_directories('.')]
subdir('extrautils')
subdir('utils')
blasr_static_impl = static_library(
'blasr_impl',
blasr_sources,
install : false,
dependencies : blasr_deps,
cpp_args : [blasr_warning_flags])
blasr_main = executable(
'blasr', [
blasr_BlasrGitHash_h,
blasr_BlasrVersion_h,
files('Blasr.cpp')],
install : true,
dependencies : blasr_deps,
link_with : blasr_static_impl,
cpp_args : [blasr_warning_flags, '-DCMAKE_BUILD=1'])
blasr_utils_sawriter = executable(
'sawriter', files([
'utils/SAWriter.cpp']),
install : true,
dependencies : blasr_deps,
link_with : blasr_static_impl,
cpp_args : [blasr_warning_flags, '-DCMAKE_BUILD=1'])
blasr_utils_toAfg = executable(
'toAfg', files([
'utils/ToAfg.cpp']),
install : false,
dependencies : blasr_deps,
link_with : blasr_static_impl,
cpp_args : [blasr_warning_flags, '-DCMAKE_BUILD=1'])
#########
# tests #
#########
if get_option('tests')
blasr_clang_formatter = find_program('tools/check-formatting')
test(
'blasr formatting check',
blasr_clang_formatter,
args : [
'--all'],
workdir : meson.source_root())
subdir('ctest')
endif
|