Skip to content

Commit dac6f12

Browse files
committed
Making requests part of stdlib optional, because libcurl makes ldd blow up
1 parent f9f85af commit dac6f12

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

meson_options.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
option('use_curl', type: 'boolean', value: true, description: 'Enable libcurl support - will unlock request functions in the standard library')
2+

src/library/meson.build

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,20 @@ else
3535
endif
3636

3737
# Try to find libcurl
38-
libcurl_dep = dependency('libcurl', required : false)
39-
40-
if libcurl_dep.found()
41-
ric_c_args += ['-DRIC_SCRIPT_REQUESTS']
42-
library_source_list += ['librequests.c']
43-
deps += [libcurl_dep]
38+
use_curl = get_option('use_curl')
39+
40+
if use_curl
41+
libcurl_dep = dependency('libcurl', required: false)
42+
if libcurl_dep.found()
43+
ric_c_args += ['-DRIC_SCRIPT_REQUESTS']
44+
library_source_list += ['librequests.c']
45+
deps += [libcurl_dep]
46+
else
47+
warning('libcurl not found, building without curl support')
48+
endif
49+
else
50+
message('Building without libcurl support (disabled by option)')
4451
endif
4552

53+
4654
library_sources = files(library_source_list)

0 commit comments

Comments
 (0)