build: find system luv on ubuntu

Also use the system luv in CI for the with-external-deps job.
This commit is contained in:
dundargoc 2023-04-19 00:47:15 +02:00 committed by GitHub
parent 59fed8bb64
commit 0a3645a723
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 5 deletions

View File

@ -383,10 +383,10 @@ jobs:
lua-filesystem \
lua-lpeg \
lua-mpack \
luajit
luajit \
lua-luv-dev
# libtree-sitter-dev \
# libvterm-dev \
# lua-luv-dev
# libvterm-dev
# Remove comments from packages once we start using these external
# dependencies.
@ -400,7 +400,6 @@ jobs:
# bundled versions for these with the hopes of being able to remove them
# later on.
cmake -S cmake.deps -B .deps -G Ninja -D USE_BUNDLED=OFF \
-D USE_BUNDLED_LUV=ON \
-D USE_BUNDLED_LIBVTERM=ON \
-D USE_BUNDLED_TS=ON
cmake --build .deps

View File

@ -1,5 +1,14 @@
find_path(LIBLUV_INCLUDE_DIR luv/luv.h)
find_library(LIBLUV_LIBRARY NAMES luv_a luv libluv_a luv.so)
find_library(LIBLUV_LIBRARY NAMES luv_a luv libluv_a)
# Ubuntu-specific workaround to find system paths
function(ubuntu)
set(CMAKE_FIND_LIBRARY_PREFIXES "")
find_path(LIBLUV_INCLUDE_DIR luv/luv.h PATH_SUFFIXES lua5.1)
find_library(LIBLUV_LIBRARY NAMES luv PATH_SUFFIXES lua/5.1)
endfunction()
ubuntu()
find_package_handle_standard_args(Libluv DEFAULT_MSG
LIBLUV_LIBRARY LIBLUV_INCLUDE_DIR)
mark_as_advanced(LIBLUV_INCLUDE_DIR LIBLUV_LIBRARY)