Bug 176887 - [CMake] Find Nghttp2
Summary: [CMake] Find Nghttp2
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Don Olmstead
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-13 18:24 PDT by Don Olmstead
Modified: 2022-05-27 12:47 PDT (History)
6 users (show)

See Also:


Attachments
Patch (3.21 KB, patch)
2017-09-13 18:28 PDT, Don Olmstead
achristensen: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Don Olmstead 2017-09-13 18:24:53 PDT
WinCairo plans to use nghttp2 once curl is updated in the requirements.
Comment 1 Don Olmstead 2017-09-13 18:28:37 PDT
Created attachment 320720 [details]
Patch

Support detection of nghttp2
Comment 2 Alex Christensen 2017-09-13 23:21:18 PDT
Comment on attachment 320720 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=320720&action=review

> Source/cmake/FindNghttp2.cmake:52
> +        file(READ "${NGHTTP2_INCLUDE_DIRS}/nghttp2ver.h" _nghttp2_version_content)
> +
> +        string(REGEX MATCH "#define +NGHTTP2_VERSION +\"([0-9]+\.[0-9]+\.[0-9]+)\"" _dummy "${_nghttp2_version_content}")
> +        set(NGHTTP2_VERSION "${CMAKE_MATCH_1}")

It would be nice to not do this every time we run CMake.  Why will we need this value from within CMake?  Can't we just detect it in headers or require a certain version?
Comment 3 Konstantin Tokarev 2017-09-14 03:00:01 PDT
Comment on attachment 320720 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=320720&action=review

>> Source/cmake/FindNghttp2.cmake:52
>> +        set(NGHTTP2_VERSION "${CMAKE_MATCH_1}")
> 
> It would be nice to not do this every time we run CMake.  Why will we need this value from within CMake?  Can't we just detect it in headers or require a certain version?

Certainly, this code should be run only once. One way to do this is to save result in cache variable.

However, I don't see that we make use of this version variable. So it should be enough to pass PC_NGHTTP2_VERSION instead like most our modules do, and if pkg-config is not used it will be undefined.