libuv: Add support for building for QNX within CMake

This commit is contained in:
Elad Lahav
2020-09-07 12:42:32 -04:00
committed by Brad King
parent c98ec731f9
commit f9e950d4c5
4 changed files with 26 additions and 2 deletions

View File

@@ -5,7 +5,8 @@
// POSIX APIs are needed
# define _POSIX_C_SOURCE 200809L
#endif
#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__) || \
defined(__QNX__)
// For isascii
# define _XOPEN_SOURCE 700
#endif

View File

@@ -5,7 +5,8 @@
// POSIX APIs are needed
# define _POSIX_C_SOURCE 200809L
#endif
#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__) || \
defined(__QNX__)
// For isascii
# define _XOPEN_SOURCE 700
#endif

View File

@@ -336,6 +336,24 @@ if(CMAKE_SYSTEM_NAME STREQUAL "HP-UX")
)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "QNX")
list(APPEND uv_headers
include/uv/posix.h
)
list(APPEND uv_defines
_XOPEN_SOURCE=700
)
list(APPEND uv_sources
src/unix/posix-hrtime.c
src/unix/posix-poll.c
src/unix/no-fsevents.c
src/unix/no-proctitle.c
)
list(APPEND uv_libraries
socket
)
endif()
include_directories(
${uv_includes}
${KWSYS_HEADER_ROOT}

View File

@@ -1675,6 +1675,10 @@ else
uv_c_flags="${uv_c_flags} -D__EXTENSIONS__ -D_XOPEN_SOURCE=600"
libs="${libs} -lkstat -lnsl -lsendfile -lsocket -lrt"
;;
*QNX*)
uv_c_flags="${uv_c_flags} -D_XOPEN_SOURCE=700"
libs="${libs} -lsocket"
;;
esac
fi
if test "x${bootstrap_system_libuv}" = "x"; then