Skip to content

Commit 1cddf73

Browse files
committed
build: add fallback for cpp-httplib, a c++ curl wrapper
1 parent 1afcb71 commit 1cddf73

File tree

3 files changed

+47
-23
lines changed

3 files changed

+47
-23
lines changed

subprojects/cpr.wrap

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[wrap-file]
2+
directory = cpr-1.10.5
3+
source_url = https://github.com/libcpr/cpr/archive/1.10.5.tar.gz
4+
source_filename = cpr-1.10.5.tar.gz
5+
source_hash = c8590568996cea918d7cf7ec6845d954b9b95ab2c4980b365f582a665dea08d8
6+
patch_filename = cpr_1.10.5-1_patch.zip
7+
patch_url = https://wrapdb.mesonbuild.com/v2/cpr_1.10.5-1/get_patch
8+
patch_hash = 01e31e1bd47bc55dabc8e3b0633451abefc37532ba57b3ba3f0a304592ea5ac5
9+
source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/cpr_1.10.5-1/cpr-1.10.5.tar.gz
10+
wrapdb_version = 1.10.5-1
11+
12+
[provide]
13+
cpr = cpr_dep

subprojects/curl.wrap

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[wrap-file]
2+
directory = curl-8.10.1
3+
source_url = https://github.com/curl/curl/releases/download/curl-8_10_1/curl-8.10.1.tar.xz
4+
source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/curl_8.10.1-1/curl-8.10.1.tar.xz
5+
source_filename = curl-8.10.1.tar.xz
6+
source_hash = 73a4b0e99596a09fa5924a4fb7e4b995a85fda0d18a2c02ab9cf134bebce04ee
7+
patch_filename = curl_8.10.1-1_patch.zip
8+
patch_url = https://wrapdb.mesonbuild.com/v2/curl_8.10.1-1/get_patch
9+
patch_hash = 707c28f35fc9b0e8d68c0c2800712007612f922a31da9637ce706a2159f3ddd8
10+
wrapdb_version = 8.10.1-1
11+
12+
[provide]
13+
dependency_names = libcurl

tools/dependencies/meson.build

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -229,37 +229,35 @@ if build_application
229229
}
230230
endif
231231

232-
online_multiplayer_supported = true
233-
234-
if (
235-
meson.is_cross_build()
236-
and (
237-
host_machine.system() == 'switch'
238-
or host_machine.system() == '3ds'
239-
)
232+
cpp_httlib_dep = dependency(
233+
'cpp-httplib',
234+
required: false,
235+
default_options: {
236+
'cpp-httplib_openssl': 'enabled',
237+
'cpp-httplib_zlib': 'enabled',
238+
},
240239
)
241-
online_multiplayer_supported = false
242240

243-
# TODO: use libcurl and
244-
# https://github.com/uctakeoff/uc-curl
245-
# or https://github.com/JosephP91/curlcpp
241+
if cpp_httlib_dep.found()
242+
243+
graphics_lib += {'deps': [graphics_lib.get('deps'), cpp_httlib_dep]}
244+
245+
else
246+
247+
curl_cpp_wrapper = dependency(
248+
'cpr',
249+
required: true,
250+
default_options: {'tests': 'disabled'},
251+
)
246252

247253
graphics_lib += {
254+
'deps': [graphics_lib.get('deps'), curl_cpp_wrapper],
248255
'compile_args': [
249256
graphics_lib.get('compile_args'),
250-
'-D_ONLINE_MULTIPLAYER_NOT_SUPPORTED',
257+
'-D_OOPETRIS_ONLINE_USE_CURL',
251258
],
252259
}
253-
else
254-
cpp_httlib_dep = dependency(
255-
'cpp-httplib',
256-
required: true,
257-
default_options: {
258-
'cpp-httplib_openssl': 'enabled',
259-
'cpp-httplib_zlib': 'enabled',
260-
},
261-
)
262-
graphics_lib += {'deps': [graphics_lib.get('deps'), cpp_httlib_dep]}
260+
263261
endif
264262

265263
build_installer = get_option('build_installer')

0 commit comments

Comments
 (0)