forked from xmrig/xmrig-proxy
-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
196 lines (175 loc) · 5.65 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
cmake_minimum_required(VERSION 3.5)
project(xmrigcc-proxy)
option(WITH_GOOGLE_BREAKPAD "Use Google Breakpad" OFF)
option(WITH_DEBUG_LOG "Enable debug log output" OFF)
option(WITH_HTTP "HTTP protocol support (client/server)" ON)
option(WITH_TLS "Enable OpenSSL support" ON)
option(WITH_ENV_VARS "Enable environment variables support in config file" ON)
option(BUILD_STATIC "Build static binary" OFF)
include (CheckIncludeFile)
include (cmake/os.cmake)
include (src/base/base.cmake)
set(HEADERS
"${HEADERS_BASE}"
"${HEADERS_BASE_HTTP}"
src/App.h
src/core/config/Config_platform.h
src/core/config/Config.h
src/core/config/ConfigTransform.h
src/core/config/usage.h
src/core/Controller.h
src/donate.h
src/net/JobResult.h
src/net/strategies/DonateStrategy.h
src/proxy/BindHost.h
src/proxy/Counters.h
src/proxy/CustomDiff.h
src/proxy/Error.h
src/proxy/Events.h
src/proxy/events/AcceptEvent.h
src/proxy/events/CloseEvent.h
src/proxy/events/ConnectionEvent.h
src/proxy/events/Event.h
src/proxy/events/LoginEvent.h
src/proxy/events/MinerEvent.h
src/proxy/events/SubmitEvent.h
src/proxy/interfaces/IEvent.h
src/proxy/interfaces/IEventListener.h
src/proxy/interfaces/ISplitter.h
src/proxy/log/AccessLog.h
src/proxy/log/ShareLog.h
src/proxy/Login.h
src/proxy/Miner.h
src/proxy/Miners.h
src/proxy/Proxy.h
src/proxy/ProxyDebug.h
src/proxy/Server.h
src/proxy/splitters/donate/DonateMapper.h
src/proxy/splitters/donate/DonateSplitter.h
src/proxy/splitters/extra_nonce/ExtraNonceMapper.h
src/proxy/splitters/extra_nonce/ExtraNonceSplitter.h
src/proxy/splitters/extra_nonce/ExtraNonceStorage.h
src/proxy/splitters/nicehash/NonceMapper.h
src/proxy/splitters/nicehash/NonceSplitter.h
src/proxy/splitters/nicehash/NonceStorage.h
src/proxy/splitters/simple/SimpleMapper.h
src/proxy/splitters/simple/SimpleSplitter.h
src/proxy/splitters/Splitter.h
src/proxy/Stats.h
src/proxy/StatsData.h
src/proxy/TickingCounter.h
src/proxy/workers/Worker.h
src/proxy/workers/Workers.h
src/Summary.h
src/version.h
)
set(SOURCES
"${SOURCES_BASE}"
"${SOURCES_BASE_HTTP}"
src/App.cpp
src/core/config/Config.cpp
src/core/config/ConfigTransform.cpp
src/core/Controller.cpp
src/net/JobResult.cpp
src/net/strategies/DonateStrategy.cpp
src/proxy/BindHost.cpp
src/proxy/Counters.cpp
src/proxy/CustomDiff.cpp
src/proxy/Error.cpp
src/proxy/Events.cpp
src/proxy/events/ConnectionEvent.h
src/proxy/events/Event.cpp
src/proxy/events/MinerEvent.cpp
src/proxy/log/AccessLog.cpp
src/proxy/log/ShareLog.cpp
src/proxy/Login.cpp
src/proxy/Miner.cpp
src/proxy/Miners.cpp
src/proxy/Proxy.cpp
src/proxy/ProxyDebug.cpp
src/proxy/Server.cpp
src/proxy/splitters/donate/DonateMapper.cpp
src/proxy/splitters/donate/DonateSplitter.cpp
src/proxy/splitters/extra_nonce/ExtraNonceMapper.cpp
src/proxy/splitters/extra_nonce/ExtraNonceSplitter.cpp
src/proxy/splitters/extra_nonce/ExtraNonceStorage.cpp
src/proxy/splitters/nicehash/NonceMapper.cpp
src/proxy/splitters/nicehash/NonceSplitter.cpp
src/proxy/splitters/nicehash/NonceStorage.cpp
src/proxy/splitters/simple/SimpleMapper.cpp
src/proxy/splitters/simple/SimpleSplitter.cpp
src/proxy/splitters/Splitter.cpp
src/proxy/Stats.cpp
src/proxy/workers/Worker.cpp
src/proxy/workers/Workers.cpp
src/Summary.cpp
src/xmrig.cpp
)
if (WIN32)
set(SOURCES_OS
"${SOURCES_OS}"
res/app.rc
src/App_win.cpp
)
add_definitions(/DWIN32)
set(EXTRA_LIBS ws2_32 psapi iphlpapi userenv dbghelp)
elseif (APPLE)
set(SOURCES_OS
"${SOURCES_OS}"
src/App_unix.cpp
)
find_library(IOKIT_LIBRARY IOKit)
find_library(CORESERVICES_LIBRARY CoreServices)
set(EXTRA_LIBS ${IOKIT_LIBRARY} ${CORESERVICES_LIBRARY})
else()
set(SOURCES_OS
"${SOURCES_OS}"
src/App_unix.cpp
)
if (CMAKE_SYSTEM_NAME STREQUAL FreeBSD)
set(EXTRA_LIBS pthread)
else()
set(EXTRA_LIBS pthread rt dl)
endif()
endif()
add_definitions(/DXMRIG_PROXY_PROJECT /DXMRIG_FORCE_TLS)
add_definitions(/DUNICODE)
add_definitions(/D__STDC_FORMAT_MACROS)
add_definitions(/DAPP_DEVEL)
add_definitions(/DXMRIG_NO_ASM)
add_definitions(/DXMRIG_ALGO_RANDOMX)
add_definitions(/DXMRIG_ALGO_CN_LITE)
add_definitions(/DXMRIG_ALGO_CN_HEAVY)
add_definitions(/DXMRIG_ALGO_CN_PICO)
add_definitions(/DXMRIG_ALGO_CN_FEMTO)
add_definitions(/DXMRIG_ALGO_CN_GPU)
add_definitions(/DXMRIG_ALGO_ARGON2)
if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|AMD64)$" AND CMAKE_SIZEOF_VOID_P EQUAL 8)
add_definitions(/DRAPIDJSON_SSE2)
endif()
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
find_package(UV REQUIRED)
include(cmake/flags.cmake)
include(cmake/OpenSSL.cmake)
if (WITH_GOOGLE_BREAKPAD)
include_directories(/usr/local/include/breakpad)
set(GOOGLE_BREAKPAD_LIBS breakpad_client)
else()
add_definitions(/DXMRIG_NO_GOOGLE_BREAKPAD)
endif()
if (WITH_HTTP)
set(HTTP_SOURCES
src/api/v1/ApiRouter.cpp
src/api/v1/ApiRouter.h
)
else()
set(HTTP_SOURCES "")
endif()
if (WITH_DEBUG_LOG)
add_definitions(/DAPP_DEBUG)
endif()
include_directories(src)
include_directories(src/3rdparty)
include_directories(${UV_INCLUDE_DIR})
add_executable(${CMAKE_PROJECT_NAME} ${HEADERS} ${SOURCES} ${SOURCES_OS} ${SOURCES_SYSLOG} ${HTTP_SOURCES} ${TLS_SOURCES})
target_link_libraries(${CMAKE_PROJECT_NAME} ${OPENSSL_LIBRARIES} ${UV_LIBRARIES} ${EXTRA_LIBS} ${GOOGLE_BREAKPAD_LIBS})