79 lines
2.2 KiB
Meson
79 lines
2.2 KiB
Meson
project('restc-cpp', 'cpp',
|
|
version: '0.9.2',
|
|
meson_version: '>=0.50.0',
|
|
default_options: ['cpp_std=gnu++17'],
|
|
)
|
|
|
|
config_template = files('restc-cpp/config.h.template')
|
|
if get_option('restc_cpp_with_zlib')
|
|
zipreaderimpl = files('restc-cpp/src/ZipReaderImpl.cpp')
|
|
endif
|
|
compiler_opts = ['-DBOOST_COROUTINE_NO_DEPRECATION_WARNING=1']
|
|
|
|
boost_modules = [
|
|
'system', 'program_options', 'filesystem', 'date_time',
|
|
'context', 'coroutine', 'chrono'
|
|
]
|
|
if get_option('restc_cpp_log_with_boost_log')
|
|
boost_modules += ['log']
|
|
endif
|
|
|
|
thread_dep = dependency('threads')
|
|
boost_dep = dependency('boost', modules: boost_modules)
|
|
rapidjson_dep = dependency('RapidJSON')
|
|
|
|
if not get_option('embedded_restc_cpp')
|
|
if get_option('restc_cpp_with_zlib')
|
|
zlib_dep = dependency('zlib')
|
|
endif
|
|
if get_option('restc_cpp_with_tls')
|
|
tls_dep = dependency('OpenSSL')
|
|
endif
|
|
endif
|
|
|
|
pvt_incdir = include_directories('restc-cpp/src')
|
|
pub_incdir = include_directories('restc-cpp/include', 'include')
|
|
|
|
boost_test_dep = dependency('boost', modules: ['log'], required: get_option('tests'))
|
|
|
|
subdir('include/restc-cpp')
|
|
|
|
restc_cpp_target = library(meson.project_name(),
|
|
'restc-cpp/src/ChunkedReaderImpl.cpp',
|
|
'restc-cpp/src/ChunkedWriterImpl.cpp',
|
|
'restc-cpp/src/IoReaderImpl.cpp',
|
|
'restc-cpp/src/IoWriterImpl.cpp',
|
|
'restc-cpp/src/PlainReaderImpl.cpp',
|
|
'restc-cpp/src/PlainWriterImpl.cpp',
|
|
'restc-cpp/src/NoBodyReaderImpl.cpp',
|
|
'restc-cpp/src/DataReaderStream.cpp',
|
|
'restc-cpp/src/RestClientImpl.cpp',
|
|
'restc-cpp/src/RequestImpl.cpp',
|
|
'restc-cpp/src/ReplyImpl.cpp',
|
|
'restc-cpp/src/ConnectionPoolImpl.cpp',
|
|
'restc-cpp/src/Url.cpp',
|
|
'restc-cpp/src/RequestBodyStringImpl.cpp',
|
|
'restc-cpp/src/RequestBodyFileImpl.cpp',
|
|
'restc-cpp/src/url_encode.cpp',
|
|
zipreaderimpl,
|
|
install: true,
|
|
include_directories: [pvt_incdir, pub_incdir],
|
|
dependencies: [
|
|
zlib_dep,
|
|
tls_dep,
|
|
thread_dep,
|
|
boost_dep,
|
|
rapidjson_dep,
|
|
],
|
|
cpp_args: compiler_opts,
|
|
)
|
|
|
|
restc_cpp_dep = declare_dependency(
|
|
link_with: restc_cpp_target,
|
|
include_directories: pub_incdir,
|
|
compile_args: compiler_opts,
|
|
dependencies: [tls_dep, thread_dep, boost_dep],
|
|
)
|
|
|
|
lest_inc = include_directories('subprojects/lest/include')
|
|
subdir('tests', if_found: boost_test_dep)
|