You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by GitBox <gi...@apache.org> on 2021/02/04 19:01:53 UTC

[GitHub] [qpid-dispatch] kgiusti commented on a change in pull request #1017: DISPATCH-1950: Knock down the version of libnghttp2 to 1.33.0. Also a…

kgiusti commented on a change in pull request #1017:
URL: https://github.com/apache/qpid-dispatch/pull/1017#discussion_r570471612



##########
File path: cmake/Findlibnghttp2.cmake
##########
@@ -17,16 +17,31 @@
 # under the License.
 #
 
+# Sets LIBNGHTTP2_VERSION_STRING from nghttp2ver.h
+
 find_library(NGHTTP2_LIBRARIES
   NAMES libnghttp2 nghttp2
 )
 
 find_path(NGHTTP2_INCLUDE_DIRS
-  NAMES "nghttp2/nghttp2.h"
+  NAMES "nghttp2/nghttp2.h" "nghttp2/nghttp2ver.h"
   HINTS "${CMAKE_INSTALL_PREFIX}/include"
   PATHS "/usr/include"
 )
 
-include(FindPackageHandleStandardArgs)
+if(NGHTTP2_INCLUDE_DIRS AND EXISTS "${NGHTTP2_INCLUDE_DIRS}/nghttp2/nghttp2ver.h")
+  # Extract the version info from nghttp2ver.h and set it in LIBNGHTTP2_VERSION_STRING
+  file(STRINGS "${NGHTTP2_INCLUDE_DIRS}/nghttp2/nghttp2ver.h" libnghttp2_version_str
+    REGEX "^#define[ \t]+NGHTTP2_VERSION[ \t]+\"[^\"]+\"")
+  string(REGEX REPLACE "^#define[ \t]+NGHTTP2_VERSION[ \t]+\"([^\"]+)\".*" "\\1"
+    LIBNGHTTP2_VERSION_STRING "${libnghttp2_version_str}")
+  unset(libnghttp2_version_str)
+endif()
+
+if (LIBNGHTTP2_VERSION_STRING AND libnghttp2_FIND_VERSION AND (LIBNGHTTP2_VERSION_STRING VERSION_LESS libnghttp2_FIND_VERSION))
+  message(STATUS "Found libnghttp2 version ${LIBNGHTTP2_VERSION_STRING} but at least ${libnghttp2_FIND_VERSION} is required. http2 support is disabled")

Review comment:
       probably should be message(WARNING.. not STATUS




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org