Change restc-cpp into a meson wrap (lest too)

This commit is contained in:
King_DuckZ 2020-08-29 18:03:04 +01:00
parent 32dea4d089
commit d433e05877
13 changed files with 86 additions and 74 deletions

2
.gitignore vendored
View file

@ -6,3 +6,5 @@ links.txt
subprojects/curlcpp/ subprojects/curlcpp/
subprojects/SQLiteCpp/ subprojects/SQLiteCpp/
subprojects/simdjson subprojects/simdjson
subprojects/restc-cpp
subprojects/lest

6
.gitmodules vendored
View file

@ -1,6 +1,3 @@
[submodule "subprojects/restc-cpp/restc-cpp"]
path = subprojects/restc-cpp/restc-cpp
url = https://github.com/jgaa/restc-cpp.git
[submodule "subprojects/date"] [submodule "subprojects/date"]
path = subprojects/date path = subprojects/date
url = https://github.com/HowardHinnant/date.git url = https://github.com/HowardHinnant/date.git
@ -13,6 +10,3 @@
[submodule "subprojects/magic_enum"] [submodule "subprojects/magic_enum"]
path = subprojects/magic_enum path = subprojects/magic_enum
url = https://github.com/Neargye/magic_enum.git url = https://github.com/Neargye/magic_enum.git
[submodule "subprojects/restc-cpp/subprojects/lest"]
path = subprojects/restc-cpp/subprojects/lest
url = https://github.com/martinmoene/lest.git

7
subprojects/lest.wrap Normal file
View file

@ -0,0 +1,7 @@
[wrap-git]
url = https://github.com/martinmoene/lest.git
revision = 16ad955825246db7c45807f2a20685689a9a25af
patch_directory = lest
[provide]
dependency_names = lest-1.35.1

View file

@ -0,0 +1,9 @@
project('lest', 'cpp',
version: '1.35.1',
meson_version: '>=0.49.2',
license: 'Boost',
)
lest_dep = declare_dependency(
include_directories: 'include',
)

View file

