diff options
author | Carlos Martín Nieto <carlos@cmartin.tk> | 2011-07-14 17:05:22 +0200 |
---|---|---|
committer | Carlos Martín Nieto <carlos@cmartin.tk> | 2011-07-17 20:50:59 +0200 |
commit | e944cfa949d94f706867ab61878047ea7a24555d (patch) | |
tree | d60ab51ff90d617889db044feb87703e8e137b51 | |
parent | 52e50c1a80db56b91ce3d99bd546c07b7135f735 (diff) | |
download | libgit2-e944cfa949d94f706867ab61878047ea7a24555d.tar.gz |
net: link necessary libraries in Solaris
Solaris needs programs to link to socket and nsl in order to use BSD
sockets. Tell CMake to do so, this time for real.
Thanks to boyski for bearing with me through the various iterations of
this patch.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
-rw-r--r-- | CMakeLists.txt | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 26f00c728..cb9385210 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -92,6 +92,8 @@ ADD_LIBRARY(git2 ${SRC} ${SRC_ZLIB}) IF (WIN32) TARGET_LINK_LIBRARIES(git2 ws2_32) +ELSEIF (CMAKE_SYSTEM_NAME MATCHES "(Solaris|SunOS)") + TARGET_LINK_LIBRARIES(git2 socket nsl) ENDIF () TARGET_LINK_LIBRARIES(git2 ${CMAKE_THREAD_LIBS_INIT}) @@ -117,6 +119,11 @@ IF (BUILD_TESTS) ADD_EXECUTABLE(libgit2_test tests/test_main.c tests/test_lib.c tests/test_helpers.c ${SRC} ${SRC_TEST} ${SRC_ZLIB}) TARGET_LINK_LIBRARIES(libgit2_test ${CMAKE_THREAD_LIBS_INIT}) + IF (WIN32) + TARGET_LINK_LIBRARIES(libgit2_test ws2_32) + ELSEIF (CMAKE_SYSTEM_NAME MATCHES "(Solaris|SunOS)") + TARGET_LINK_LIBRARIES(libgit2_test socket nsl) + ENDIF () ENABLE_TESTING() ADD_TEST(libgit2_test libgit2_test) |