diff options
author | John Szakmeister <john@szakmeister.net> | 2014-03-09 08:40:55 -0400 |
---|---|---|
committer | John Szakmeister <john@szakmeister.net> | 2014-03-21 15:22:00 -0400 |
commit | 1eed86883bff8a031d397ddd38b39fb307a31198 (patch) | |
tree | aee588ea7aa856ecbe0fa382cedf6c0fc1ffb766 /cmake/FindLibUV.cmake | |
parent | 0b2f6a0cf4c50d86744b1d3d774103db39773b4c (diff) | |
download | rneovim-1eed86883bff8a031d397ddd38b39fb307a31198.tar.gz rneovim-1eed86883bff8a031d397ddd38b39fb307a31198.tar.bz2 rneovim-1eed86883bff8a031d397ddd38b39fb307a31198.zip |
Deal with the missing dependencies for libuv.
Since libuv.pc is broken at the moment, try to determine libuv's
dependencies ourselves. This ports most of the checks from libuv into
our CMake build, and fixes the build on other unix platforms.
Diffstat (limited to 'cmake/FindLibUV.cmake')
-rw-r--r-- | cmake/FindLibUV.cmake | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/cmake/FindLibUV.cmake b/cmake/FindLibUV.cmake index b11d2b1949..357f12c3fd 100644 --- a/cmake/FindLibUV.cmake +++ b/cmake/FindLibUV.cmake @@ -46,6 +46,45 @@ mark_as_advanced(LIBUV_INCLUDE_DIR LIBUV_LIBRARY) set(LIBUV_LIBRARIES ${LIBUV_LIBRARY}) set(LIBUV_INCLUDE_DIRS ${LIBUV_INCLUDE_DIR}) +# Deal with the fact that libuv.pc is missing important dependency information. + +include(CheckLibraryExists) + +check_library_exists(dl dlopen "dlfcn.h" HAVE_LIBDL) +if(HAVE_LIBDL) + list(APPEND LIBUV_LIBRARIES dl) +endif() + +check_library_exists(kstat kstat_lookup "kstat.h" HAVE_LIBKSTAT) +if(HAVE_LIBKSTAT) + list(APPEND LIBUV_LIBRARIES kstat) +endif() + +check_library_exists(kvm kvm_open "kvm.h" HAVE_LIBKVM) +if(HAVE_LIBKVM) + list(APPEND LIBUV_LIBRARIES kvm) +endif() + +check_library_exists(nsl gethostbyname "nsl.h" HAVE_LIBNSL) +if(HAVE_LIBNSL) + list(APPEND LIBUV_LIBRARIES nsl) +endif() + +check_library_exists(perfstat perfstat_cpu "libperfstat.h" HAVE_LIBPERFSTAT) +if(HAVE_LIBPERFSTAT) + list(APPEND LIBUV_LIBRARIES perfstat) +endif() + +check_library_exists(rt clock_gettime "time.h" HAVE_LIBRT) +if(HAVE_LIBRT) + list(APPEND LIBUV_LIBRARIES rt) +endif() + +check_library_exists(sendfile sendfile "" HAVE_LIBSENDFILE) +if(HAVE_LIBSENDFILE) + list(APPEND LIBUV_LIBRARIES sendfile) +endif() + include(FindPackageHandleStandardArgs) # handle the QUIETLY and REQUIRED arguments and set LIBUV_FOUND to TRUE |