use CMake's built in pthread detection

CMake ships with a standard FindThreads module which can be used to a)
test for a threading library and b) confirm that it is pthread. It also
allows the hard-coding of the threading library name to be removed from
``src/CMakeLists.txt``.

Make it an error not to have a pthread library installed and indicate to
CMake that we strongly prefer pthread to any other platform threading
library.
This commit is contained in:
Rich Wareham
2014-02-24 18:52:12 +00:00
parent 68847d7825
commit fd346a95fa
2 changed files with 10 additions and 1 deletions

View File

@ -14,7 +14,7 @@ file( GLOB IO_SOURCES io/*.c )
add_executable (vim ${NEOVIM_SOURCES} ${IO_SOURCES})
target_link_libraries (vim m uv pthread)
target_link_libraries (vim m uv ${CMAKE_THREAD_LIBS_INIT})
include(CheckLibraryExists)
check_library_exists(termcap tgetent "" HAVE_LIBTERMCAP)