mirror of https://github.com/lukechilds/node.git
Tom Hughes
14 years ago
committed by
Ryan Dahl
11 changed files with 125 additions and 63 deletions
@ -1,18 +0,0 @@ |
|||
if(SHARED_CARES) |
|||
find_library(LIBCARES_LIBRARY NAMES cares) |
|||
find_path(LIBCARES_INCLUDE_DIR ares.h |
|||
PATH_SUFFIXES include |
|||
) # Find header |
|||
find_package_handle_standard_args(libcares DEFAULT_MSG LIBCARES_LIBRARY LIBCARES_INCLUDE_DIR) |
|||
else() |
|||
set(cares_arch ${node_arch}) |
|||
|
|||
if(${node_arch} MATCHES x86_64) |
|||
set(cares_arch x64) |
|||
elseif(${node_arch} MATCHES x86) |
|||
set(cares_arch ia32) |
|||
endif() |
|||
|
|||
add_subdirectory(deps/c-ares) |
|||
set(LIBCARES_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/deps/c-ares ${CMAKE_SOURCE_DIR}/deps/c-ares/${node_platform}-${cares_arch}) |
|||
endif() |
@ -1,10 +0,0 @@ |
|||
if(SHARED_LIBEV) |
|||
find_library(LIBEV_LIBRARY NAMES ev) |
|||
find_path(LIBEV_INCLUDE_DIR ev.h |
|||
PATH_SUFFIXES include/ev include |
|||
) # Find header |
|||
find_package_handle_standard_args(libev DEFAULT_MSG LIBEV_LIBRARY LIBEV_INCLUDE_DIR) |
|||
else() |
|||
add_subdirectory(deps/libev) |
|||
set(LIBEV_INCLUDE_DIR deps/libev) |
|||
endif() |
@ -0,0 +1,2 @@ |
|||
add_subdirectory(deps/uv) |
|||
set(LIBUV_INCLUDE_DIR deps/uv/include) |
@ -0,0 +1,32 @@ |
|||
cmake_minimum_required(VERSION 2.6) |
|||
|
|||
project(uv) |
|||
|
|||
string(TOLOWER ${CMAKE_SYSTEM_NAME} uv_platform) |
|||
|
|||
set(uv_platform_source ${uv_SOURCE_DIR}/src/uv-${uv_platform}.c) |
|||
|
|||
set(uv_source |
|||
src/uv-common.c |
|||
src/uv-eio.c |
|||
src/uv-unix.c) |
|||
|
|||
if(EXISTS ${uv_platform_source}) |
|||
set(uv_source ${uv_source} ${uv_platform_source}) |
|||
else() |
|||
message(FATAL_ERROR "Unsupported platform: ${uv_platform}") |
|||
endif() |
|||
|
|||
include_directories( |
|||
include |
|||
src/ares/config_${uv_platform}) |
|||
|
|||
add_subdirectory(src/ev) |
|||
add_subdirectory(src/eio) |
|||
add_subdirectory(src/ares) |
|||
|
|||
add_library(uv ${uv_source}) |
|||
target_link_libraries(uv |
|||
ev |
|||
eio |
|||
ares) |
@ -1,22 +1,27 @@ |
|||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}) |
|||
include_directories(${node_platform}-${cares_arch}) |
|||
cmake_minimum_required(VERSION 2.6) |
|||
|
|||
project(ares) |
|||
|
|||
string(TOLOWER ${CMAKE_SYSTEM_NAME} ares_platform) |
|||
|
|||
include_directories(config_${ares_platform}) |
|||
add_definitions(-DHAVE_CONFIG_H=1) |
|||
|
|||
include(CheckLibraryExists) |
|||
check_library_exists(socket socket "" HAVE_SOCKET_LIB) |
|||
check_library_exists(nsl gethostbyname "" HAVE_NSL_LIB) |
|||
|
|||
file(GLOB lib_sources *.c) |
|||
add_library(cares ${lib_sources}) |
|||
file(GLOB ares_source *.c) |
|||
add_library(ares ${ares_source}) |
|||
|
|||
if(${HAVE_SOCKET_LIB}) |
|||
set(cares_libs ${cares_libs} socket) |
|||
if(HAVE_SOCKET_LIB) |
|||
set(ares_libs ${ares_libs} socket) |
|||
endif() |
|||
|
|||
if(${HAVE_NSL_LIB}) |
|||
set(cares_libs ${cares_libs} nsl) |
|||
if(HAVE_NSL_LIB) |
|||
set(ares_libs ${ares_libs} nsl) |
|||
endif() |
|||
|
|||
if(cares_libs) |
|||
target_link_libraries(cares ${cares_libs}) |
|||
if(ares_libs) |
|||
target_link_libraries(ares ${ares_libs}) |
|||
endif() |
|||
|
@ -0,0 +1,23 @@ |
|||
cmake_minimum_required(VERSION 2.6) |
|||
|
|||
include(FindThreads) |
|||
|
|||
project(eio) |
|||
|
|||
add_definitions(-D_GNU_SOURCE) |
|||
|
|||
if(!${CMAKE_USE_PTHREADS_INIT}) |
|||
message(FATAL_ERROR "Unable to find pthreads") |
|||
endif() |
|||
|
|||
string(TOLOWER ${CMAKE_SYSTEM_NAME} eio_platform) |
|||
set(config_header ${ev_SOURCE_DIR}/config_${eio_platform}.h) |
|||
|
|||
if(EXISTS ${config_header}) |
|||
add_definitions(-DEIO_CONFIG_H="${config_header}") |
|||
else() |
|||
message(FATAL_ERROR "Unsupported platform: ${eio_platform}") |
|||
endif() |
|||
|
|||
add_library(eio eio.c) |
|||
target_link_libraries(eio ${CMAKE_THREAD_LIBS_INIT}) |
@ -0,0 +1,16 @@ |
|||
cmake_minimum_required(VERSION 2.6) |
|||
|
|||
project(ev) |
|||
|
|||
add_definitions(-DEV_MULTIPLICITY=0) |
|||
|
|||
string(TOLOWER ${CMAKE_SYSTEM_NAME} ev_platform) |
|||
set(config_header ${ev_SOURCE_DIR}/config_${ev_platform}.h) |
|||
|
|||
if(EXISTS ${config_header}) |
|||
add_definitions(-DEV_CONFIG_H="${config_header}") |
|||
else() |
|||
message(FATAL_ERROR "Unsupported platform: ${ev_platform}") |
|||
endif() |
|||
|
|||
add_library (ev ev.c) |
Loading…
Reference in new issue