diff options
author | Rich Wareham <rjw57@cam.ac.uk> | 2014-02-26 10:06:59 +0000 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-02-26 07:10:21 -0300 |
commit | de4fbf92d0da17e2c7f31df29bc72c44702b4e7c (patch) | |
tree | 7b99449cbd922654a1181c87fb11d2e2f6c82ed3 /src | |
parent | c3ff8cbb7cfe715604099809d0f5f2de84514717 (diff) | |
download | rneovim-de4fbf92d0da17e2c7f31df29bc72c44702b4e7c.tar.gz rneovim-de4fbf92d0da17e2c7f31df29bc72c44702b4e7c.tar.bz2 rneovim-de4fbf92d0da17e2c7f31df29bc72c44702b4e7c.zip |
link to rt if it provides clock_gettime
As noted in #128, if clock_gettime is provided by librt then it does not
end up being linked into the static libuv.a binary. This might be
considered a bug in libuv but we can address it here.
Detect if librt provides the clock_gettime symbol and, if so, append it
to the list of libraries linked into nvim. On non-librt systems the
behaviour should be as before.
Diffstat (limited to 'src')
-rw-r--r-- | src/CMakeLists.txt | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 96c0b01f3d..a7e815fd7c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -14,7 +14,16 @@ file( GLOB OS_SOURCES os/*.c ) add_executable (nvim ${NEOVIM_SOURCES} ${OS_SOURCES}) -target_link_libraries (vim m ${LibUV_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) +# The libraries we link against for nvim +set(NVIM_LINK_LIBRARIES m ${LibUV_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) + +# Add any libraries needed for a specific platform +if(HAVE_CLOCK_GETTIME) + # Work around libuv.a not linking in rt. + list(APPEND NVIM_LINK_LIBRARIES rt) +endif(HAVE_CLOCK_GETTIME) + +target_link_libraries (nvim ${NVIM_LINK_LIBRARIES}) include(CheckLibraryExists) check_library_exists(termcap tgetent "" HAVE_LIBTERMCAP) @@ -30,6 +39,6 @@ else() endif() endif() -include_directories ("${PROJECT_SOURCE_DIR}/src/proto") +include_directories ("${PROJECT_SOURCE_DIR}/src/proto") install(TARGETS nvim RUNTIME DESTINATION bin) |