From e3b34d3e08215274e645bc284585f91ba6118591 Mon Sep 17 00:00:00 2001 From: Mike Owens Date: Sat, 8 Aug 2020 20:09:40 -0500 Subject: [PATCH] Subject: Fixes to build on FreeBSD and Illumos --- lib/CMakeLists.txt | 3 +++ lib/core/context.c | 2 +- lib/plat/unix/CMakeLists.txt | 1 - 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 5dee3b571..9a7eb1f44 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -329,6 +329,9 @@ endif(UNIX) export_to_parent_intermediate() if (DEFINED LWS_PLAT_UNIX) set(LWS_PLAT_UNIX ${LWS_PLAT_UNIX} PARENT_SCOPE) + if (ILLUMOS) + add_definitions("-D__illumos__") + endif() endif() set(LWS_HAVE_MBEDTLS_NET_SOCKETS ${LWS_HAVE_MBEDTLS_NET_SOCKETS} PARENT_SCOPE) set(TEST_SERVER_SSL_KEY "${TEST_SERVER_SSL_KEY}" PARENT_SCOPE) diff --git a/lib/core/context.c b/lib/core/context.c index 66636022a..6f1b78682 100644 --- a/lib/core/context.c +++ b/lib/core/context.c @@ -30,7 +30,7 @@ static const char *library_version = LWS_LIBRARY_VERSION; -#if defined(__linux__) +#if defined(__linux__) || defined(__FreeBSD__) || defined(__illumos__) /* for setrlimit */ #include #endif diff --git a/lib/plat/unix/CMakeLists.txt b/lib/plat/unix/CMakeLists.txt index aa7b6ca46..efe52f398 100644 --- a/lib/plat/unix/CMakeLists.txt +++ b/lib/plat/unix/CMakeLists.txt @@ -37,7 +37,6 @@ execute_process( COMMAND grep -c illumos /lib/ld.so.1 string(REGEX REPLACE "[\n]+" "" ILLUMOS "${ILLUMOS}") if (NOT ${ILLUMOS} MATCHES "0") - add_definitions( "-D__illumos__" ) set(ILLUMOS 1) endif()