From 7a5effb0f95e295c265fe09e7414d859a6d79657 Mon Sep 17 00:00:00 2001 From: dundargoc Date: Wed, 25 Oct 2023 16:54:20 +0200 Subject: [PATCH] build: bump required minimum libvterm version to 0.3.3 Also add detection for libvterm patch version. --- cmake/FindLibvterm.cmake | 11 ++++++++++- src/nvim/CMakeLists.txt | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/cmake/FindLibvterm.cmake b/cmake/FindLibvterm.cmake index f591f6853f..68c2646d47 100644 --- a/cmake/FindLibvterm.cmake +++ b/cmake/FindLibvterm.cmake @@ -8,7 +8,16 @@ if(LIBVTERM_INCLUDE_DIR AND EXISTS "${LIBVTERM_INCLUDE_DIR}/vterm.h") file(STRINGS ${LIBVTERM_INCLUDE_DIR}/vterm.h VTERM_VERSION_MINOR REGEX "#define VTERM_VERSION_MINOR") string(REGEX MATCH "[0-9]+" VTERM_VERSION_MINOR ${VTERM_VERSION_MINOR}) - set(VTERM_VERSION ${VTERM_VERSION_MAJOR}.${VTERM_VERSION_MINOR}) + file(STRINGS ${LIBVTERM_INCLUDE_DIR}/vterm.h VTERM_VERSION_PATCH REGEX "#define VTERM_VERSION_PATCH") + + # The following is needed to give a coherent error for versions 0.3.2 and + # smaller. + if(VTERM_VERSION_PATCH) + string(REGEX MATCH "[0-9]+" VTERM_VERSION_PATCH ${VTERM_VERSION_PATCH}) + string(PREPEND VTERM_VERSION_PATCH ".") + endif() + + set(VTERM_VERSION ${VTERM_VERSION_MAJOR}.${VTERM_VERSION_MINOR}${VTERM_VERSION_PATCH}) endif() find_package_handle_standard_args(Libvterm diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt index 839764121c..9cad80db23 100644 --- a/src/nvim/CMakeLists.txt +++ b/src/nvim/CMakeLists.txt @@ -28,7 +28,7 @@ target_link_libraries(main_lib INTERFACE ${LUV_LIBRARY}) find_package(Iconv REQUIRED) find_package(Lpeg REQUIRED) find_package(Libtermkey 0.22 REQUIRED) -find_package(Libvterm 0.3 REQUIRED) +find_package(Libvterm 0.3.3 REQUIRED) find_package(Msgpack 1.0.0 REQUIRED) find_package(Treesitter 0.20.8 REQUIRED) find_package(Unibilium 2.0 REQUIRED)