Skip to content

Commit

Permalink
build: find system luv on ubuntu
Browse files Browse the repository at this point in the history
Also use the system luv in CI for the with-external-deps job.
  • Loading branch information
dundargoc authored Apr 18, 2023
1 parent 59fed8b commit 0a3645a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down
11 changes: 10 additions & 1 deletion cmake/FindLibluv.cmake
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 0a3645a

Please sign in to comment.