@ -1,12 +1,12 @@
project('restc-cpp', 'cpp', project('restc-cpp', 'cpp',
version: '0.9.2', version: '0.9.2',
meson_version: '>=0.50.0', meson_version: '>=0.55.0',
default_options: ['cpp_std=gnu++17'], default_options: ['cpp_std=gnu++17'],
) )
config_template = files('restc-cpp/config.h.template') config_template = files('config.h.template')
if get_option('restc_cpp_with_zlib') if get_option('restc_cpp_with_zlib')
zipreaderimpl = files('restc-cpp/src/ZipReaderImpl.cpp') zipreaderimpl = files('src/ZipReaderImpl.cpp')
endif endif
compiler_opts = ['-DBOOST_COROUTINE_NO_DEPRECATION_WARNING=1'] compiler_opts = ['-DBOOST_COROUTINE_NO_DEPRECATION_WARNING=1']
@ -31,30 +31,30 @@ if not get_option('embedded_restc_cpp')
endif endif
endif endif
pvt_incdir = include_directories('restc-cpp/src') pvt_incdir = include_directories('src')
pub_incdir = include_directories('restc-cpp/include', 'include') pub_incdir = include_directories('include', 'include')
boost_test_dep = dependency('boost', modules: ['log'], required: get_option('tests')) boost_test_dep = dependency('boost', modules: ['log'], required: get_option('tests'))
subdir('include/restc-cpp') subdir('include/restc-cpp')
restc_cpp_target = library(meson.project_name(), restc_cpp_target = library(meson.project_name(),
'restc-cpp/src/ChunkedReaderImpl.cpp', 'src/ChunkedReaderImpl.cpp',
'restc-cpp/src/ChunkedWriterImpl.cpp', 'src/ChunkedWriterImpl.cpp',
'restc-cpp/src/IoReaderImpl.cpp', 'src/IoReaderImpl.cpp',
'restc-cpp/src/IoWriterImpl.cpp', 'src/IoWriterImpl.cpp',
'restc-cpp/src/PlainReaderImpl.cpp', 'src/PlainReaderImpl.cpp',
'restc-cpp/src/PlainWriterImpl.cpp', 'src/PlainWriterImpl.cpp',
'restc-cpp/src/NoBodyReaderImpl.cpp', 'src/NoBodyReaderImpl.cpp',
'restc-cpp/src/DataReaderStream.cpp', 'src/DataReaderStream.cpp',
'restc-cpp/src/RestClientImpl.cpp', 'src/RestClientImpl.cpp',
'restc-cpp/src/RequestImpl.cpp', 'src/RequestImpl.cpp',
'restc-cpp/src/ReplyImpl.cpp', 'src/ReplyImpl.cpp',
'restc-cpp/src/ConnectionPoolImpl.cpp', 'src/ConnectionPoolImpl.cpp',
'restc-cpp/src/Url.cpp', 'src/Url.cpp',
'restc-cpp/src/RequestBodyStringImpl.cpp', 'src/RequestBodyStringImpl.cpp',
'restc-cpp/src/RequestBodyFileImpl.cpp', 'src/RequestBodyFileImpl.cpp',
'restc-cpp/src/url_encode.cpp', 'src/url_encode.cpp',
zipreaderimpl, zipreaderimpl,
install: true, install: true,
include_directories: [pvt_incdir, pub_incdir], include_directories: [pvt_incdir, pub_incdir],
@ -75,5 +75,4 @@ restc_cpp_dep = declare_dependency(
dependencies: [tls_dep, thread_dep, boost_dep], dependencies: [tls_dep, thread_dep, boost_dep],
) )
lest_inc = include_directories('subprojects/lest/include')
subdir('tests', if_found: boost_test_dep) subdir('tests', if_found: boost_test_dep)

View file

@ -0,0 +1,40 @@
lest_dep = subproject('lest').get_variable('lest_dep')
boost_dep = dependency('boost', modules: ['log'])
url_tests = executable('url_tests',
'../../tests/unit/UrlTests.cpp',
dependencies: [restc_cpp_dep, lest_dep],
)
json_serialize_tests = executable('json_serialize_tests',
'../../tests/unit/JsonSerializeTests.cpp',
dependencies: [restc_cpp_dep, boost_dep, lest_dep],
)
json_iostream_tests = executable('json_iostream_tests',
'../../tests/unit/Iostream2JsonTests.cpp',
dependencies: [restc_cpp_dep, boost_dep, lest_dep],
)
http_reply_tests = executable('http_reply_tests',
'../../tests/unit/HttpReplyTests.cpp',
dependencies: [restc_cpp_dep, boost_dep, lest_dep],
)
async_sleep_tests = executable('async_sleep_tests',
'../../tests/unit/AsyncSleepTests.cpp',
dependencies: [restc_cpp_dep, boost_dep, lest_dep],
)
request_builder_tests = executable('request_builder_tests',
'../../tests/unit/RequestBuilder.cpp',
dependencies: [restc_cpp_dep, lest_dep],
)
test('url_tests', url_tests)
test('json_serialize_tests', json_serialize_tests)
test('json_iostream_tests', json_iostream_tests)
test('http_reply_tests', http_reply_tests)
test('async_sleep_tests', async_sleep_tests)
test('request_builder_tests', request_builder_tests)

View file

@ -0,0 +1,7 @@
[wrap-git]
url = https://github.com/jgaa/restc-cpp.git
patch_directory = restc-cpp
revision = 48bc608b9bedb358cccb1c73b1a30a9eda171776
[provide]
dependency_names = restc-cpp-0.9.2

@ -1 +0,0 @@
Subproject commit 48bc608b9bedb358cccb1c73b1a30a9eda171776

@ -1 +0,0 @@
Subproject commit b738c1924aa6af2610c36d864c2fd1d23cb44b68

View file

@ -1,44 +0,0 @@
boost_dep = dependency('boost', modules: ['log'])
url_tests = executable('url_tests',
'../../restc-cpp/tests/unit/UrlTests.cpp',
dependencies: [restc_cpp_dep],
include_directories: [lest_inc],
)
json_serialize_tests = executable('json_serialize_tests',
'../../restc-cpp/tests/unit/JsonSerializeTests.cpp',
dependencies: [restc_cpp_dep, boost_dep],
include_directories: [lest_inc],
)
json_iostream_tests = executable('json_iostream_tests',
'../../restc-cpp/tests/unit/Iostream2JsonTests.cpp',
dependencies: [restc_cpp_dep, boost_dep],
include_directories: [lest_inc],
)
http_reply_tests = executable('http_reply_tests',
'../../restc-cpp/tests/unit/HttpReplyTests.cpp',
dependencies: [restc_cpp_dep, boost_dep],
include_directories: [lest_inc],
)
async_sleep_tests = executable('async_sleep_tests',
'../../restc-cpp/tests/unit/AsyncSleepTests.cpp',
dependencies: [restc_cpp_dep, boost_dep],
include_directories: [lest_inc],
)
request_builder_tests = executable('request_builder_tests',
'../../restc-cpp/tests/unit/RequestBuilder.cpp',
dependencies: [restc_cpp_dep],
include_directories: [lest_inc],
)
test('url_tests', url_tests)
test('json_serialize_tests', json_serialize_tests)
test('json_iostream_tests', json_iostream_tests)
test('http_reply_tests', http_reply_tests)
test('async_sleep_tests', async_sleep_tests)
test('request_builder_tests', request_builder_tests)