Skip to content
Snippets Groups Projects
Verified Commit 5996b403 authored by Nicolas Werner's avatar Nicolas Werner
Browse files

Add curl wrap

parent badf9278
No related branches found
No related tags found
1 merge request!2Add wraps for all dependencies
Pipeline #1315 passed
......@@ -7,5 +7,6 @@ compile_commands.json
/subprojects/doctest-*
/subprojects/libevent-*/
/subprojects/spdlog-*/
/subprojects/curl-*/
/subprojects/packagecache/
/*.pem
......@@ -9,7 +9,7 @@ build:
tags: [docker]
before_script:
- echo 'https://dl-cdn.alpinelinux.org/alpine/edge/testing' >> /etc/apk/repositories
- apk update && apk add clang-extra-tools meson git python3 py3-pip py3-flask lcov gcovr curl-dev libevent-dev spdlog-dev grep g++ cmake pkgconf openssl
- apk update && apk add meson git python3 py3-pip py3-flask lcov gcovr curl-dev libevent-dev spdlog-dev grep g++ cmake pkgconf openssl
- export PATH="$PATH:/root/.local/bin"
- pip3 install --user reuse
- ./scripts/run_tls_testserver.sh &
......@@ -32,7 +32,7 @@ build-with-wraps:
tags: [docker]
before_script:
- echo 'https://dl-cdn.alpinelinux.org/alpine/edge/testing' >> /etc/apk/repositories
- apk update && apk add clang-extra-tools meson git python3 py3-pip py3-flask curl-dev g++ cmake pkgconf openssl make
- apk update && apk add meson git python3 py3-pip py3-flask g++ cmake pkgconf openssl openssl-dev make
- export PATH="$PATH:/root/.local/bin"
- pip3 install --user reuse
- ./scripts/run_tls_testserver.sh &
......
......@@ -3,14 +3,14 @@ project('coeurl', 'cpp',
default_options : ['warning_level=3',
'cpp_std=c++17'])
deps = [
deps = [
dependency('threads', required: true),
dependency('libcurl', required: true),
dependency('spdlog', required: true)
]
]
libcurl_dep = dependency('libcurl', required: get_option('wrap_mode') == 'nofallback')
libevent_dep = dependency('libevent_core', required: get_option('wrap_mode') == 'nofallback',)
libevent_dep = dependency('libevent_core', required: get_option('wrap_mode') == 'nofallback',)
if target_machine.system() == 'windows'
libevent_threads_dep = dependency('libevent_windows', required: get_option('wrap_mode') == 'nofallback',)
else
......@@ -46,6 +46,24 @@ endif
deps += [libevent_dep, libevent_threads_dep]
if (not libcurl_dep.found()
or get_option('wrap_mode') == 'forcefallback'
or 'libcurl' in get_option('force_fallback_for'))
cmake = import('cmake')
libcurl_options = cmake.subproject_options()
libcurl_options.add_cmake_defines({
'CMAKE_C_FLAGS': '-fPIC',
'BUILD_SHARED_LIBS': false,
'BUILD_SHARED_AND_STATIC_LIBS': false,
'HTTP_ONLY': true,
})
libcurl_options.set_override_option('werror', 'false')
libcurl_options.set_override_option('warning_level', '0')
libcurl_proj = cmake.subproject('curl', options: libcurl_options)
libcurl_dep = libcurl_proj.dependency('libcurl')
endif
deps += [libcurl_dep]
include = include_directories('include')
lib = library('coeurl', ['lib/client.cpp', 'lib/request.cpp'],
......
[wrap-file]
directory = curl-7.77.0
source_url = https://github.com/curl/curl/releases/download/curl-7_77_0/curl-7.77.0.tar.xz
source_filename = curl-7.77.0.tar.xz
source_hash = 0f64582c54282f31c0de9f0a1a596b182776bd4df9a4c4a2a41bbeb54f62594b
[provides]
dependency_names = libcurl
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment