mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 03:18:16 +00:00
build: remove config-specific find_package search for libuv
Having two separate find_package calls makes it harder to maintain.
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
find_path2(LIBUV_INCLUDE_DIR uv.h)
|
find_path2(LIBUV_INCLUDE_DIR uv.h)
|
||||||
find_library2(LIBUV_LIBRARY NAMES uv_a uv)
|
find_library2(LIBUV_LIBRARY NAMES uv_a uv libuv)
|
||||||
|
|
||||||
set(LIBUV_LIBRARIES ${LIBUV_LIBRARY})
|
set(LIBUV_LIBRARIES ${LIBUV_LIBRARY})
|
||||||
|
|
||||||
@@ -41,10 +41,12 @@ endif()
|
|||||||
if(WIN32)
|
if(WIN32)
|
||||||
# check_library_exists() does not work for Win32 API calls in X86 due to name
|
# check_library_exists() does not work for Win32 API calls in X86 due to name
|
||||||
# mangling calling conventions
|
# mangling calling conventions
|
||||||
list(APPEND LIBUV_LIBRARIES iphlpapi)
|
list(APPEND LIBUV_LIBRARIES
|
||||||
list(APPEND LIBUV_LIBRARIES psapi)
|
iphlpapi
|
||||||
list(APPEND LIBUV_LIBRARIES userenv)
|
psapi
|
||||||
list(APPEND LIBUV_LIBRARIES ws2_32)
|
userenv
|
||||||
|
ws2_32
|
||||||
|
dbghelp)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_package(Threads)
|
find_package(Threads)
|
||||||
|
@@ -11,17 +11,9 @@ set_target_properties(nvim
|
|||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
|
|
||||||
add_library(libuv INTERFACE)
|
add_library(libuv INTERFACE)
|
||||||
find_package(libuv CONFIG QUIET)
|
find_package(Libuv 1.28.0 REQUIRED)
|
||||||
if(TARGET libuv::uv_a)
|
target_include_directories(libuv SYSTEM BEFORE INTERFACE ${LIBUV_INCLUDE_DIR})
|
||||||
target_link_libraries(libuv INTERFACE libuv::uv_a)
|
target_link_libraries(libuv INTERFACE ${LIBUV_LIBRARIES})
|
||||||
mark_as_advanced(libuv_DIR)
|
|
||||||
else()
|
|
||||||
# Fall back to find module for libuv versions older than v1.45.0 which don't
|
|
||||||
# provide a config file
|
|
||||||
find_package(Libuv 1.28.0 REQUIRED MODULE)
|
|
||||||
target_include_directories(libuv SYSTEM BEFORE INTERFACE ${LIBUV_INCLUDE_DIR})
|
|
||||||
target_link_libraries(libuv INTERFACE ${LIBUV_LIBRARIES})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
add_library(nlua0 MODULE)
|
add_library(nlua0 MODULE)
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
|
Reference in New Issue
Block a user