Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Rubberduckycooly
GitHub Repository: Rubberduckycooly/RSDKv5-Decompilation
Path: blob/master/CMakeLists.txt
769 views
1
cmake_minimum_required(VERSION 3.7)
2
3
project(RetroEngine)
4
5
set(DECOMP_VERSION 1.1.0-a)
6
7
set(RETRO_REVISION 3 CACHE STRING "What revision to compile for. Defaults to v5U = 3")
8
option(RETRO_DISABLE_PLUS "Disable plus. Should be set on for any public releases." OFF)
9
10
option(RETRO_MOD_LOADER "Enables or disables the mod loader." ON)
11
set(RETRO_MOD_LOADER_VER 2 CACHE STRING "Sets the mod loader version. Defaults to latest")
12
13
option(RETRO_DISABLE_LOG "Disables the log. Defaults to OFF." OFF)
14
15
set(RETRO_NAME "RSDKv5")
16
17
if(RETRO_REVISION STREQUAL "3")
18
set(RETRO_NAME "RSDKv5U")
19
endif()
20
21
set(RETRO_OUTPUT_NAME ${RETRO_NAME} CACHE STRING "The exported name of the executable.")
22
23
set(RETRO_FILES
24
RSDKv5/main.cpp
25
RSDKv5/RSDK/Core/RetroEngine.cpp
26
RSDKv5/RSDK/Core/Math.cpp
27
RSDKv5/RSDK/Core/Reader.cpp
28
RSDKv5/RSDK/Core/Link.cpp
29
RSDKv5/RSDK/Core/ModAPI.cpp
30
RSDKv5/RSDK/Dev/Debug.cpp
31
RSDKv5/RSDK/Storage/Storage.cpp
32
RSDKv5/RSDK/Storage/Text.cpp
33
RSDKv5/RSDK/Graphics/Drawing.cpp
34
RSDKv5/RSDK/Graphics/Scene3D.cpp
35
RSDKv5/RSDK/Graphics/Animation.cpp
36
RSDKv5/RSDK/Graphics/Sprite.cpp
37
RSDKv5/RSDK/Graphics/Palette.cpp
38
RSDKv5/RSDK/Graphics/Video.cpp
39
RSDKv5/RSDK/Audio/Audio.cpp
40
RSDKv5/RSDK/Input/Input.cpp
41
RSDKv5/RSDK/Scene/Scene.cpp
42
RSDKv5/RSDK/Scene/Collision.cpp
43
RSDKv5/RSDK/Scene/Object.cpp
44
RSDKv5/RSDK/Scene/Objects/DefaultObject.cpp
45
RSDKv5/RSDK/Scene/Objects/DevOutput.cpp
46
RSDKv5/RSDK/User/Core/UserAchievements.cpp
47
RSDKv5/RSDK/User/Core/UserCore.cpp
48
RSDKv5/RSDK/User/Core/UserLeaderboards.cpp
49
RSDKv5/RSDK/User/Core/UserPresence.cpp
50
RSDKv5/RSDK/User/Core/UserStats.cpp
51
RSDKv5/RSDK/User/Core/UserStorage.cpp
52
dependencies/all/tinyxml2/tinyxml2.cpp
53
dependencies/all/iniparser/iniparser.cpp
54
dependencies/all/iniparser/dictionary.cpp
55
dependencies/all/miniz/miniz.c
56
)
57
58
if(NOT PLATFORM)
59
if(WIN32) # THIS ASSUMES VCPKG OR SOURCES !!!!!!!
60
set(PLATFORM "Windows" CACHE STRING "The platform to compile for.")
61
elseif(ANDROID)
62
set(PLATFORM "Android" CACHE STRING "The platform to compile for.")
63
else()
64
set(PLATFORM ${CMAKE_SYSTEM_NAME} CACHE STRING "The platform to compile for.")
65
endif()
66
endif()
67
68
include(platforms/${PLATFORM}.cmake)
69
70
# Set C++ standard after including the platform file since they could override mod loader support
71
# which relies on C++17. Otherwise the engine is mostly C++11.
72
if(RETRO_MOD_LOADER)
73
set_target_properties(RetroEngine PROPERTIES CXX_STANDARD 17 CXX_STANDARD_REQUIRED ON)
74
else()
75
set_target_properties(RetroEngine PROPERTIES CXX_STANDARD 11 CXX_STANDARD_REQUIRED ON)
76
endif()
77
78
set_target_properties(RetroEngine PROPERTIES OUTPUT_NAME ${RETRO_OUTPUT_NAME})
79
80
if(COMPILE_OGG)
81
set(OGG_DIR dependencies/${DEP_PATH}/libogg)
82
add_library(
83
libogg
84
STATIC
85
${OGG_DIR}/src/bitwise.c
86
${OGG_DIR}/src/framing.c
87
)
88
89
target_compile_options(libogg PRIVATE ${OGG_FLAGS})
90
91
target_include_directories(libogg PRIVATE ${OGG_DIR}/include)
92
target_include_directories(RetroEngine PRIVATE ${OGG_DIR}/include)
93
target_link_libraries(RetroEngine libogg)
94
endif()
95
96
if(COMPILE_THEORA)
97
set(THEORA_DIR dependencies/android/libtheora)
98
99
add_library(libtheora STATIC
100
${THEORA_DIR}/lib/analyze.c
101
${THEORA_DIR}/lib/apiwrapper.c
102
${THEORA_DIR}/lib/bitpack.c
103
${THEORA_DIR}/lib/cpu.c
104
${THEORA_DIR}/lib/decapiwrapper.c
105
${THEORA_DIR}/lib/decinfo.c
106
${THEORA_DIR}/lib/decode.c
107
${THEORA_DIR}/lib/dequant.c
108
${THEORA_DIR}/lib/encapiwrapper.c
109
${THEORA_DIR}/lib/encfrag.c
110
${THEORA_DIR}/lib/encinfo.c
111
${THEORA_DIR}/lib/encode.c
112
${THEORA_DIR}/lib/encoder_disabled.c
113
${THEORA_DIR}/lib/enquant.c
114
${THEORA_DIR}/lib/fdct.c
115
${THEORA_DIR}/lib/fragment.c
116
${THEORA_DIR}/lib/huffdec.c
117
${THEORA_DIR}/lib/huffenc.c
118
${THEORA_DIR}/lib/idct.c
119
${THEORA_DIR}/lib/info.c
120
${THEORA_DIR}/lib/internal.c
121
${THEORA_DIR}/lib/mathops.c
122
${THEORA_DIR}/lib/mcenc.c
123
${THEORA_DIR}/lib/quant.c
124
${THEORA_DIR}/lib/rate.c
125
${THEORA_DIR}/lib/state.c
126
${THEORA_DIR}/lib/tokenize.c
127
)
128
129
target_compile_options(libtheora PRIVATE ${THEORA_FLAGS})
130
131
target_include_directories(libtheora PRIVATE ${THEORA_DIR}/include ${OGG_DIR}/include)
132
target_include_directories(RetroEngine PRIVATE ${THEORA_DIR}/include)
133
target_link_libraries(RetroEngine libtheora)
134
endif()
135
136
target_include_directories(RetroEngine PRIVATE
137
RSDKv5/
138
dependencies/all/
139
dependencies/all/tinyxml2/
140
dependencies/all/iniparser/
141
)
142
143
if(DEFINED DEP_PATH)
144
target_include_directories(RetroEngine PRIVATE
145
dependencies/${DEP_PATH}/
146
)
147
endif()
148
149
if(NOT DEFINED GAME_STATIC)
150
set(GAME_STATIC OFF)
151
endif()
152
153
target_compile_definitions(RetroEngine PRIVATE
154
RETRO_REVISION=${RETRO_REVISION}
155
RSDK_USE_${RETRO_SUBSYSTEM}=1
156
157
RETRO_USE_MOD_LOADER=$<BOOL:${RETRO_MOD_LOADER}>
158
RETRO_MOD_LOADER_VER=${RETRO_MOD_LOADER_VER}
159
160
RETRO_STANDALONE=$<NOT:$<BOOL:${GAME_STATIC}>>
161
162
RSDK_AUTOBUILD=$<BOOL:${RETRO_DISABLE_PLUS}>
163
RETRO_DISABLE_LOG=$<BOOL:${RETRO_DISABLE_LOG}>
164
165
RETRO_DEV_EXTRA="${PLATFORM} - ${RETRO_SUBSYSTEM} - ${CMAKE_CXX_COMPILER_ID}"
166
DECOMP_VERSION="${DECOMP_VERSION}"
167
)
168
169
if(WITH_RSDK)
170
if(NOT GAME_STATIC)
171
add_custom_command(TARGET RetroEngine POST_BUILD
172
COMMAND ${CMAKE_COMMAND} -E copy_if_different
173
$<TARGET_FILE:${GAME_NAME}>
174
$<TARGET_FILE_DIR:RetroEngine>)
175
endif()
176
177
target_compile_definitions(${GAME_NAME} PRIVATE
178
RETRO_REVISION=${RETRO_REVISION}
179
180
RETRO_USE_MOD_LOADER=$<BOOL:${RETRO_MOD_LOADER}>
181
RETRO_MOD_LOADER_VER=${RETRO_MOD_LOADER_VER}
182
183
GAME_INCLUDE_EDITOR=$<BOOL:${GAME_INCLUDE_EDITOR}>
184
185
MANIA_PREPLUS=$<BOOL:${MANIA_PREPLUS}>
186
MANIA_FIRST_RELEASE=$<BOOL:${MANIA_FIRST_RELEASE}>
187
GAME_VERSION=${GAME_VERSION}
188
)
189
endif()
190