From d433e058773757d64eafaec1d26aace425278102 Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Sat, 29 Aug 2020 18:03:04 +0100 Subject: [PATCH] Change restc-cpp into a meson wrap (lest too) --- .gitignore | 2 + .gitmodules | 6 --- subprojects/lest.wrap | 7 +++ subprojects/packagefiles/lest/meson.build | 9 ++++ .../restc-cpp/include/restc-cpp/meson.build | 0 .../{ => packagefiles}/restc-cpp/meson.build | 43 +++++++++--------- .../restc-cpp/meson_options.txt | 0 .../restc-cpp/tests/meson.build | 0 .../restc-cpp/tests/unit/meson.build | 40 +++++++++++++++++ subprojects/restc-cpp.wrap | 7 +++ subprojects/restc-cpp/restc-cpp | 1 - subprojects/restc-cpp/subprojects/lest | 1 - subprojects/restc-cpp/tests/unit/meson.build | 44 ------------------- 13 files changed, 86 insertions(+), 74 deletions(-) create mode 100644 subprojects/lest.wrap create mode 100644 subprojects/packagefiles/lest/meson.build rename subprojects/{ => packagefiles}/restc-cpp/include/restc-cpp/meson.build (100%) rename subprojects/{ => packagefiles}/restc-cpp/meson.build (58%) rename subprojects/{ => packagefiles}/restc-cpp/meson_options.txt (100%) rename subprojects/{ => packagefiles}/restc-cpp/tests/meson.build (100%) create mode 100644 subprojects/packagefiles/restc-cpp/tests/unit/meson.build create mode 100644 subprojects/restc-cpp.wrap delete mode 160000 subprojects/restc-cpp/restc-cpp delete mode 160000 subprojects/restc-cpp/subprojects/lest delete mode 100644 subprojects/restc-cpp/tests/unit/meson.build diff --git a/.gitignore b/.gitignore index 05c42b8..2dd170d 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,5 @@ links.txt subprojects/curlcpp/ subprojects/SQLiteCpp/ subprojects/simdjson +subprojects/restc-cpp +subprojects/lest diff --git a/.gitmodules b/.gitmodules index 6f69e58..6cecf88 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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"] path = subprojects/date url = https://github.com/HowardHinnant/date.git @@ -13,6 +10,3 @@ [submodule "subprojects/magic_enum"] path = subprojects/magic_enum 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 diff --git a/subprojects/lest.wrap b/subprojects/lest.wrap new file mode 100644 index 0000000..ab048a8 --- /dev/null +++ b/subprojects/lest.wrap @@ -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 diff --git a/subprojects/packagefiles/lest/meson.build b/subprojects/packagefiles/lest/meson.build new file mode 100644 index 0000000..80b68a3 --- /dev/null +++ b/subprojects/packagefiles/lest/meson.build @@ -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', +) diff --git a/subprojects/restc-cpp/include/restc-cpp/meson.build b/subprojects/packagefiles/restc-cpp/include/restc-cpp/meson.build similarity index 100% rename from subprojects/restc-cpp/include/restc-cpp/meson.build rename to subprojects/packagefiles/restc-cpp/include/restc-cpp/meson.build diff --git a/subprojects/restc-cpp/meson.build b/subprojects/packagefiles/restc-cpp/meson.build similarity index 58% rename from subprojects/restc-cpp/meson.build rename to subprojects/packagefiles/restc-cpp/meson.build index 65bf99f..3d44f90 100644 --- a/subprojects/restc-cpp/meson.build +++ b/subprojects/packagefiles/restc-cpp/meson.build @@ -1,12 +1,12 @@ project('restc-cpp', 'cpp', version: '0.9.2', - meson_version: '>=0.50.0', + meson_version: '>=0.55.0', 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') - zipreaderimpl = files('restc-cpp/src/ZipReaderImpl.cpp') + zipreaderimpl = files('src/ZipReaderImpl.cpp') endif compiler_opts = ['-DBOOST_COROUTINE_NO_DEPRECATION_WARNING=1'] @@ -31,30 +31,30 @@ if not get_option('embedded_restc_cpp') endif endif -pvt_incdir = include_directories('restc-cpp/src') -pub_incdir = include_directories('restc-cpp/include', 'include') +pvt_incdir = include_directories('src') +pub_incdir = include_directories('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', + 'src/ChunkedReaderImpl.cpp', + 'src/ChunkedWriterImpl.cpp', + 'src/IoReaderImpl.cpp', + 'src/IoWriterImpl.cpp', + 'src/PlainReaderImpl.cpp', + 'src/PlainWriterImpl.cpp', + 'src/NoBodyReaderImpl.cpp', + 'src/DataReaderStream.cpp', + 'src/RestClientImpl.cpp', + 'src/RequestImpl.cpp', + 'src/ReplyImpl.cpp', + 'src/ConnectionPoolImpl.cpp', + 'src/Url.cpp', + 'src/RequestBodyStringImpl.cpp', + 'src/RequestBodyFileImpl.cpp', + 'src/url_encode.cpp', zipreaderimpl, install: true, include_directories: [pvt_incdir, pub_incdir], @@ -75,5 +75,4 @@ restc_cpp_dep = declare_dependency( dependencies: [tls_dep, thread_dep, boost_dep], ) -lest_inc = include_directories('subprojects/lest/include') subdir('tests', if_found: boost_test_dep) diff --git a/subprojects/restc-cpp/meson_options.txt b/subprojects/packagefiles/restc-cpp/meson_options.txt similarity index 100% rename from subprojects/restc-cpp/meson_options.txt rename to subprojects/packagefiles/restc-cpp/meson_options.txt diff --git a/subprojects/restc-cpp/tests/meson.build b/subprojects/packagefiles/restc-cpp/tests/meson.build similarity index 100% rename from subprojects/restc-cpp/tests/meson.build rename to subprojects/packagefiles/restc-cpp/tests/meson.build diff --git a/subprojects/packagefiles/restc-cpp/tests/unit/meson.build b/subprojects/packagefiles/restc-cpp/tests/unit/meson.build new file mode 100644 index 0000000..fe3ef79 --- /dev/null +++ b/subprojects/packagefiles/restc-cpp/tests/unit/meson.build @@ -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) diff --git a/subprojects/restc-cpp.wrap b/subprojects/restc-cpp.wrap new file mode 100644 index 0000000..2008129 --- /dev/null +++ b/subprojects/restc-cpp.wrap @@ -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 diff --git a/subprojects/restc-cpp/restc-cpp b/subprojects/restc-cpp/restc-cpp deleted file mode 160000 index 48bc608..0000000 --- a/subprojects/restc-cpp/restc-cpp +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 48bc608b9bedb358cccb1c73b1a30a9eda171776 diff --git a/subprojects/restc-cpp/subprojects/lest b/subprojects/restc-cpp/subprojects/lest deleted file mode 160000 index b738c19..0000000 --- a/subprojects/restc-cpp/subprojects/lest +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b738c1924aa6af2610c36d864c2fd1d23cb44b68 diff --git a/subprojects/restc-cpp/tests/unit/meson.build b/subprojects/restc-cpp/tests/unit/meson.build deleted file mode 100644 index 82778a8..0000000 --- a/subprojects/restc-cpp/tests/unit/meson.build +++ /dev/null @@ -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)