├── .gitmodules ├── CMakeLists.txt ├── LICENSE.txt └── README.md /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "libuv"] 2 | path = libuv 3 | url = https://github.com/libuv/libuv.git 4 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | 3 | set(LIBUVDIR libuv) 4 | 5 | include_directories(${LIBUVDIR}/include ${LIBUVDIR}/src) 6 | set(SOURCES 7 | ${LIBUVDIR}/src/fs-poll.c 8 | ${LIBUVDIR}/src/inet.c 9 | ${LIBUVDIR}/src/threadpool.c 10 | ${LIBUVDIR}/src/uv-common.c 11 | ${LIBUVDIR}/src/version.c) 12 | 13 | if(WIN32) 14 | add_definitions(-DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=0x0600 -D_CRT_SECURE_NO_WARNINGS) 15 | include_directories(${LIBUVDIR}/src/win) 16 | set(SOURCES ${SOURCES} 17 | ${LIBUVDIR}/src/win/async.c 18 | ${LIBUVDIR}/src/win/core.c 19 | ${LIBUVDIR}/src/win/dl.c 20 | ${LIBUVDIR}/src/win/error.c 21 | ${LIBUVDIR}/src/win/fs-event.c 22 | ${LIBUVDIR}/src/win/fs.c 23 | ${LIBUVDIR}/src/win/getaddrinfo.c 24 | ${LIBUVDIR}/src/win/getnameinfo.c 25 | ${LIBUVDIR}/src/win/handle.c 26 | ${LIBUVDIR}/src/win/loop-watcher.c 27 | ${LIBUVDIR}/src/win/pipe.c 28 | ${LIBUVDIR}/src/win/poll.c 29 | ${LIBUVDIR}/src/win/process-stdio.c 30 | ${LIBUVDIR}/src/win/process.c 31 | ${LIBUVDIR}/src/win/req.c 32 | ${LIBUVDIR}/src/win/signal.c 33 | ${LIBUVDIR}/src/win/stream.c 34 | ${LIBUVDIR}/src/win/tcp.c 35 | ${LIBUVDIR}/src/win/thread.c 36 | ${LIBUVDIR}/src/win/timer.c 37 | ${LIBUVDIR}/src/win/tty.c 38 | ${LIBUVDIR}/src/win/udp.c 39 | ${LIBUVDIR}/src/win/util.c 40 | ${LIBUVDIR}/src/win/winapi.c 41 | ${LIBUVDIR}/src/win/winsock.c) 42 | else() 43 | if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") 44 | add_definitions(-D_GNU_SOURCE) 45 | set(SOURCES ${SOURCES} 46 | ${LIBUVDIR}/src/unix/linux-syscalls.c 47 | ${LIBUVDIR}/src/unix/linux-core.c 48 | ${LIBUVDIR}/src/unix/linux-inotify.c) 49 | elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") 50 | add_definitions(-D_DARWIN_USE_64_BIT_INODE=1 -D_DARWIN_UNLIMITED_SELECT=1) 51 | set(SOURCES ${SOURCES} 52 | ${LIBUVDIR}/src/unix/darwin.c 53 | ${LIBUVDIR}/src/unix/darwin-proctitle.c 54 | ${LIBUVDIR}/src/unix/fsevents.c 55 | ${LIBUVDIR}/src/unix/kqueue.c 56 | ${LIBUVDIR}/src/unix/proctitle.c) 57 | elseif(${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD") 58 | set(SOURCES ${SOURCES} 59 | ${LIBUVDIR}/src/unix/freebsd.c) 60 | elseif(${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD") 61 | set(SOURCES ${SOURCES} 62 | ${LIBUVDIR}/src/unix/openbsd.c) 63 | elseif(${CMAKE_SYSTEM_NAME} STREQUAL "NetBSD") 64 | set(SOURCES ${SOURCES} 65 | ${LIBUVDIR}/src/unix/kqueue.c 66 | ${LIBUVDIR}/src/unix/netbsd.c) 67 | elseif(${CMAKE_SYSTEM_NAME} STREQUAL "SunOS") 68 | add_definitions(-D__EXTENSIONS__ -D_XOPEN_SOURCE=500) 69 | set(SOURCES ${SOURCES} 70 | ${LIBUVDIR}/src/unix/sunos.c) 71 | endif() 72 | 73 | include_directories(${LIBUVDIR}/src/unix) 74 | set(SOURCES ${SOURCES} 75 | ${LIBUVDIR}/src/unix/async.c 76 | ${LIBUVDIR}/src/unix/core.c 77 | ${LIBUVDIR}/src/unix/dl.c 78 | ${LIBUVDIR}/src/unix/fs.c 79 | ${LIBUVDIR}/src/unix/getaddrinfo.c 80 | ${LIBUVDIR}/src/unix/getnameinfo.c 81 | ${LIBUVDIR}/src/unix/loop-watcher.c 82 | ${LIBUVDIR}/src/unix/loop.c 83 | ${LIBUVDIR}/src/unix/pipe.c 84 | ${LIBUVDIR}/src/unix/poll.c 85 | ${LIBUVDIR}/src/unix/process.c 86 | ${LIBUVDIR}/src/unix/signal.c 87 | ${LIBUVDIR}/src/unix/stream.c 88 | ${LIBUVDIR}/src/unix/tcp.c 89 | ${LIBUVDIR}/src/unix/thread.c 90 | ${LIBUVDIR}/src/unix/timer.c 91 | ${LIBUVDIR}/src/unix/tty.c 92 | ${LIBUVDIR}/src/unix/udp.c) 93 | endif() 94 | 95 | add_library(uv ${SOURCES}) 96 | 97 | if(WIN32) 98 | target_link_libraries(uv ws2_32 psapi iphlpapi shell32 userenv) 99 | endif() 100 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014-2016 David Capello 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # libuv-cmake 2 | Compile [libuv](https://github.com/libuv/libuv) library using [cmake](https://cmake.org/). 3 | 4 | ### Build instructions 5 | Clone the project [on GitHub](https://github.com/dacap/libuv-cmake). 6 | ``` 7 | $ git clone https://github.com/dacap/libuv-cmake 8 | $ cd libuv-cmake 9 | $ git submodule init 10 | $ git submodule update 11 | ``` 12 | Build repository. 13 | ``` 14 | $ mkdir build 15 | $ cd build 16 | $ cmake ../. 17 | $ make 18 | ``` 19 | --------------------------------------------------------------------------------