macos build fix #52
@@ -500,6 +500,8 @@ add_definitions("-D __SPF_BUILT_IN_PPPA")
|
|||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
target_link_libraries(Sapfor_F SageNewSrc SageLib SageOldSrc)
|
target_link_libraries(Sapfor_F SageNewSrc SageLib SageOldSrc)
|
||||||
|
elseif(APPLE)
|
||||||
|
target_link_libraries(Sapfor_F SageNewSrc SageLib SageOldSrc pthread)
|
||||||
elseif(UNIX)
|
elseif(UNIX)
|
||||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6.0)
|
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6.0)
|
||||||
target_link_libraries(Sapfor_F SageNewSrc SageLib SageOldSrc pthread stdc++fs)
|
target_link_libraries(Sapfor_F SageNewSrc SageLib SageOldSrc pthread stdc++fs)
|
||||||
|
|||||||
@@ -66,7 +66,11 @@ class StdCapture
|
|||||||
ret = pipe(pipes, 1024 * 1024 * 20, O_BINARY); // 20 MB
|
ret = pipe(pipes, 1024 * 1024 * 20, O_BINARY); // 20 MB
|
||||||
#else
|
#else
|
||||||
ret = pipe(pipes) == -1;
|
ret = pipe(pipes) == -1;
|
||||||
|
#ifdef __APPLE__
|
||||||
|
fcntl(*pipes, F_PREALLOCATE, 1024 * 1024 * 20);
|
||||||
|
#else
|
||||||
fcntl(*pipes, F_SETPIPE_SZ, 1024 * 1024 * 20);
|
fcntl(*pipes, F_SETPIPE_SZ, 1024 * 1024 * 20);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
fd_blocked = (errno == EINTR || errno == EBUSY);
|
fd_blocked = (errno == EINTR || errno == EBUSY);
|
||||||
if (fd_blocked)
|
if (fd_blocked)
|
||||||
|
|||||||
Reference in New Issue
Block a user