aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Hahler <git@thequod.de>2019-08-03 15:20:28 +0200
committerGitHub <noreply@github.com>2019-08-03 15:20:28 +0200
commita49cf5126915bcc29167312105564304791b1796 (patch)
treeb9548108d78626060c5a5c9afe88c47c85d961ae
parentae27406db238eb3fe7b6e2c3dd8d3d380586a7a5 (diff)
downloadrneovim-a49cf5126915bcc29167312105564304791b1796.tar.gz
rneovim-a49cf5126915bcc29167312105564304791b1796.tar.bz2
rneovim-a49cf5126915bcc29167312105564304791b1796.zip
build: require unibilium>=2.0 (#10681)
* build: require unibilium>=2.0 This also ports FindUnibilium to LibFindMacros, which was planned anyway, and makes the version check easier. With an older Unibilium our fallback code in `terminfo_from_builtin` will not work (because it assumes the new data structures from 2.0.0 [1]), and nvim would crash later because of `ut` being NUL. 1: https://github.com/neovim/unibilium/commit/42f3cdd284735bd827691c3d0bfae9472b22d5d5
-rw-r--r--CMakeLists.txt2
-rw-r--r--cmake/FindUnibilium.cmake35
2 files changed, 6 insertions, 31 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b079e5c4bb..947de61988 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -408,7 +408,7 @@ endif()
option(FEAT_TUI "Enable the Terminal UI" ON)
if(FEAT_TUI)
- find_package(Unibilium REQUIRED)
+ find_package(Unibilium 2.0 REQUIRED)
include_directories(SYSTEM ${UNIBILIUM_INCLUDE_DIRS})
list(APPEND CMAKE_REQUIRED_INCLUDES "${UNIBILIUM_INCLUDE_DIRS}")
diff --git a/cmake/FindUnibilium.cmake b/cmake/FindUnibilium.cmake
index d8fccc01f7..0bf27b45e2 100644
--- a/cmake/FindUnibilium.cmake
+++ b/cmake/FindUnibilium.cmake
@@ -4,34 +4,9 @@
# UNIBILIUM_INCLUDE_DIRS - The unibilium include directories
# UNIBILIUM_LIBRARIES - The libraries needed to use unibilium
-find_package(PkgConfig)
-if (PKG_CONFIG_FOUND)
- pkg_check_modules(PC_UNIBILIUM QUIET unibilium)
-endif()
+include(LibFindMacros)
-set(UNIBILIUM_DEFINITIONS ${PC_UNIBILIUM_CFLAGS_OTHER})
-
-find_path(UNIBILIUM_INCLUDE_DIR unibilium.h
- PATHS ${PC_UNIBILIUM_INCLUDEDIR} ${PC_UNIBILIUM_INCLUDE_DIRS})
-
-# If we're asked to use static linkage, add libunibilium.a as a preferred library name.
-if(UNIBILIUM_USE_STATIC)
- list(APPEND UNIBILIUM_NAMES
- "${CMAKE_STATIC_LIBRARY_PREFIX}unibilium${CMAKE_STATIC_LIBRARY_SUFFIX}")
-endif()
-
-list(APPEND UNIBILIUM_NAMES unibilium)
-
-find_library(UNIBILIUM_LIBRARY NAMES ${UNIBILIUM_NAMES}
- HINTS ${PC_UNIBILIUM_LIBDIR} ${PC_UNIBILIUM_LIBRARY_DIRS})
-
-set(UNIBILIUM_LIBRARIES ${UNIBILIUM_LIBRARY})
-set(UNIBILIUM_INCLUDE_DIRS ${UNIBILIUM_INCLUDE_DIR})
-
-include(FindPackageHandleStandardArgs)
-# handle the QUIETLY and REQUIRED arguments and set UNIBILIUM_FOUND to TRUE
-# if all listed variables are TRUE
-find_package_handle_standard_args(Unibilium DEFAULT_MSG
- UNIBILIUM_LIBRARY UNIBILIUM_INCLUDE_DIR)
-
-mark_as_advanced(UNIBILIUM_INCLUDE_DIR UNIBILIUM_LIBRARY)
+libfind_pkg_detect(UNIBILIUM unibilium
+ FIND_PATH unibilium.h
+ FIND_LIBRARY unibilium)
+libfind_process(UNIBILIUM)