-
Notifications
You must be signed in to change notification settings - Fork 20
/
CMakeLists.txt
126 lines (106 loc) · 3.02 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
cmake_minimum_required(VERSION 3.5)
project(WLANOptimizer)
if(UNIX)
SET(CMAKE_SYSTEM_NAME Windows)
SET(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++-posix)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++ -Wl,-Bstatic,--whole-archive -lwinpthread -Wl,--no-whole-archive")
endif()
set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "" FORCE)
set(CMAKE_CXX_STANDARD 14)
set(LIB_SOURCE_FILES
WLANOptimizer.cpp
WLANOptimizer.h
)
set(STAND_ALONE_SOURCE_FILES
tests/StandAlone.cpp
)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
if(MSVC)
else()
# Remove -Wno-unused-local-typedef after updating Asio code
set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-unused-local-typedef")
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -march=native")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -march=native")
endif()
add_library(WLANOptimizer STATIC ${LIB_SOURCE_FILES})
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
if(MSVC)
add_executable(stand_alone.exe ${STAND_ALONE_SOURCE_FILES})
else()
add_executable(stand_alone.exe WIN32 ${STAND_ALONE_SOURCE_FILES})
endif()
target_link_libraries(stand_alone.exe
WLANOptimizer
Threads::Threads
wlanapi
)
set(COMMON_SOURCE_FILES
thirdparty/IncludeAsio.h
thirdparty/asio.hpp
tests/tools/Logger.cpp
tests/tools/Logger.h
tests/tools/PacketAllocator.cpp
tests/tools/PacketAllocator.h
tests/tools/TimeSync.cpp
tests/tools/TimeSync.h
tests/tools/Counter.h
tests/tools/ccat.cpp
tests/tools/ccat.h
tests/tools/CCatCodec.cpp
tests/tools/CCatCodec.h
tests/tools/CCatCpp.h
tests/tools/gf256.cpp
tests/tools/gf256.h
tests/tools/StrikeRegister.cpp
tests/tools/StrikeRegister.h
tests/Statistics.cpp
tests/Statistics.h
tests/Tools.cpp
tests/Tools.h
tests/Connection.cpp
tests/Connection.h
)
set(PEER2PEER_NO_GUI_SOURCE_FILES
${COMMON_SOURCE_FILES}
tests/TestPeer2Peer_NoGUI.cpp
)
add_executable(test_peer2peer_no_gui ${PEER2PEER_NO_GUI_SOURCE_FILES})
target_link_libraries(test_peer2peer_no_gui
WLANOptimizer
Threads::Threads
wlanapi
)
# Peer2Peer test app with a weird IMGUI/DirectX11 UI
if(MSVC)
set(GUI_SOURCE_FILES
thirdparty/imgui.cpp
thirdparty/imgui_draw.cpp
thirdparty/imgui.h
thirdparty/imconfig.h
thirdparty/imgui_internal.h
thirdparty/imgui_impl_dx11.cpp
thirdparty/imgui_impl_dx11.h
thirdparty/stb_rect_pack.h
thirdparty/stb_textedit.h
thirdparty/stb_truetype.h
)
set(PEER2PEER_GUI_SOURCE_FILES
${COMMON_SOURCE_FILES}
${GUI_SOURCE_FILES}
tests/TestPeer2Peer_GUI.cpp
)
add_executable(test_peer2peer_gui ${PEER2PEER_GUI_SOURCE_FILES})
target_link_libraries(test_peer2peer_gui
WLANOptimizer
Threads::Threads
wlanapi
d3d11
d3dcompiler
dxgi
imm32
)
# End if msvc
endif()