-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
397 lines (359 loc) · 12.8 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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
# This file is automatically generated from cmake.toml - DO NOT EDIT
# See https://github.com/build-cpp/cmkr for more information
cmake_minimum_required(VERSION 3.15)
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
message(FATAL_ERROR "In-tree builds are not supported. Run CMake from a separate directory: cmake -B build")
endif()
set(CMKR_ROOT_PROJECT OFF)
if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
set(CMKR_ROOT_PROJECT ON)
# Bootstrap cmkr and automatically regenerate CMakeLists.txt
include(cmkr.cmake OPTIONAL RESULT_VARIABLE CMKR_INCLUDE_RESULT)
if(CMKR_INCLUDE_RESULT)
cmkr()
endif()
# Enable folder support
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# Create a configure-time dependency on cmake.toml to improve IDE support
configure_file(cmake.toml cmake.toml COPYONLY)
endif()
project(outrun2006tweaks-proj)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
set(ASMJIT_STATIC ON CACHE BOOL "" FORCE)
# disable unneeded FLAC stuff
set(INSTALL_MANPAGES OFF CACHE BOOL "" FORCE)
set(BUILD_CXXLIBS OFF CACHE BOOL "" FORCE)
set(BUILD_DOCS OFF CACHE BOOL "" FORCE)
set(BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
set(BUILD_PROGRAMS OFF CACHE BOOL "" FORCE)
set(BUILD_TESTING OFF CACHE BOOL "" FORCE)
set(UPNPC_BUILD_TESTS OFF CACHE BOOL "" FORCE)
set(UPNPC_BUILD_SAMPLE OFF CACHE BOOL "" FORCE)
set(UPNPC_BUILD_SHARED OFF CACHE BOOL "" FORCE)
set(JSONCPP_STATIC_WINDOWS_RUNTIME OFF CACHE BOOL "" FORCE)
set(JSONCPP_WITH_TESTS OFF CACHE BOOL "" FORCE)
set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
set(BUILD_STATIC_LIBS ON CACHE BOOL "" FORCE)
set(BUILD_OBJECT_LIBS ON CACHE BOOL "" FORCE)
set(SDL_TEST_LIBRARY OFF CACHE BOOL "" FORCE)
option(ZYDIS_BUILD_TOOLS "" OFF)
option(ZYDIS_BUILD_EXAMPLES "" OFF)
option(JSONCPP_WITH_TESTS "" OFF)
option(JSONCPP_STATIC_WINDOWS_RUNTIME "" OFF)
if ("${CMAKE_BUILD_TYPE}" MATCHES "Release")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MT")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MT")
# Statically compile runtime
string(REGEX REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
string(REGEX REPLACE "/MD" "/MT" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
string(REGEX REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
string(REGEX REPLACE "/MD" "/MT" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded")
message(NOTICE "Building in Release mode")
endif()
include(FetchContent)
# Fix warnings about DOWNLOAD_EXTRACT_TIMESTAMP
if(POLICY CMP0135)
cmake_policy(SET CMP0135 NEW)
endif()
message(STATUS "Fetching zydis (v4.0.0)...")
FetchContent_Declare(zydis
GIT_REPOSITORY
"https://github.com/zyantific/zydis"
GIT_TAG
v4.0.0
)
FetchContent_MakeAvailable(zydis)
message(STATUS "Fetching safetyhook (629558c64009a7291ba6ed5cfb49187086a27a47)...")
FetchContent_Declare(safetyhook
GIT_REPOSITORY
"https://github.com/cursey/safetyhook"
GIT_TAG
629558c64009a7291ba6ed5cfb49187086a27a47
)
FetchContent_MakeAvailable(safetyhook)
message(STATUS "Fetching ogg (v1.3.5)...")
FetchContent_Declare(ogg
GIT_REPOSITORY
"https://github.com/xiph/ogg"
GIT_TAG
v1.3.5
)
FetchContent_MakeAvailable(ogg)
message(STATUS "Fetching flac (1.4.3)...")
FetchContent_Declare(flac
GIT_REPOSITORY
"https://github.com/xiph/flac"
GIT_TAG
1.4.3
)
FetchContent_MakeAvailable(flac)
message(STATUS "Fetching miniupnpc (miniupnpd_2_3_7)...")
FetchContent_Declare(miniupnpc
GIT_REPOSITORY
"https://github.com/miniupnp/miniupnp"
GIT_TAG
miniupnpd_2_3_7
SOURCE_SUBDIR
miniupnpc
)
FetchContent_MakeAvailable(miniupnpc)
message(STATUS "Fetching jsoncpp (1.9.6)...")
FetchContent_Declare(jsoncpp
GIT_REPOSITORY
"https://github.com/open-source-parsers/jsoncpp.git"
GIT_TAG
1.9.6
)
FetchContent_MakeAvailable(jsoncpp)
message(STATUS "Fetching zlib (v1.3.1)...")
FetchContent_Declare(zlib
GIT_REPOSITORY
"https://github.com/madler/zlib"
GIT_TAG
v1.3.1
)
FetchContent_MakeAvailable(zlib)
message(STATUS "Fetching sdl (preview-3.1.8)...")
FetchContent_Declare(sdl
GIT_REPOSITORY
"https://github.com/libsdl-org/SDL"
GIT_TAG
preview-3.1.8
)
FetchContent_MakeAvailable(sdl)
# Target: spdlog
set(spdlog_SOURCES
cmake.toml
"external/spdlog/src/async.cpp"
"external/spdlog/src/bundled_fmtlib_format.cpp"
"external/spdlog/src/cfg.cpp"
"external/spdlog/src/color_sinks.cpp"
"external/spdlog/src/file_sinks.cpp"
"external/spdlog/src/spdlog.cpp"
"external/spdlog/src/stdout_sinks.cpp"
)
add_library(spdlog STATIC)
target_sources(spdlog PRIVATE ${spdlog_SOURCES})
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${spdlog_SOURCES})
target_compile_definitions(spdlog PUBLIC
SPDLOG_COMPILED_LIB
_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR
)
target_include_directories(spdlog PUBLIC
"external/spdlog/include"
)
# Target: outrun2006tweaks
set(outrun2006tweaks_SOURCES
OutRun2006Tweaks.ini
OutRun2006Tweaks.lods.ini
cmake.toml
"external/IXWebSocket/ixwebsocket/IXBase64.h"
"external/IXWebSocket/ixwebsocket/IXBench.cpp"
"external/IXWebSocket/ixwebsocket/IXBench.h"
"external/IXWebSocket/ixwebsocket/IXCancellationRequest.cpp"
"external/IXWebSocket/ixwebsocket/IXCancellationRequest.h"
"external/IXWebSocket/ixwebsocket/IXConnectionState.cpp"
"external/IXWebSocket/ixwebsocket/IXConnectionState.h"
"external/IXWebSocket/ixwebsocket/IXDNSLookup.cpp"
"external/IXWebSocket/ixwebsocket/IXDNSLookup.h"
"external/IXWebSocket/ixwebsocket/IXExponentialBackoff.cpp"
"external/IXWebSocket/ixwebsocket/IXExponentialBackoff.h"
"external/IXWebSocket/ixwebsocket/IXGetFreePort.cpp"
"external/IXWebSocket/ixwebsocket/IXGetFreePort.h"
"external/IXWebSocket/ixwebsocket/IXGzipCodec.cpp"
"external/IXWebSocket/ixwebsocket/IXGzipCodec.h"
"external/IXWebSocket/ixwebsocket/IXHttp.cpp"
"external/IXWebSocket/ixwebsocket/IXHttp.h"
"external/IXWebSocket/ixwebsocket/IXHttpClient.cpp"
"external/IXWebSocket/ixwebsocket/IXHttpClient.h"
"external/IXWebSocket/ixwebsocket/IXHttpServer.cpp"
"external/IXWebSocket/ixwebsocket/IXHttpServer.h"
"external/IXWebSocket/ixwebsocket/IXNetSystem.cpp"
"external/IXWebSocket/ixwebsocket/IXNetSystem.h"
"external/IXWebSocket/ixwebsocket/IXProgressCallback.h"
"external/IXWebSocket/ixwebsocket/IXSelectInterrupt.cpp"
"external/IXWebSocket/ixwebsocket/IXSelectInterrupt.h"
"external/IXWebSocket/ixwebsocket/IXSelectInterruptEvent.cpp"
"external/IXWebSocket/ixwebsocket/IXSelectInterruptEvent.h"
"external/IXWebSocket/ixwebsocket/IXSelectInterruptFactory.cpp"
"external/IXWebSocket/ixwebsocket/IXSelectInterruptFactory.h"
"external/IXWebSocket/ixwebsocket/IXSelectInterruptPipe.cpp"
"external/IXWebSocket/ixwebsocket/IXSelectInterruptPipe.h"
"external/IXWebSocket/ixwebsocket/IXSetThreadName.cpp"
"external/IXWebSocket/ixwebsocket/IXSetThreadName.h"
"external/IXWebSocket/ixwebsocket/IXSocket.cpp"
"external/IXWebSocket/ixwebsocket/IXSocket.h"
"external/IXWebSocket/ixwebsocket/IXSocketAppleSSL.cpp"
"external/IXWebSocket/ixwebsocket/IXSocketAppleSSL.h"
"external/IXWebSocket/ixwebsocket/IXSocketConnect.cpp"
"external/IXWebSocket/ixwebsocket/IXSocketConnect.h"
"external/IXWebSocket/ixwebsocket/IXSocketFactory.cpp"
"external/IXWebSocket/ixwebsocket/IXSocketFactory.h"
"external/IXWebSocket/ixwebsocket/IXSocketMbedTLS.cpp"
"external/IXWebSocket/ixwebsocket/IXSocketMbedTLS.h"
"external/IXWebSocket/ixwebsocket/IXSocketOpenSSL.cpp"
"external/IXWebSocket/ixwebsocket/IXSocketOpenSSL.h"
"external/IXWebSocket/ixwebsocket/IXSocketServer.cpp"
"external/IXWebSocket/ixwebsocket/IXSocketServer.h"
"external/IXWebSocket/ixwebsocket/IXSocketTLSOptions.cpp"
"external/IXWebSocket/ixwebsocket/IXSocketTLSOptions.h"
"external/IXWebSocket/ixwebsocket/IXStrCaseCompare.cpp"
"external/IXWebSocket/ixwebsocket/IXStrCaseCompare.h"
"external/IXWebSocket/ixwebsocket/IXUdpSocket.cpp"
"external/IXWebSocket/ixwebsocket/IXUdpSocket.h"
"external/IXWebSocket/ixwebsocket/IXUniquePtr.h"
"external/IXWebSocket/ixwebsocket/IXUrlParser.cpp"
"external/IXWebSocket/ixwebsocket/IXUrlParser.h"
"external/IXWebSocket/ixwebsocket/IXUserAgent.cpp"
"external/IXWebSocket/ixwebsocket/IXUserAgent.h"
"external/IXWebSocket/ixwebsocket/IXUtf8Validator.h"
"external/IXWebSocket/ixwebsocket/IXUuid.cpp"
"external/IXWebSocket/ixwebsocket/IXUuid.h"
"external/IXWebSocket/ixwebsocket/IXWebSocket.cpp"
"external/IXWebSocket/ixwebsocket/IXWebSocket.h"
"external/IXWebSocket/ixwebsocket/IXWebSocketCloseConstants.cpp"
"external/IXWebSocket/ixwebsocket/IXWebSocketCloseConstants.h"
"external/IXWebSocket/ixwebsocket/IXWebSocketCloseInfo.h"
"external/IXWebSocket/ixwebsocket/IXWebSocketErrorInfo.h"
"external/IXWebSocket/ixwebsocket/IXWebSocketHandshake.cpp"
"external/IXWebSocket/ixwebsocket/IXWebSocketHandshake.h"
"external/IXWebSocket/ixwebsocket/IXWebSocketHandshakeKeyGen.h"
"external/IXWebSocket/ixwebsocket/IXWebSocketHttpHeaders.cpp"
"external/IXWebSocket/ixwebsocket/IXWebSocketHttpHeaders.h"
"external/IXWebSocket/ixwebsocket/IXWebSocketInitResult.h"
"external/IXWebSocket/ixwebsocket/IXWebSocketMessage.h"
"external/IXWebSocket/ixwebsocket/IXWebSocketMessageType.h"
"external/IXWebSocket/ixwebsocket/IXWebSocketOpenInfo.h"
"external/IXWebSocket/ixwebsocket/IXWebSocketPerMessageDeflate.cpp"
"external/IXWebSocket/ixwebsocket/IXWebSocketPerMessageDeflate.h"
"external/IXWebSocket/ixwebsocket/IXWebSocketPerMessageDeflateCodec.cpp"
"external/IXWebSocket/ixwebsocket/IXWebSocketPerMessageDeflateCodec.h"
"external/IXWebSocket/ixwebsocket/IXWebSocketPerMessageDeflateOptions.cpp"
"external/IXWebSocket/ixwebsocket/IXWebSocketPerMessageDeflateOptions.h"
"external/IXWebSocket/ixwebsocket/IXWebSocketProxyServer.cpp"
"external/IXWebSocket/ixwebsocket/IXWebSocketProxyServer.h"
"external/IXWebSocket/ixwebsocket/IXWebSocketSendData.h"
"external/IXWebSocket/ixwebsocket/IXWebSocketSendInfo.h"
"external/IXWebSocket/ixwebsocket/IXWebSocketServer.cpp"
"external/IXWebSocket/ixwebsocket/IXWebSocketServer.h"
"external/IXWebSocket/ixwebsocket/IXWebSocketTransport.cpp"
"external/IXWebSocket/ixwebsocket/IXWebSocketTransport.h"
"external/IXWebSocket/ixwebsocket/IXWebSocketVersion.h"
"external/ModUtils/MemoryMgr.h"
"external/ModUtils/Patterns.cpp"
"external/ModUtils/Patterns.h"
"external/imgui/backends/imgui_impl_dx9.cpp"
"external/imgui/backends/imgui_impl_win32.cpp"
"external/imgui/imgui.cpp"
"external/imgui/imgui_demo.cpp"
"external/imgui/imgui_draw.cpp"
"external/imgui/imgui_tables.cpp"
"external/imgui/imgui_widgets.cpp"
"external/ini-cpp/ini/ini.h"
"external/miniz/miniz.c"
"external/miniz/miniz.h"
"external/xxHash/xxhash.c"
"external/xxHash/xxhash.h"
"src/Proxy.cpp"
"src/Proxy.def"
"src/Proxy.hpp"
"src/Resource.rc"
"src/dllmain.cpp"
"src/exception.hpp"
"src/game.hpp"
"src/game_addrs.hpp"
"src/hook_mgr.cpp"
"src/hook_mgr.hpp"
"src/hooks_audio.cpp"
"src/hooks_bugfixes.cpp"
"src/hooks_drawdistance.cpp"
"src/hooks_exceptions.cpp"
"src/hooks_flac.cpp"
"src/hooks_forcefeedback.cpp"
"src/hooks_framerate.cpp"
"src/hooks_graphics.cpp"
"src/hooks_input.cpp"
"src/hooks_misc.cpp"
"src/hooks_textures.cpp"
"src/hooks_uiscaling.cpp"
"src/input_manager.cpp"
"src/network.cpp"
"src/overlay/chatroom.cpp"
"src/overlay/course_editor.cpp"
"src/overlay/hooks_overlay.cpp"
"src/overlay/notifications.hpp"
"src/overlay/overlay.cpp"
"src/overlay/overlay.hpp"
"src/overlay/server_notifications.cpp"
"src/overlay/update_check.cpp"
"src/plugin.hpp"
"src/resource.h"
)
add_library(outrun2006tweaks SHARED)
target_sources(outrun2006tweaks PRIVATE ${outrun2006tweaks_SOURCES})
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${outrun2006tweaks_SOURCES})
target_compile_definitions(outrun2006tweaks PUBLIC
_SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING
_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR
DIRECTINPUT_VERSION=0x0800
)
target_compile_features(outrun2006tweaks PUBLIC
cxx_std_20
)
target_compile_options(outrun2006tweaks PUBLIC
"/GS-"
"/bigobj"
"/EHa"
"/MP"
)
target_include_directories(outrun2006tweaks PUBLIC
"shared/"
"src/"
"include/"
"external/ModUtils/"
"external/ini-cpp/ini/"
"external/xxHash/"
"external/miniz/"
"external/imgui/"
"external/IXWebSocket/"
)
target_link_libraries(outrun2006tweaks PUBLIC
spdlog
safetyhook
ogg
FLAC
jsoncpp_static
version.lib
xinput9_1_0.lib
Hid.lib
libminiupnpc-static
SDL3-static
Winmm.lib
Setupapi.lib
Crypt32.lib
)
target_link_options(outrun2006tweaks PUBLIC
"/DEBUG"
"/OPT:REF"
"/OPT:ICF"
)
set_target_properties(outrun2006tweaks PROPERTIES
OUTPUT_NAME
dinput8
SUFFIX
.dll
RUNTIME_OUTPUT_DIRECTORY_RELEASE
"${CMAKE_BINARY_DIR}/bin/${CMKR_TARGET}"
RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO
"${CMAKE_BINARY_DIR}/bin/${CMKR_TARGET}"
LIBRARY_OUTPUT_DIRECTORY_RELEASE
"${CMAKE_BINARY_DIR}/lib/${CMKR_TARGET}"
LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO
"${CMAKE_BINARY_DIR}/lib/${CMKR_TARGET}"
ARCHIVE_OUTPUT_DIRECTORY_RELEASE
"${CMAKE_BINARY_DIR}/lib/${CMKR_TARGET}"
ARCHIVE_OUTPUT_DIRECTORY_RELWITHDEBINFO
"${CMAKE_BINARY_DIR}/lib/${CMKR_TARGET}"
)