From e856918963eff2a8459ebbaf7e77ae2a43136641 Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Thu, 27 Aug 2020 23:55:15 +0100 Subject: [PATCH] Add curlcpp subproject --- .gitignore | 1 + meson.build | 2 +- src/meson.build | 7 ++++ subprojects/curlcpp.wrap | 7 ++++ subprojects/packagefiles/curlcpp/meson.build | 36 +++++++++++++++++++ .../packagefiles/curlcpp/src/meson.build | 24 +++++++++++++ 6 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 subprojects/curlcpp.wrap create mode 100644 subprojects/packagefiles/curlcpp/meson.build create mode 100644 subprojects/packagefiles/curlcpp/src/meson.build diff --git a/.gitignore b/.gitignore index 16acd6f..a244c3c 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ tags compile_commands.json links.txt *.bin +subprojects/curlcpp/ diff --git a/meson.build b/meson.build index 8cdf05f..21592c5 100644 --- a/meson.build +++ b/meson.build @@ -1,6 +1,6 @@ project('orotool', 'cpp', 'c', version: '0.1.0', - meson_version: '>=0.49.2', + meson_version: '>=0.55.0', default_options: ['buildtype=debug', 'cpp_std=gnu++17', 'b_ndebug=if-release'], license: 'GPL3+', ) diff --git a/src/meson.build b/src/meson.build index 419bd40..69196e9 100644 --- a/src/meson.build +++ b/src/meson.build @@ -6,6 +6,13 @@ restc_cpp_dep = dependency('restc-cpp', version: '>=0.1.1', ], ) +curlcpp_dep = dependency('curlcpp', version: '>=1.4', + fallback: ['curlcpp', 'curlcpp_dep'], + default_options: [ + 'default_library=static', + ], +) + if not get_option('with_sqlite').disabled() sqlitecpp_dep = dependency('sqlitecpp', version: '>=3.0.0', fallback: ['SQLiteCpp', 'sqlitecpp_dep'], diff --git a/subprojects/curlcpp.wrap b/subprojects/curlcpp.wrap new file mode 100644 index 0000000..4df13ad --- /dev/null +++ b/subprojects/curlcpp.wrap @@ -0,0 +1,7 @@ +[wrap-git] +url = https://github.com/JosephP91/curlcpp.git +revision = cb426314da69a6a66ac50437362844e6333ca5a9 +patch_directory = curlcpp + +[provide] +dependency_names = curlcpp-1.4 diff --git a/subprojects/packagefiles/curlcpp/meson.build b/subprojects/packagefiles/curlcpp/meson.build new file mode 100644 index 0000000..632e304 --- /dev/null +++ b/subprojects/packagefiles/curlcpp/meson.build @@ -0,0 +1,36 @@ +project('curlcpp', 'cpp', + version: '1.4', + meson_version: '>=0.49.2', + default_options: ['buildtype=release', 'cpp_std=c++11', 'b_ndebug=if-release'], + license: 'MIT', +) + +curl_dep = dependency('libcurl', version: '>=7.28.0') +public_incl = include_directories('include') +subdir('src') + +install_headers( + 'include/cookie.h', + 'include/cookie_date.h', + 'include/cookie_datetime.h', + 'include/cookie_time.h', + 'include/curl_config.h', + 'include/curl_cookie.h', + 'include/curl_easy.h', + 'include/curl_easy_info.h', + 'include/curl_exception.h', + 'include/curl_form.h', + 'include/curl_global.h', + 'include/curl_header.h', + 'include/curl_info.h', + 'include/curl_interface.h', + 'include/curl_ios.h', + 'include/curl_multi.h', + 'include/curl_option.h', + 'include/curl_pair.h', + 'include/curl_receiver.h', + 'include/curl_sender.h', + 'include/curl_share.h', + 'include/curl_utility.h', + subdir: meson.project_name(), +) diff --git a/subprojects/packagefiles/curlcpp/src/meson.build b/subprojects/packagefiles/curlcpp/src/meson.build new file mode 100644 index 0000000..433c328 --- /dev/null +++ b/subprojects/packagefiles/curlcpp/src/meson.build @@ -0,0 +1,24 @@ +curlcpp = library(meson.project_name(), + 'curl_easy.cpp', + 'curl_header.cpp', + 'curl_global.cpp', + 'curl_form.cpp', + 'curl_multi.cpp', + 'curl_share.cpp', + 'curl_info.cpp', + 'curl_cookie.cpp', + 'curl_exception.cpp', + 'cookie.cpp', + 'cookie_date.cpp', + 'cookie_time.cpp', + 'cookie_datetime.cpp', + dependencies: [curl_dep], + include_directories: public_incl, + install: true, +) + +curlcpp_dep = declare_dependency( + link_with: curlcpp, + include_directories: public_incl, + dependencies: curl_dep.partial_dependency(includes: true), +)