Skip to content
This repository has been archived by the owner on Nov 20, 2020. It is now read-only.

Commit

Permalink
build: update dist.cmake, run tests, use librt
Browse files Browse the repository at this point in the history
  • Loading branch information
davidm committed Apr 6, 2011
1 parent adefcb7 commit bd776b6
Show file tree
Hide file tree
Showing 2 changed files with 435 additions and 115 deletions.
42 changes: 20 additions & 22 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
# Copyright (C) 2007-2009 LuaDist.
# Copyright (C) 2007-2011 LuaDist.
# Created by Peter Kapec
# Redistribution and use of this file is allowed according to the terms of the MIT license.
# For details see the COPYRIGHT file distributed with LuaDist.
# Please note that the package source code is licensed under its own license.

PROJECT(luasys C)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
INCLUDE(dist.cmake)
project ( luasys C )
cmake_minimum_required ( VERSION 2.6 )
include ( dist.cmake )

# Build
INCLUDE_DIRECTORIES(src src/event)
include_directories ( src src/event )

IF(WIN32 AND NOT CYGWIN)
ADD_DEFINITIONS(-DWIN32)
if (WIN32 AND NOT CYGWIN )
add_definitions ( -DWIN32 )
#need? SET(WIN32_SRC src/win32/sys_win32.c )
SET(LIBS winmm ws2_32 mswsock)
ELSEIF(UNIX)
SET(LIBS pthread rt)
ADD_DEFINITIONS(-DUSE_EPOLL)
ENDIF(WIN32 AND NOT CYGWIN)



ADD_LUA_MODULE(sys
set ( LIBS winmm ws2_32 mswsock )
elseif ( UNIX )
set ( LIBS rt )
add_definitions ( -DUSE_EPOLL )
endif ()
#FIX: BSD and OSX? -DUSE_KQUEUE

install_lua_module ( sys
src/luasys.c
# Note: these are included by luasys.c:
# src/sys_comm.c
Expand Down Expand Up @@ -50,10 +48,10 @@ ADD_LUA_MODULE(sys
# src/event/timeout.c
src/sock/sys_sock.c
)
TARGET_LINK_LIBRARIES(sys ${LIBS})
target_link_libraries ( sys ${LIBS} )

install_data ( README VERSION )
install_test ( test/ )

# Install all files and documentation
INSTALL (TARGETS sys DESTINATION ${INSTALL_CMOD})
add_lua_test ( test/test_sys.lua )

INSTALL (FILES README VERSION DESTINATION ${INSTALL_DATA})
INSTALL (DIRECTORY test/ DESTINATION ${INSTALL_TEST})
Loading

0 comments on commit bd776b6

Please sign in to comment.