forked from zpl-c/enet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
46 lines (35 loc) · 1.18 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
cmake_minimum_required(VERSION 3.0)
project(enet C)
# configure projects
if (ENET_STATIC)
add_library(enet_static STATIC test/library.c)
if (WIN32)
target_link_libraries(enet_static PUBLIC winmm ws2_32)
if(MSVC)
target_compile_options(enet_static PRIVATE -W3)
endif()
else()
target_compile_options(enet_static PRIVATE -Wno-error)
endif()
target_include_directories(enet_static PUBLIC ${PROJECT_SOURCE_DIR}/include)
endif()
if (ENET_SHARED)
add_library(enet_shared SHARED test/library.c)
target_compile_definitions(enet_shared PUBLIC -DENET_DLL)
if (WIN32)
target_link_libraries(enet_shared PUBLIC winmm ws2_32)
if(MSVC)
target_compile_options(enet_shared PRIVATE -W3)
endif()
else()
target_compile_options(enet_shared PRIVATE -Wno-error)
endif()
target_include_directories(enet_shared PUBLIC ${PROJECT_SOURCE_DIR}/include)
endif()
if (ENET_TEST)
add_executable(enet_test test/build.c)
target_include_directories(enet_test PRIVATE ${PROJECT_SOURCE_DIR}/include)
if (WIN32)
target_link_libraries(enet_test PUBLIC winmm ws2_32)
endif()
endif()