mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 03:48:18 +00:00
build: find unibilium without relying on libfindmacros (#22015)
This will remove the warning about the find module not providing a version.
This commit is contained in:
@@ -1,12 +0,0 @@
|
|||||||
# - Try to find unibilium
|
|
||||||
# Once done this will define
|
|
||||||
# UNIBILIUM_FOUND - System has unibilium
|
|
||||||
# UNIBILIUM_INCLUDE_DIRS - The unibilium include directories
|
|
||||||
# UNIBILIUM_LIBRARIES - The libraries needed to use unibilium
|
|
||||||
|
|
||||||
include(LibFindMacros)
|
|
||||||
|
|
||||||
libfind_pkg_detect(UNIBILIUM unibilium
|
|
||||||
FIND_PATH unibilium.h
|
|
||||||
FIND_LIBRARY unibilium)
|
|
||||||
libfind_process(UNIBILIUM)
|
|
27
cmake/Findunibilium.cmake
Normal file
27
cmake/Findunibilium.cmake
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
find_path(UNIBILIUM_INCLUDE_DIR unibilium.h)
|
||||||
|
find_library(UNIBILIUM_LIBRARY unibilium)
|
||||||
|
|
||||||
|
find_package_handle_standard_args(unibilium
|
||||||
|
REQUIRED_VARS UNIBILIUM_INCLUDE_DIR UNIBILIUM_LIBRARY)
|
||||||
|
|
||||||
|
add_library(unibilium INTERFACE)
|
||||||
|
target_include_directories(unibilium SYSTEM BEFORE INTERFACE ${UNIBILIUM_INCLUDE_DIR})
|
||||||
|
target_link_libraries(unibilium INTERFACE ${UNIBILIUM_LIBRARY})
|
||||||
|
|
||||||
|
list(APPEND CMAKE_REQUIRED_INCLUDES "${UNIBILIUM_INCLUDE_DIR}")
|
||||||
|
list(APPEND CMAKE_REQUIRED_LIBRARIES "${UNIBILIUM_LIBRARY}")
|
||||||
|
check_c_source_compiles("
|
||||||
|
#include <unibilium.h>
|
||||||
|
|
||||||
|
int
|
||||||
|
main(void)
|
||||||
|
{
|
||||||
|
unibi_str_from_var(unibi_var_from_str(\"\"));
|
||||||
|
return unibi_num_from_var(unibi_var_from_num(0));
|
||||||
|
}
|
||||||
|
" UNIBI_HAS_VAR_FROM)
|
||||||
|
list(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES "${UNIBILIUM_INCLUDE_DIR}")
|
||||||
|
list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES "${UNIBILIUM_LIBRARY}")
|
||||||
|
if(UNIBI_HAS_VAR_FROM)
|
||||||
|
target_compile_definitions(main_lib INTERFACE NVIM_UNIBI_HAS_VAR_FROM)
|
||||||
|
endif()
|
@@ -22,9 +22,8 @@ find_package(TreeSitter REQUIRED)
|
|||||||
target_include_directories(main_lib SYSTEM BEFORE INTERFACE ${TreeSitter_INCLUDE_DIRS})
|
target_include_directories(main_lib SYSTEM BEFORE INTERFACE ${TreeSitter_INCLUDE_DIRS})
|
||||||
target_link_libraries(main_lib INTERFACE ${TreeSitter_LIBRARIES})
|
target_link_libraries(main_lib INTERFACE ${TreeSitter_LIBRARIES})
|
||||||
|
|
||||||
find_package(UNIBILIUM 2.0 REQUIRED)
|
find_package(unibilium 2.0 REQUIRED)
|
||||||
target_include_directories(main_lib SYSTEM BEFORE INTERFACE ${UNIBILIUM_INCLUDE_DIRS})
|
target_link_libraries(main_lib INTERFACE unibilium)
|
||||||
target_link_libraries(main_lib INTERFACE ${UNIBILIUM_LIBRARIES})
|
|
||||||
|
|
||||||
find_package(LibTermkey 0.22 REQUIRED)
|
find_package(LibTermkey 0.22 REQUIRED)
|
||||||
target_include_directories(main_lib SYSTEM BEFORE INTERFACE ${LIBTERMKEY_INCLUDE_DIRS})
|
target_include_directories(main_lib SYSTEM BEFORE INTERFACE ${LIBTERMKEY_INCLUDE_DIRS})
|
||||||
@@ -174,24 +173,6 @@ if(CI_BUILD)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
list(APPEND CMAKE_REQUIRED_INCLUDES "${UNIBILIUM_INCLUDE_DIRS}")
|
|
||||||
list(APPEND CMAKE_REQUIRED_LIBRARIES "${UNIBILIUM_LIBRARIES}")
|
|
||||||
check_c_source_compiles("
|
|
||||||
#include <unibilium.h>
|
|
||||||
|
|
||||||
int
|
|
||||||
main(void)
|
|
||||||
{
|
|
||||||
unibi_str_from_var(unibi_var_from_str(\"\"));
|
|
||||||
return unibi_num_from_var(unibi_var_from_num(0));
|
|
||||||
}
|
|
||||||
" UNIBI_HAS_VAR_FROM)
|
|
||||||
list(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES "${UNIBILIUM_INCLUDE_DIRS}")
|
|
||||||
list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES "${UNIBILIUM_LIBRARIES}")
|
|
||||||
if(UNIBI_HAS_VAR_FROM)
|
|
||||||
target_compile_definitions(main_lib INTERFACE NVIM_UNIBI_HAS_VAR_FROM)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
list(APPEND CMAKE_REQUIRED_INCLUDES "${MSGPACK_INCLUDE_DIRS}")
|
list(APPEND CMAKE_REQUIRED_INCLUDES "${MSGPACK_INCLUDE_DIRS}")
|
||||||
check_c_source_compiles("
|
check_c_source_compiles("
|
||||||
#include <msgpack.h>
|
#include <msgpack.h>
|
||||||
|
Reference in New Issue
Block a user