From ffdc72da4f086e9a62b946970778495bba400e69 Mon Sep 17 00:00:00 2001 From: MathiasRaoul Date: Fri, 7 Feb 2020 16:29:05 +0000 Subject: quic: Check quicly version tag at compile time - updates the quicly version to 0.1.0-vpp - adds workaround for quicly_send()/assert_consistency() failure Type: feature Change-Id: I4c7e0ffc720ad9a685b89046a83646d59febd6cd Signed-off-by: MathiasRaoul Signed-off-by: Nathan Skrzypczak Signed-off-by: Dave Wallace --- src/plugins/quic/CMakeLists.txt | 42 +++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 16 deletions(-) (limited to 'src/plugins/quic/CMakeLists.txt') diff --git a/src/plugins/quic/CMakeLists.txt b/src/plugins/quic/CMakeLists.txt index 43fb483a7bc..859b6d98c4c 100644 --- a/src/plugins/quic/CMakeLists.txt +++ b/src/plugins/quic/CMakeLists.txt @@ -12,8 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -message(STATUS "Looking for quicly") unset(QUIC_LINK_LIBRARIES) +set(EXPECTED_QUICLY_VERSION "0.1.0-vpp") find_path(QUICLY_INCLUDE_DIR NAMES quicly.h) find_path(PICOTLS_INCLUDE_DIR NAMES picotls.h) @@ -28,22 +28,32 @@ list(APPEND QUIC_LINK_LIBRARIES ) if(QUICLY_INCLUDE_DIR AND QUIC_LINK_LIBRARIES) - include_directories (${QUICLY_INCLUDE_DIR}) - - if(PICOTLS_INCLUDE_DIR) - include_directories (${PICOTLS_INCLUDE_DIR}) + if(EXISTS "${QUICLY_INCLUDE_DIR}/quicly/version.h") + file(STRINGS "${QUICLY_INCLUDE_DIR}/quicly/version.h" quicly_version_str REGEX "^#define[\t ]+LIBQUICLY_VERSION[\t ]+\".*\"") + string(REGEX REPLACE "^#define[\t ]+LIBQUICLY_VERSION[\t ]+\"([^\"]*)\".*" "\\1" QUICLY_VERSION_STRING "${quicly_version_str}") + unset(quicly_version_str) endif() - add_vpp_plugin(quic - SOURCES - certs.c - error.c - quic.c - quic_crypto.c - - LINK_LIBRARIES ${QUIC_LINK_LIBRARIES} - ) - message(STATUS "Found quicly in ${QUICLY_INCLUDE_DIR}") + if (${QUICLY_VERSION_STRING} MATCHES "${EXPECTED_QUICLY_VERSION}") + include_directories (${QUICLY_INCLUDE_DIR}) + + if(PICOTLS_INCLUDE_DIR) + include_directories (${PICOTLS_INCLUDE_DIR}) + endif() + + add_vpp_plugin(quic + SOURCES + certs.c + error.c + quic.c + quic_crypto.c + + LINK_LIBRARIES ${QUIC_LINK_LIBRARIES} + ) + message(STATUS "Found quicly ${EXPECTED_QUICLY_VERSION} in ${QUICLY_INCLUDE_DIR}") + else() + message(STATUS "-- quicly ${EXPECTED_QUICLY_VERSION} not found - QUIC plugin disabled") + endif() else() - message(WARNING "-- quicly not found - quic_plugin disabled") + message(WARNING "-- quicly headers not found - QUIC plugin disabled") endif() -- cgit 1.2.3-korg