diff --git a/CMakeLists.txt b/CMakeLists.txt index 29f5d7ed..f533f165 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -210,7 +210,12 @@ CHECK_INCLUDE_FILES (malloc.h HAVE_MALLOC_H) CHECK_INCLUDE_FILES (memory.h HAVE_MEMORY_H) CHECK_INCLUDE_FILES (netdb.h HAVE_NETDB_H) CHECK_INCLUDE_FILES (netinet/in.h HAVE_NETINET_IN_H) -CHECK_INCLUDE_FILES (net/if.h HAVE_NET_IF_H) +# On old MacOS SDK versions, you must include sys/socket.h before net/if.h +IF (HAVE_SYS_SOCKET_H) + CHECK_INCLUDE_FILES ("sys/socket.h;net/if.h" HAVE_NET_IF_H) +ELSE () + CHECK_INCLUDE_FILES (net/if.h HAVE_NET_IF_H) +ENDIF () CHECK_INCLUDE_FILES (signal.h HAVE_SIGNAL_H) CHECK_INCLUDE_FILES (socket.h HAVE_SOCKET_H) CHECK_INCLUDE_FILES (stdbool.h HAVE_STDBOOL_H)