forked from cory/tildefriends
libuv 1.42.0.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3650 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
75
deps/libuv/CMakeLists.txt
vendored
75
deps/libuv/CMakeLists.txt
vendored
@@ -30,6 +30,14 @@ if(QEMU)
|
||||
add_definitions(-D__QEMU__=1)
|
||||
endif()
|
||||
|
||||
option(ASAN "Enable AddressSanitizer (ASan)" OFF)
|
||||
if(ASAN AND CMAKE_C_COMPILER_ID MATCHES "AppleClang|GNU|Clang")
|
||||
add_definitions(-D__ASAN__=1)
|
||||
set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address")
|
||||
set (CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address")
|
||||
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fno-omit-frame-pointer -fsanitize=address")
|
||||
endif()
|
||||
|
||||
# Compiler check
|
||||
string(CONCAT is-msvc $<OR:
|
||||
$<C_COMPILER_ID:MSVC>,
|
||||
@@ -95,6 +103,9 @@ list(APPEND uv_cflags ${lint-no-conditional-assignment-msvc})
|
||||
list(APPEND uv_cflags ${lint-no-unsafe-msvc})
|
||||
list(APPEND uv_cflags ${lint-utf8-msvc} )
|
||||
|
||||
check_c_compiler_flag(-fno-strict-aliasing UV_F_STRICT_ALIASING)
|
||||
list(APPEND uv_cflags $<$<BOOL:${UV_F_STRICT_ALIASING}>:-fno-strict-aliasing>)
|
||||
|
||||
set(uv_sources
|
||||
src/fs-poll.c
|
||||
src/idna.c
|
||||
@@ -108,7 +119,7 @@ set(uv_sources
|
||||
src/version.c)
|
||||
|
||||
if(WIN32)
|
||||
list(APPEND uv_defines WIN32_LEAN_AND_MEAN _WIN32_WINNT=0x0600)
|
||||
list(APPEND uv_defines WIN32_LEAN_AND_MEAN _WIN32_WINNT=0x0602)
|
||||
list(APPEND uv_libraries
|
||||
psapi
|
||||
user32
|
||||
@@ -199,10 +210,11 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Android")
|
||||
src/unix/pthread-fixes.c
|
||||
src/unix/random-getentropy.c
|
||||
src/unix/random-getrandom.c
|
||||
src/unix/random-sysctl-linux.c)
|
||||
src/unix/random-sysctl-linux.c
|
||||
src/unix/epoll.c)
|
||||
endif()
|
||||
|
||||
if(APPLE OR CMAKE_SYSTEM_NAME MATCHES "Android|Linux|OS390")
|
||||
if(APPLE OR CMAKE_SYSTEM_NAME MATCHES "Android|Linux")
|
||||
list(APPEND uv_sources src/unix/proctitle.c)
|
||||
endif()
|
||||
|
||||
@@ -243,7 +255,8 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
src/unix/linux-syscalls.c
|
||||
src/unix/procfs-exepath.c
|
||||
src/unix/random-getrandom.c
|
||||
src/unix/random-sysctl-linux.c)
|
||||
src/unix/random-sysctl-linux.c
|
||||
src/unix/epoll.c)
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "NetBSD")
|
||||
@@ -256,9 +269,11 @@ if(CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "OS390")
|
||||
list(APPEND uv_defines PATH_MAX=255)
|
||||
enable_language(CXX)
|
||||
list(APPEND uv_defines PATH_MAX=1024)
|
||||
list(APPEND uv_defines _AE_BIMODAL)
|
||||
list(APPEND uv_defines _ALL_SOURCE)
|
||||
list(APPEND uv_defines _ENHANCED_ASCII_EXT=0xFFFFFFFF)
|
||||
list(APPEND uv_defines _ISOC99_SOURCE)
|
||||
list(APPEND uv_defines _LARGE_TIME_API)
|
||||
list(APPEND uv_defines _OPEN_MSGQ_EXT)
|
||||
@@ -269,14 +284,31 @@ if(CMAKE_SYSTEM_NAME STREQUAL "OS390")
|
||||
list(APPEND uv_defines _UNIX03_SOURCE)
|
||||
list(APPEND uv_defines _UNIX03_THREADS)
|
||||
list(APPEND uv_defines _UNIX03_WITHDRAWN)
|
||||
list(APPEND uv_defines _XOPEN_SOURCE=600)
|
||||
list(APPEND uv_defines _XOPEN_SOURCE_EXTENDED)
|
||||
list(APPEND uv_sources
|
||||
src/unix/pthread-fixes.c
|
||||
src/unix/os390.c
|
||||
src/unix/os390-syscalls.c)
|
||||
list(APPEND uv_cflags -Wc,DLL -Wc,exportall -Wc,xplink)
|
||||
list(APPEND uv_libraries -Wl,xplink)
|
||||
list(APPEND uv_test_libraries -Wl,xplink)
|
||||
src/unix/os390-syscalls.c
|
||||
src/unix/os390-proctitle.c)
|
||||
list(APPEND uv_cflags
|
||||
-q64
|
||||
-qascii
|
||||
-qexportall
|
||||
-qgonumber
|
||||
-qlongname
|
||||
-qlibansi
|
||||
-qfloat=IEEE
|
||||
-qtune=10
|
||||
-qarch=10
|
||||
-qasm
|
||||
-qasmlib=sys1.maclib:sys1.modgen)
|
||||
find_library(ZOSLIB
|
||||
NAMES zoslib
|
||||
PATHS ${ZOSLIB_DIR}
|
||||
PATH_SUFFIXES lib
|
||||
)
|
||||
list(APPEND uv_libraries ${ZOSLIB})
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "OS400")
|
||||
@@ -293,9 +325,11 @@ if(CMAKE_SYSTEM_NAME STREQUAL "OS400")
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
|
||||
list(APPEND uv_defines __EXTENSIONS__ _XOPEN_SOURCE=500)
|
||||
list(APPEND uv_defines __EXTENSIONS__ _XOPEN_SOURCE=500 _REENTRANT)
|
||||
list(APPEND uv_libraries kstat nsl sendfile socket)
|
||||
list(APPEND uv_sources src/unix/no-proctitle.c src/unix/sunos.c)
|
||||
list(APPEND uv_sources
|
||||
src/unix/no-proctitle.c
|
||||
src/unix/sunos.c)
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Haiku")
|
||||
@@ -318,7 +352,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL "QNX")
|
||||
src/unix/bsd-ifaddrs.c
|
||||
src/unix/no-proctitle.c
|
||||
src/unix/no-fsevents.c)
|
||||
list(APPEND uv_cflags -fno-strict-aliasing)
|
||||
list(APPEND uv_libraries socket)
|
||||
endif()
|
||||
|
||||
@@ -340,6 +373,10 @@ target_include_directories(uv
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
PRIVATE
|
||||
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src>)
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "OS390")
|
||||
target_include_directories(uv PUBLIC $<BUILD_INTERFACE:${ZOSLIB_DIR}/include>)
|
||||
set_target_properties(uv PROPERTIES LINKER_LANGUAGE CXX)
|
||||
endif()
|
||||
target_link_libraries(uv ${uv_libraries})
|
||||
|
||||
add_library(uv_a STATIC ${uv_sources})
|
||||
@@ -351,6 +388,10 @@ target_include_directories(uv_a
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
PRIVATE
|
||||
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src>)
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "OS390")
|
||||
target_include_directories(uv_a PUBLIC $<BUILD_INTERFACE:${ZOSLIB_DIR}/include>)
|
||||
set_target_properties(uv_a PROPERTIES LINKER_LANGUAGE CXX)
|
||||
endif()
|
||||
target_link_libraries(uv_a ${uv_libraries})
|
||||
|
||||
if(LIBUV_BUILD_TESTS)
|
||||
@@ -448,6 +489,9 @@ if(LIBUV_BUILD_TESTS)
|
||||
test/test-metrics.c
|
||||
test/test-multiple-listen.c
|
||||
test/test-mutexes.c
|
||||
test/test-not-readable-nor-writable-on-read-error.c
|
||||
test/test-not-readable-on-eof.c
|
||||
test/test-not-writable-after-shutdown.c
|
||||
test/test-osx-select.c
|
||||
test/test-pass-always.c
|
||||
test/test-ping-pong.c
|
||||
@@ -466,6 +510,7 @@ if(LIBUV_BUILD_TESTS)
|
||||
test/test-poll-close-doesnt-corrupt-stack.c
|
||||
test/test-poll-close.c
|
||||
test/test-poll-closesocket.c
|
||||
test/test-poll-multiple-handles.c
|
||||
test/test-poll-oob.c
|
||||
test/test-poll.c
|
||||
test/test-process-priority.c
|
||||
@@ -479,6 +524,7 @@ if(LIBUV_BUILD_TESTS)
|
||||
test/test-semaphore.c
|
||||
test/test-shutdown-close.c
|
||||
test/test-shutdown-eof.c
|
||||
test/test-shutdown-simultaneous.c
|
||||
test/test-shutdown-twice.c
|
||||
test/test-signal-multiple-loops.c
|
||||
test/test-signal-pending-on-close.c
|
||||
@@ -572,6 +618,11 @@ if(LIBUV_BUILD_TESTS)
|
||||
add_test(NAME uv_test_a
|
||||
COMMAND uv_run_tests_a
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "OS390")
|
||||
set_target_properties(uv_run_benchmarks_a PROPERTIES LINKER_LANGUAGE CXX)
|
||||
set_target_properties(uv_run_tests PROPERTIES LINKER_LANGUAGE CXX)
|
||||
set_target_properties(uv_run_tests_a PROPERTIES LINKER_LANGUAGE CXX)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(UNIX OR MINGW)
|
||||
|
Reference in New Issue
Block a user