diff --git a/CMakeLists.txt b/CMakeLists.txt index 505bba01..0d4fb897 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,7 +31,7 @@ endif() option(WITH_SSL "Include SSL support (default OpenSSL, CyaSSL if USE_CYASSL is set)" ON) option(USE_EXTERNAL_ZLIB "Search the system for ZLib instead of using the included one (on Windows)" OFF) option(USE_CYASSL "Use CyaSSL replacement for OpenSSL. When settings this, you also need to specify CYASSL_LIB and CYASSL_INCLUDE_DIRS" OFF) -option(WITH_BUILTIN_GETIFADDRS "Use BSD getifaddrs implementation from libwebsockets... default is your libc provides it" OFF) +option(WITHOUT_BUILTIN_GETIFADDRS "Don't use BSD getifaddrs implementation from libwebsockets if it is missing (this will result in a compilation error) ... Default is your libc provides it. On some systems such as uclibc it doesn't exist." OFF) option(WITHOUT_TESTAPPS "Don't build the libwebsocket-test-apps" OFF) option(WITHOUT_CLIENT "Don't build the client part of the library" OFF) option(WITHOUT_SERVER "Don't build the server part of the library" OFF) @@ -146,10 +146,11 @@ CHECK_FUNCTION_EXISTS(strerror HAVE_STRERROR) CHECK_FUNCTION_EXISTS(vfork HAVE_VFORK) CHECK_FUNCTION_EXISTS(getifaddrs HAVE_GETIFADDRS) -if (WITH_BUILTIN_GETIFADDRS) - if (HAVE_GETIFADDRS) - warning("getifaddrs already exists on the system, are you sure you want to build using the BSD version? (This is normally only needed on systems running uclibc)") +if (NOT HAVE_GETIFADDRS) + if (WITHOUT_BUILTIN_GETIFADDRS) + message(FATAL_ERROR "No getifaddrs was found on the system. Turn off the WITHOUT_BUILTIN_GETIFADDRS compile option to use the supplied BSD version.") endif() + set(LWS_BUILTIN_GETIFADDRS 1) endif() @@ -264,7 +265,7 @@ else() endif() if (UNIX) - if (NOT WITH_BUILTIN_GETIFADDRS) + if (NOT HAVE_GETIFADDRS) list(APPEND HDR_PRIVATE lib/getifaddrs.h) list(APPEND SOURCES lib/getifaddrs.c) endif()