diff --git a/ports/libuv/CMakeLists.txt b/ports/libuv/CMakeLists.txt index 87c0a6c9549..2ebc716124a 100644 --- a/ports/libuv/CMakeLists.txt +++ b/ports/libuv/CMakeLists.txt @@ -2,24 +2,68 @@ cmake_minimum_required(VERSION 3.5) project(libuv C) file(GLOB UV_SOURCES_COMMON src/*.c) + +file(GLOB UV_SOURCES_UNIX + src/unix/async.c + src/unix/core.c + src/unix/dl.c + src/unix/fs.c + src/unix/getaddrinfo.c + src/unix/getnameinfo.c + src/unix/loop.c + src/unix/loop-watcher.c + src/unix/pipe.c + src/unix/poll.c + src/unix/process.c + src/unix/signal.c + src/unix/stream.c + src/unix/tcp.c + src/unix/thread.c + src/unix/timer.c + src/unix/tty.c + src/unix/udp.c + src/unix/proctitle.c +) +file(GLOB UV_SOURCES_LINUX + src/unix/linux-core.c + src/unix/linux-inotify.c + src/unix/linux-syscalls.c +) +file(GLOB UV_SOURCES_DARWIN + src/unix/kqueue.c + src/unix/darwin.c + src/unix/fsevents.c + src/unix/pthread-barrier.c + src/unix/darwin-proctitle.c +) file(GLOB UV_SOURCES_WIN src/win/*.c) -add_library(libuv ${UV_SOURCES_COMMON} ${UV_SOURCES_WIN}) -target_compile_definitions(libuv PRIVATE WIN32_LEAN_AND_MEAN "_WIN32_WINNT=0x0600") -target_link_libraries(libuv iphlpapi psapi shell32 userenv ws2_32) +if(CMAKE_SYSTEM_NAME STREQUAL "Windows" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + add_library(libuv ${UV_SOURCES_COMMON} ${UV_SOURCES_WIN}) + target_compile_definitions(libuv PRIVATE WIN32_LEAN_AND_MEAN "_WIN32_WINNT=0x0600") + target_link_libraries(libuv iphlpapi psapi shell32 userenv ws2_32) +elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") + add_library(libuv ${UV_SOURCES_COMMON} ${UV_SOURCES_UNIX} ${UV_SOURCES_DARWIN}) +else() # Assume some Linux variant + add_library(libuv ${UV_SOURCES_COMMON} ${UV_SOURCES_UNIX} ${UV_SOURCES_LINUX}) +endif() + target_include_directories(libuv PUBLIC ./include PRIVATE ./src) set_target_properties(libuv PROPERTIES DEFINE_SYMBOL BUILDING_UV_SHARED) if(NOT UV_SKIP_HEADERS) install(FILES - include/tree.h - include/uv.h - include/uv-version.h - include/uv-errno.h - include/uv-threadpool.h - include/uv-win.h - DESTINATION include) + include/tree.h + include/uv.h + include/uv-version.h + include/uv-errno.h + include/uv-threadpool.h + include/uv-win.h + include/uv-unix.h + include/uv-darwin.h + DESTINATION include) endif() + install(TARGETS libuv RUNTIME DESTINATION bin ARCHIVE DESTINATION lib diff --git a/ports/libuv/CONTROL b/ports/libuv/CONTROL index 155a88cfedb..1c916abe71d 100644 --- a/ports/libuv/CONTROL +++ b/ports/libuv/CONTROL @@ -1,3 +1,3 @@ Source: libuv -Version: 1.20.3 +Version: 1.20.3-1 Description: libuv is a multi-platform support library with a focus on asynchronous I/O. diff --git a/ports/libuv/portfile.cmake b/ports/libuv/portfile.cmake index cdc1034ffa0..4f3d3f738a5 100644 --- a/ports/libuv/portfile.cmake +++ b/ports/libuv/portfile.cmake @@ -1,10 +1,12 @@ include(vcpkg_common_functions) + vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO libuv/libuv REF v1.20.3 SHA512 60ebc0059ec9fdd022aa9d60b2a0340f29e037bf79fa08707f6f2ecca9ec263c7a6466bdc1f94e0875a6a627ee749efa86117dedb22119676a7bafed8b5d77a0 - HEAD_REF v1.x) + HEAD_REF v1.x +) file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) @@ -12,7 +14,8 @@ vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS_DEBUG - -DUV_SKIP_HEADERS=ON) + -DUV_SKIP_HEADERS=ON +) vcpkg_install_cmake() vcpkg_copy_pdbs()