Skip to content

Commit

Permalink
Make icecream compile on MacOS with cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
wdobbe committed Apr 8, 2020
1 parent eb88945 commit 0cc91a3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
7 changes: 5 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,11 @@ endif()
# Find required base packages
# ===========================
find_package(Libcap-ng)
if (Libcap-ng_FOUND)
set(HAVE_LIBCAP_NG 1)
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
find_package(Libcap-ng)
if (Libcap-ng_FOUND)
set(HAVE_LIBCAP_NG 1)
endif()
endif()
find_package(LZO REQUIRED)
find_package(TAR REQUIRED)
Expand Down
2 changes: 1 addition & 1 deletion daemon/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ add_executable(iceccd

target_link_libraries(iceccd
icecc
archive
LibArchive::LibArchive
)

if(Libcap-ng_FOUND)
Expand Down
2 changes: 1 addition & 1 deletion services/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ add_library(icecc STATIC
target_link_libraries(icecc
PRIVATE
LZO::lzo
zstd
${ZSTD_LIBRARY}
dl)

if(Libcap-ng_FOUND)
Expand Down
2 changes: 1 addition & 1 deletion services/comm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -946,6 +946,7 @@ MsgChannel::MsgChannel(int _fd, struct sockaddr *_a, socklen_t _l, bool text)
maximum_remote_protocol = -1;

int on = 1;
int sec;

if (!setsockopt(_fd, SOL_SOCKET, SO_KEEPALIVE, (char *) &on, sizeof(on))) {
#if defined( TCP_KEEPIDLE ) || defined( TCPCTL_KEEPIDLE )
Expand All @@ -955,7 +956,6 @@ MsgChannel::MsgChannel(int _fd, struct sockaddr *_a, socklen_t _l, bool text)
int keepidle = TCPCTL_KEEPIDLE;
#endif

int sec;
sec = MAX_SCHEDULER_PING - 3 * MAX_SCHEDULER_PONG;
setsockopt(_fd, IPPROTO_TCP, keepidle, (char *) &sec, sizeof(sec));
#endif
Expand Down

0 comments on commit 0cc91a3

Please sign in to comment.