first draft of premake/cmake build files for clsocket (tiny cross-platform TCP socket library)
This commit is contained in:
@@ -251,6 +251,7 @@ end
|
|||||||
include "../examples/ExtendedTutorials"
|
include "../examples/ExtendedTutorials"
|
||||||
include "../examples/SharedMemory"
|
include "../examples/SharedMemory"
|
||||||
include "../examples/ThirdPartyLibs/BussIK"
|
include "../examples/ThirdPartyLibs/BussIK"
|
||||||
|
|
||||||
include "../examples/MultiThreading"
|
include "../examples/MultiThreading"
|
||||||
|
|
||||||
if _OPTIONS["lua"] then
|
if _OPTIONS["lua"] then
|
||||||
@@ -270,6 +271,11 @@ end
|
|||||||
include "../examples/ThirdPartyLibs/midi"
|
include "../examples/ThirdPartyLibs/midi"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if not _OPTIONS["no_clsocket"] then
|
||||||
|
include "../examples/ThirdPartyLibs/clsocket"
|
||||||
|
defines {"BT_ENABLE_CLSOCKET"}
|
||||||
|
end
|
||||||
|
|
||||||
if not _OPTIONS["no-enet"] then
|
if not _OPTIONS["no-enet"] then
|
||||||
include "../examples/ThirdPartyLibs/enet"
|
include "../examples/ThirdPartyLibs/enet"
|
||||||
include "../test/enet/nat_punchthrough/client"
|
include "../test/enet/nat_punchthrough/client"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
SUBDIRS( HelloWorld BasicDemo )
|
SUBDIRS( HelloWorld BasicDemo )
|
||||||
IF(BUILD_BULLET3)
|
IF(BUILD_BULLET3)
|
||||||
SUBDIRS( ExampleBrowser SharedMemory ThirdPartyLibs/Gwen ThirdPartyLibs/BussIK OpenGLWindow )
|
SUBDIRS( ExampleBrowser SharedMemory ThirdPartyLibs/Gwen ThirdPartyLibs/BussIK ThirdPartyLibs/clsocket OpenGLWindow )
|
||||||
ENDIF()
|
ENDIF()
|
||||||
IF(BUILD_PYBULLET)
|
IF(BUILD_PYBULLET)
|
||||||
SUBDIRS(pybullet)
|
SUBDIRS(pybullet)
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
|
#cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
|
||||||
project(clsocket)
|
#project(clsocket)
|
||||||
|
|
||||||
# set up versioning.
|
# set up versioning.
|
||||||
set(BUILD_MAJOR "1")
|
#set(BUILD_MAJOR "1")
|
||||||
set(BUILD_MINOR "4")
|
#set(BUILD_MINOR "4")
|
||||||
set(BUILD_VERSION "3")
|
#set(BUILD_VERSION "3")
|
||||||
|
|
||||||
include_directories(src)
|
include_directories(src)
|
||||||
|
|
||||||
@@ -45,13 +45,14 @@ elseif(WIN32)
|
|||||||
# Special MINGW stuff here
|
# Special MINGW stuff here
|
||||||
elseif(MSVC)
|
elseif(MSVC)
|
||||||
# Special MSVC stuff here
|
# Special MSVC stuff here
|
||||||
|
add_definitions(-D_WINSOCK_DEPRECATED_NO_WARNINGS)
|
||||||
else()
|
else()
|
||||||
# No idea what it is, but there's a good chance it's too weird.
|
# No idea what it is, but there's a good chance it's too weird.
|
||||||
MESSAGE( FATAL_ERROR "Using unknown WIN32 compiler... NOT. Please add to build system." )
|
MESSAGE( FATAL_ERROR "Using unknown WIN32 compiler... NOT. Please add to build system." )
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
OPTION(CLSOCKET_SHARED "Build clsocket lib as shared." ON)
|
OPTION(CLSOCKET_SHARED "Build clsocket lib as shared." OFF)
|
||||||
OPTION(CLSOCKET_DEP_ONLY "Build for use inside other CMake projects as dependency." OFF)
|
OPTION(CLSOCKET_DEP_ONLY "Build for use inside other CMake projects as dependency." OFF)
|
||||||
|
|
||||||
# make the lib
|
# make the lib
|
||||||
@@ -78,25 +79,3 @@ else()
|
|||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
OPTION(CLSOCKET_EXAMPLES "Build the examples" ON)
|
|
||||||
|
|
||||||
ADD_EXECUTABLE(echoserver-example examples/EchoServer.cpp)
|
|
||||||
TARGET_LINK_LIBRARIES(echoserver-example clsocket)
|
|
||||||
|
|
||||||
ADD_EXECUTABLE(querydaytime-example examples/QueryDayTime.cpp)
|
|
||||||
TARGET_LINK_LIBRARIES(querydaytime-example clsocket)
|
|
||||||
|
|
||||||
|
|
||||||
if(UNIX)
|
|
||||||
|
|
||||||
if(CLSOCKET_EXAMPLES)
|
|
||||||
ADD_EXECUTABLE(clsocket-example examples/RecvAsync.cpp)
|
|
||||||
TARGET_LINK_LIBRARIES(clsocket-example clsocket pthread)
|
|
||||||
if(NOT CLSOCKET_DEP_ONLY)
|
|
||||||
install(TARGETS clsocket-example DESTINATION bin)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
|||||||
24
examples/ThirdPartyLibs/clsocket/premake4.lua
Normal file
24
examples/ThirdPartyLibs/clsocket/premake4.lua
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
project "clsocket"
|
||||||
|
|
||||||
|
kind "StaticLib"
|
||||||
|
|
||||||
|
if os.is("Windows") then
|
||||||
|
defines { "WIN32","_WINSOCK_DEPRECATED_NO_WARNINGS" }
|
||||||
|
end
|
||||||
|
if os.is("Linux") then
|
||||||
|
defines {"HAS_SOCKLEN_T","_LINUX"}
|
||||||
|
end
|
||||||
|
if os.is("MacOSX") then
|
||||||
|
defines {"HAS_SOCKLEN_T","_DARWIN"}
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
includedirs {
|
||||||
|
".","include"
|
||||||
|
}
|
||||||
|
files {
|
||||||
|
"src/SimpleSocket.cpp",
|
||||||
|
"src/ActiveSocket.cpp",
|
||||||
|
"src/PassiveSocket.cpp",
|
||||||
|
"**.h"
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user