ipfs: add options to disable

- CPPFLAGS: `-DCURL_DISABLE_IPFS`
- configure: `--disable-ipfs`
- cmake: `-DCURL_DISABLE_IPFS=ON`

Fixes #14824
Closes #14827
This commit is contained in:
Viktor Szakats 2024-09-08 12:26:45 +02:00
parent 8b42df3eb1
commit ce7d0d4137
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
12 changed files with 71 additions and 4 deletions

View file

@ -331,6 +331,7 @@ void tool_version_info(void)
printf("Release-Date: %s\n", LIBCURL_TIMESTAMP);
#endif
if(built_in_protos[0]) {
#ifndef CURL_DISABLE_IPFS
const char *insert = NULL;
/* we have ipfs and ipns support if libcurl has http support */
for(builtin = built_in_protos; *builtin; ++builtin) {
@ -345,16 +346,19 @@ void tool_version_info(void)
insert = *builtin;
}
}
#endif /* !CURL_DISABLE_IPFS */
printf("Protocols:");
for(builtin = built_in_protos; *builtin; ++builtin) {
/* Special case: do not list rtmp?* protocols.
They may only appear together with "rtmp" */
if(!curl_strnequal(*builtin, "rtmp", 4) || !builtin[0][4])
printf(" %s", *builtin);
#ifndef CURL_DISABLE_IPFS
if(insert && insert == *builtin) {
printf(" ipfs ipns");
insert = NULL;
}
#endif /* !CURL_DISABLE_IPFS */
}
puts(""); /* newline */
}