Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-1-2-2013-Decompilation
Path: blob/main/CMakeLists.txt
817 views
1
cmake_minimum_required(VERSION 3.10)
2
3
project(RetroEngine)
4
5
set(DECOMP_VERSION 1.3.3)
6
7
set(RETRO_REVISION 3 CACHE STRING "What revision to compile for. Defaults to Origins = 3")
8
option(RETRO_FORCE_CASE_INSENSITIVE "Forces case insensivity." OFF)
9
option(RETRO_MOD_LOADER "Enables or disables the mod loader." ON)
10
option(RETRO_NETWORKING "Enables or disables networking features used for Sonic 2's 2P VS mode." ON)
11
option(RETRO_USE_HW_RENDER "Enables usage of the Hardware Render, menus are unplayable without it." ON)
12
option(RETRO_DISABLE_PLUS "Disables Plus. Should be set on for any public releases." OFF)
13
option(RETRO_ORIGINAL_CODE "Removes any change that differs from the original code, a playable game can't be built this way." OFF)
14
15
set(RETRO_SDL_VERSION 2 CACHE STRING "Select between SDL2 and SDL1, defaults to SDL2")
16
17
if(RETRO_ORIGINAL_CODE)
18
set(RETRO_MOD_LOADER OFF)
19
set(RETRO_NETWORKING OFF)
20
endif()
21
22
set(RETRO_NAME "RSDKv4")
23
24
set(RETRO_OUTPUT_NAME ${RETRO_NAME} CACHE STRING "The exported name of the executable.")
25
26
set(RETRO_FILES
27
dependencies/all/tinyxml2/tinyxml2.cpp
28
RSDKv4/Animation.cpp
29
RSDKv4/Audio.cpp
30
RSDKv4/Collision.cpp
31
RSDKv4/Debug.cpp
32
RSDKv4/Drawing.cpp
33
RSDKv4/Ini.cpp
34
RSDKv4/Input.cpp
35
RSDKv4/fcaseopen.c
36
RSDKv4/main.cpp
37
RSDKv4/Math.cpp
38
RSDKv4/ModAPI.cpp
39
RSDKv4/Networking.cpp
40
RSDKv4/Object.cpp
41
RSDKv4/Palette.cpp
42
RSDKv4/Reader.cpp
43
RSDKv4/Renderer.cpp
44
RSDKv4/RetroEngine.cpp
45
RSDKv4/Scene.cpp
46
RSDKv4/Scene3D.cpp
47
RSDKv4/Script.cpp
48
RSDKv4/Sprite.cpp
49
RSDKv4/String.cpp
50
RSDKv4/Text.cpp
51
RSDKv4/Userdata.cpp
52
RSDKv4/NativeObjects/AboutScreen.cpp
53
RSDKv4/NativeObjects/AchievementDisplay.cpp
54
RSDKv4/NativeObjects/AchievementsButton.cpp
55
RSDKv4/NativeObjects/AchievementsMenu.cpp
56
RSDKv4/NativeObjects/BackButton.cpp
57
RSDKv4/NativeObjects/CWSplash.cpp
58
RSDKv4/NativeObjects/CreditText.cpp
59
RSDKv4/NativeObjects/DialogPanel.cpp
60
RSDKv4/NativeObjects/FadeScreen.cpp
61
RSDKv4/NativeObjects/InstructionsScreen.cpp
62
RSDKv4/NativeObjects/LeaderboardsButton.cpp
63
RSDKv4/NativeObjects/MenuBG.cpp
64
RSDKv4/NativeObjects/MenuControl.cpp
65
RSDKv4/NativeObjects/ModInfoButton.cpp
66
RSDKv4/NativeObjects/ModsButton.cpp
67
RSDKv4/NativeObjects/ModsMenu.cpp
68
RSDKv4/NativeObjects/MultiplayerButton.cpp
69
RSDKv4/NativeObjects/MultiplayerHandler.cpp
70
RSDKv4/NativeObjects/MultiplayerScreen.cpp
71
RSDKv4/NativeObjects/OptionsButton.cpp
72
RSDKv4/NativeObjects/OptionsMenu.cpp
73
RSDKv4/NativeObjects/PauseMenu.cpp
74
RSDKv4/NativeObjects/PlayerSelectScreen.cpp
75
RSDKv4/NativeObjects/PushButton.cpp
76
RSDKv4/NativeObjects/RecordsScreen.cpp
77
RSDKv4/NativeObjects/RetroGameLoop.cpp
78
RSDKv4/NativeObjects/SaveSelect.cpp
79
RSDKv4/NativeObjects/SegaIDButton.cpp
80
RSDKv4/NativeObjects/SegaSplash.cpp
81
RSDKv4/NativeObjects/SettingsScreen.cpp
82
RSDKv4/NativeObjects/StaffCredits.cpp
83
RSDKv4/NativeObjects/StartGameButton.cpp
84
RSDKv4/NativeObjects/SubMenuButton.cpp
85
RSDKv4/NativeObjects/TextLabel.cpp
86
RSDKv4/NativeObjects/TimeAttack.cpp
87
RSDKv4/NativeObjects/TimeAttackButton.cpp
88
RSDKv4/NativeObjects/TitleScreen.cpp
89
RSDKv4/NativeObjects/VirtualDPad.cpp
90
RSDKv4/NativeObjects/VirtualDPadM.cpp
91
RSDKv4/NativeObjects/ZoneButton.cpp
92
)
93
94
if(NOT PLATFORM)
95
if(WIN32) # THIS ASSUMES VCPKG OR SOURCES !!!!!!!
96
set(PLATFORM "Windows" CACHE STRING "The platform to compile for.")
97
elseif(ANDROID)
98
set(PLATFORM "Android" CACHE STRING "The platform to compile for.")
99
else()
100
set(PLATFORM ${CMAKE_SYSTEM_NAME} CACHE STRING "The platform to compile for.")
101
endif()
102
endif()
103
104
include(platforms/${PLATFORM}.cmake)
105
106
set_target_properties(RetroEngine PROPERTIES OUTPUT_NAME ${RETRO_OUTPUT_NAME})
107
108
if(COMPILE_OGG)
109
set(OGG_DIR dependencies/${DEP_PATH}/libogg)
110
add_library(
111
libogg
112
STATIC
113
${OGG_DIR}/src/bitwise.c
114
${OGG_DIR}/src/framing.c
115
)
116
117
target_compile_options(libogg PRIVATE ${OGG_FLAGS})
118
119
target_include_directories(libogg PRIVATE ${OGG_DIR}/include)
120
target_include_directories(RetroEngine PRIVATE ${OGG_DIR}/include)
121
target_link_libraries(RetroEngine libogg)
122
endif()
123
124
if(COMPILE_VORBIS)
125
set(VORBIS_DIR dependencies/${DEP_PATH}/libvorbis)
126
set(OGG_DIR dependencies/${DEP_PATH}/libogg)
127
add_library(libvorbis STATIC
128
${VORBIS_DIR}/lib/analysis.c
129
${VORBIS_DIR}/lib/barkmel.c
130
${VORBIS_DIR}/lib/bitrate.c
131
${VORBIS_DIR}/lib/block.c
132
${VORBIS_DIR}/lib/codebook.c
133
${VORBIS_DIR}/lib/envelope.c
134
${VORBIS_DIR}/lib/floor0.c
135
${VORBIS_DIR}/lib/floor1.c
136
${VORBIS_DIR}/lib/info.c
137
${VORBIS_DIR}/lib/lookup.c
138
${VORBIS_DIR}/lib/lpc.c
139
${VORBIS_DIR}/lib/lsp.c
140
${VORBIS_DIR}/lib/mapping0.c
141
${VORBIS_DIR}/lib/mdct.c
142
${VORBIS_DIR}/lib/psy.c
143
${VORBIS_DIR}/lib/registry.c
144
${VORBIS_DIR}/lib/res0.c
145
${VORBIS_DIR}/lib/sharedbook.c
146
${VORBIS_DIR}/lib/smallft.c
147
${VORBIS_DIR}/lib/synthesis.c
148
${VORBIS_DIR}/lib/tone.c
149
${VORBIS_DIR}/lib/vorbisenc.c
150
${VORBIS_DIR}/lib/vorbisfile.c
151
${VORBIS_DIR}/lib/window.c
152
)
153
154
target_compile_options(libvorbis PRIVATE ${VORBIS_FLAGS})
155
156
target_include_directories(libvorbis
157
PRIVATE
158
${VORBIS_DIR}/include
159
${VORBIS_DIR}/lib
160
${OGG_DIR}/include
161
)
162
target_include_directories(RetroEngine PRIVATE ${VORBIS_DIR}/include)
163
target_link_libraries(RetroEngine libvorbis libogg)
164
endif()
165
166
target_include_directories(RetroEngine PRIVATE
167
RSDKv4/
168
RSDKv4/NativeObjects/
169
dependencies/all/stb-image/
170
dependencies/all/tinyxml2/
171
)
172
173
if(RETRO_NETWORKING)
174
target_include_directories(RetroEngine PRIVATE
175
dependencies/all/asio/asio/include/
176
)
177
endif()
178
179
if(DEFINED DEP_PATH)
180
target_include_directories(RetroEngine PRIVATE
181
dependencies/${DEP_PATH}/
182
)
183
endif()
184
185
186
target_compile_definitions(RetroEngine PRIVATE
187
RSDK_REVISION=${RETRO_REVISION}
188
RETRO_USE_MOD_LOADER=$<BOOL:${RETRO_MOD_LOADER}>
189
RETRO_USE_NETWORKING=$<BOOL:${RETRO_NETWORKING}>
190
RETRO_USING_OPENGL=$<BOOL:${RETRO_USE_HW_RENDER}>
191
RETRO_USE_SDL${RETRO_SDL_VERSION}=1
192
FORCE_CASE_INSENSITIVE=$<BOOL:${RETRO_FORCE_CASE_INSENSITIVE}>
193
RETRO_USE_ORIGINAL_CODE=$<BOOL:${RETRO_ORIGINAL_CODE}>
194
195
RSDK_AUTOBUILD=$<BOOL:${RETRO_DISABLE_PLUS}>
196
197
RETRO_DEV_EXTRA="${PLATFORM} - ${CMAKE_CXX_COMPILER_ID}"
198
DECOMP_VERSION="${DECOMP_VERSION}"
199
)
200