|
|
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 2.6)
|
|
|
project(enet C)
|
|
|
|
|
|
set(ENET_STATIC "0" CACHE BOOL "Create a static library")
|
|
|
-set(ENET_SHARED "1" CACHE BOOL "Create a shared library")
|
|
|
+set(ENET_SHARED "0" CACHE BOOL "Create a shared library")
|
|
|
set(ENET_LZ4 "0" CACHE BOOL "Add support for an optional packet-level compression")
|
|
|
|
|
|
if (MSVC)
|
|
|
@@ -13,13 +13,13 @@ endif()
|
|
|
|
|
|
include_directories(${PROJECT_SOURCE_DIR})
|
|
|
|
|
|
+if (ENET_LZ4)
|
|
|
+ add_definitions(-DENET_LZ4)
|
|
|
+ set(SOURCES lz4/lz4.c)
|
|
|
+endif()
|
|
|
+
|
|
|
if (ENET_STATIC)
|
|
|
- if (NOT ENET_LZ4)
|
|
|
- add_library(enet_static STATIC enet.c)
|
|
|
- else()
|
|
|
- add_definitions(-DENET_LZ4)
|
|
|
- add_library(enet_static STATIC enet.c lz4/lz4.c)
|
|
|
- endif()
|
|
|
+ add_library(enet_static STATIC enet.c ${SOURCES})
|
|
|
|
|
|
if (WIN32)
|
|
|
target_link_libraries(enet_static winmm ws2_32)
|
|
|
@@ -27,12 +27,7 @@ if (ENET_STATIC)
|
|
|
endif()
|
|
|
|
|
|
if (ENET_SHARED)
|
|
|
- if (NOT ENET_LZ4)
|
|
|
- add_library(enet SHARED enet.c)
|
|
|
- else()
|
|
|
- add_definitions(-DENET_LZ4)
|
|
|
- add_library(enet SHARED enet.c lz4/lz4.c)
|
|
|
- endif()
|
|
|
+ add_library(enet SHARED enet.c ${SOURCES})
|
|
|
|
|
|
if (WIN32)
|
|
|
target_link_libraries(enet winmm ws2_32)
|