aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/quic/CMakeLists.txt
diff options
context:
space:
mode:
authorMathiasRaoul <mathias.raoul@gmail.com>2020-02-07 16:29:05 +0000
committerFlorin Coras <florin.coras@gmail.com>2020-03-27 17:43:33 +0000
commitffdc72da4f086e9a62b946970778495bba400e69 (patch)
tree3633cea2b6aa5f862eccc85a7e80d9db66d6aa96 /src/plugins/quic/CMakeLists.txt
parent4e149776890a5ac91bb14957d57def3c73325061 (diff)
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 <mathias.raoul@gmail.com> Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com> Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Diffstat (limited to 'src/plugins/quic/CMakeLists.txt')
-rw-r--r--src/plugins/quic/CMakeLists.txt42
1 files changed, 26 insertions, 16 deletions
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()