Skip to content

Commit

Permalink
libcurl: Fix http2 detection in CMake builds (#26742)
Browse files Browse the repository at this point in the history
---------

Co-authored-by: Ernesto de Gracia Herranz <[email protected]>
  • Loading branch information
AbrilRBS and ErniGH authored Mar 3, 2025
1 parent a6ac366 commit 7a07693
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions recipes/libcurl/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ def _patch_cmake(self):
replace_in_file(self, cmakelists, "find_package(NGHTTP2 REQUIRED)", "find_package(libnghttp2 REQUIRED CONFIG)")
else:
replace_in_file(self, cmakelists, "find_package(NGHTTP2)", "find_package(libnghttp2 REQUIRED CONFIG)")
replace_in_file(self, cmakelists, "NGHTTP2_FOUND", "libnghttp2_FOUND")
replace_in_file(self, cmakelists, "${NGHTTP2_INCLUDE_DIRS}", "${libnghttp2_INCLUDE_DIRS}")
replace_in_file(self, cmakelists, "${NGHTTP2_LIBRARIES}", "libnghttp2::nghttp2")

Expand Down
8 changes: 7 additions & 1 deletion recipes/libcurl/all/test_package/test_package.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ int main(void)
CURL *curl;
int retval = 0;
const char *const *proto;
const char *const *feat;
curl_version_info_data* id = curl_version_info(CURLVERSION_NOW);
if (!id)
return 1;
Expand All @@ -14,7 +15,12 @@ int main(void)
for(proto = id->protocols; *proto; proto++) {
printf("%s ", *proto);
}
printf("\nversion: %s\nssl version: %s\nfeatures: %d\n", id->version, id->ssl_version, id->features);
printf("\nversion: %s\nssl version: %s\n", id->version, id->ssl_version);

printf("features: ");
for(feat = id->feature_names; *feat; feat++) {
printf("%s ", *feat);
}

curl = curl_easy_init();
if(curl) {
Expand Down

0 comments on commit 7a07693

Please sign in to comment.