mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
context: properly check for sys/resource.h
Instead of hardcoding where sys/resource.h is available, check for it using cmake.
This commit is contained in:
parent
544dc90aa0
commit
f6868a5e03
3 changed files with 5 additions and 1 deletions
|
@ -562,6 +562,7 @@ CHECK_INCLUDE_FILE(sys/capability.h LWS_HAVE_SYS_CAPABILITY_H)
|
|||
CHECK_INCLUDE_FILE(malloc.h LWS_HAVE_MALLOC_H)
|
||||
CHECK_INCLUDE_FILE(pthread.h LWS_HAVE_PTHREAD_H)
|
||||
CHECK_INCLUDE_FILE(inttypes.h LWS_HAVE_INTTYPES_H)
|
||||
CHECK_INCLUDE_FILE(sys/resource.h LWS_HAVE_SYS_RESOURCE_H)
|
||||
|
||||
if (WIN32 OR MSVC)
|
||||
CHECK_C_SOURCE_COMPILES("#include <winsock2.h>
|
||||
|
|
|
@ -48,6 +48,9 @@
|
|||
/* Define to 1 if you have the <sys/prctl.h> header file. */
|
||||
#cmakedefine LWS_HAVE_SYS_PRCTL_H
|
||||
|
||||
/* Define to 1 if you have the <sys/resource.h> header file. */
|
||||
#cmakedefine LWS_HAVE_SYS_RESOURCE_H
|
||||
|
||||
/* Define to 1 if you have the <sys/socket.h> header file. */
|
||||
#cmakedefine LWS_HAVE_SYS_SOCKET_H
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
static const char *library_version = LWS_LIBRARY_VERSION;
|
||||
|
||||
#if defined(__linux__) || defined(__FreeBSD__) || defined(__illumos__)
|
||||
#if defined(LWS_HAVE_SYS_RESOURCE_H)
|
||||
/* for setrlimit */
|
||||
#include <sys/resource.h>
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue