forked from RSDKModding/RSDKv4-Decompilation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
199 lines (175 loc) · 6.41 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
cmake_minimum_required(VERSION 3.7)
project(RetroEngine)
set(DECOMP_VERSION 1.3.2)
set(RETRO_REVISION 3 CACHE STRING "What revision to compile for. Defaults to Origins = 3")
option(RETRO_FORCE_CASE_INSENSITIVE "Forces case insensivity." OFF)
option(RETRO_MOD_LOADER "Enables or disables the mod loader." ON)
option(RETRO_NETWORKING "Enables or disables networking features used for Sonic 2's 2P VS mode." ON)
option(RETRO_USE_HW_RENDER "Enables usage of the Hardware Render, menus are unplayable without it." ON)
option(RETRO_DISABLE_PLUS "Disables Plus. Should be set on for any public releases." OFF)
option(RETRO_ORIGINAL_CODE "Removes any change that differs from the original code, a playable game can't be built this way." OFF)
set(RETRO_SDL_VERSION 2 CACHE STRING "Select between SDL2 and SDL1, defaults to SDL2")
if(RETRO_ORIGINAL_CODE)
set(RETRO_MOD_LOADER OFF)
set(RETRO_NETWORKING OFF)
endif()
set(RETRO_NAME "RSDKv4")
set(RETRO_OUTPUT_NAME ${RETRO_NAME} CACHE STRING "The exported name of the executable.")
set(RETRO_FILES
dependencies/all/tinyxml2/tinyxml2.cpp
RSDKv4/Animation.cpp
RSDKv4/Audio.cpp
RSDKv4/Collision.cpp
RSDKv4/Debug.cpp
RSDKv4/Drawing.cpp
RSDKv4/Ini.cpp
RSDKv4/Input.cpp
RSDKv4/fcaseopen.c
RSDKv4/main.cpp
RSDKv4/Math.cpp
RSDKv4/ModAPI.cpp
RSDKv4/Networking.cpp
RSDKv4/Object.cpp
RSDKv4/Palette.cpp
RSDKv4/Reader.cpp
RSDKv4/Renderer.cpp
RSDKv4/RetroEngine.cpp
RSDKv4/Scene.cpp
RSDKv4/Scene3D.cpp
RSDKv4/Script.cpp
RSDKv4/Sprite.cpp
RSDKv4/String.cpp
RSDKv4/Text.cpp
RSDKv4/Userdata.cpp
RSDKv4/NativeObjects/AboutScreen.cpp
RSDKv4/NativeObjects/AchievementDisplay.cpp
RSDKv4/NativeObjects/AchievementsButton.cpp
RSDKv4/NativeObjects/AchievementsMenu.cpp
RSDKv4/NativeObjects/BackButton.cpp
RSDKv4/NativeObjects/CWSplash.cpp
RSDKv4/NativeObjects/CreditText.cpp
RSDKv4/NativeObjects/DialogPanel.cpp
RSDKv4/NativeObjects/FadeScreen.cpp
RSDKv4/NativeObjects/InstructionsScreen.cpp
RSDKv4/NativeObjects/LeaderboardsButton.cpp
RSDKv4/NativeObjects/MenuBG.cpp
RSDKv4/NativeObjects/MenuControl.cpp
RSDKv4/NativeObjects/ModInfoButton.cpp
RSDKv4/NativeObjects/ModsButton.cpp
RSDKv4/NativeObjects/ModsMenu.cpp
RSDKv4/NativeObjects/MultiplayerButton.cpp
RSDKv4/NativeObjects/MultiplayerHandler.cpp
RSDKv4/NativeObjects/MultiplayerScreen.cpp
RSDKv4/NativeObjects/OptionsButton.cpp
RSDKv4/NativeObjects/OptionsMenu.cpp
RSDKv4/NativeObjects/PauseMenu.cpp
RSDKv4/NativeObjects/PlayerSelectScreen.cpp
RSDKv4/NativeObjects/PushButton.cpp
RSDKv4/NativeObjects/RecordsScreen.cpp
RSDKv4/NativeObjects/RetroGameLoop.cpp
RSDKv4/NativeObjects/SaveSelect.cpp
RSDKv4/NativeObjects/SegaIDButton.cpp
RSDKv4/NativeObjects/SegaSplash.cpp
RSDKv4/NativeObjects/SettingsScreen.cpp
RSDKv4/NativeObjects/StaffCredits.cpp
RSDKv4/NativeObjects/StartGameButton.cpp
RSDKv4/NativeObjects/SubMenuButton.cpp
RSDKv4/NativeObjects/TextLabel.cpp
RSDKv4/NativeObjects/TimeAttack.cpp
RSDKv4/NativeObjects/TimeAttackButton.cpp
RSDKv4/NativeObjects/TitleScreen.cpp
RSDKv4/NativeObjects/VirtualDPad.cpp
RSDKv4/NativeObjects/VirtualDPadM.cpp
RSDKv4/NativeObjects/ZoneButton.cpp
)
if(NOT PLATFORM)
if(WIN32) # THIS ASSUMES VCPKG OR SOURCES !!!!!!!
set(PLATFORM "Windows" CACHE STRING "The platform to compile for.")
elseif(ANDROID)
set(PLATFORM "Android" CACHE STRING "The platform to compile for.")
else()
set(PLATFORM ${CMAKE_SYSTEM_NAME} CACHE STRING "The platform to compile for.")
endif()
endif()
include(platforms/${PLATFORM}.cmake)
set_target_properties(RetroEngine PROPERTIES OUTPUT_NAME ${RETRO_OUTPUT_NAME})
if(COMPILE_OGG)
set(OGG_DIR dependencies/${DEP_PATH}/libogg)
add_library(
libogg
STATIC
${OGG_DIR}/src/bitwise.c
${OGG_DIR}/src/framing.c
)
target_compile_options(libogg PRIVATE ${OGG_FLAGS})
target_include_directories(libogg PRIVATE ${OGG_DIR}/include)
target_include_directories(RetroEngine PRIVATE ${OGG_DIR}/include)
target_link_libraries(RetroEngine libogg)
endif()
if(COMPILE_VORBIS)
set(VORBIS_DIR dependencies/${DEP_PATH}/libvorbis)
set(OGG_DIR dependencies/${DEP_PATH}/libogg)
add_library(libvorbis STATIC
${VORBIS_DIR}/lib/analysis.c
${VORBIS_DIR}/lib/barkmel.c
${VORBIS_DIR}/lib/bitrate.c
${VORBIS_DIR}/lib/block.c
${VORBIS_DIR}/lib/codebook.c
${VORBIS_DIR}/lib/envelope.c
${VORBIS_DIR}/lib/floor0.c
${VORBIS_DIR}/lib/floor1.c
${VORBIS_DIR}/lib/info.c
${VORBIS_DIR}/lib/lookup.c
${VORBIS_DIR}/lib/lpc.c
${VORBIS_DIR}/lib/lsp.c
${VORBIS_DIR}/lib/mapping0.c
${VORBIS_DIR}/lib/mdct.c
${VORBIS_DIR}/lib/psy.c
${VORBIS_DIR}/lib/registry.c
${VORBIS_DIR}/lib/res0.c
${VORBIS_DIR}/lib/sharedbook.c
${VORBIS_DIR}/lib/smallft.c
${VORBIS_DIR}/lib/synthesis.c
${VORBIS_DIR}/lib/tone.c
${VORBIS_DIR}/lib/vorbisenc.c
${VORBIS_DIR}/lib/vorbisfile.c
${VORBIS_DIR}/lib/window.c
)
target_compile_options(libvorbis PRIVATE ${VORBIS_FLAGS})
target_include_directories(libvorbis
PRIVATE
${VORBIS_DIR}/include
${VORBIS_DIR}/lib
${OGG_DIR}/include
)
target_include_directories(RetroEngine PRIVATE ${VORBIS_DIR}/include)
target_link_libraries(RetroEngine libvorbis libogg)
endif()
target_include_directories(RetroEngine PRIVATE
RSDKv4/
RSDKv4/NativeObjects/
dependencies/all/stb-image/
dependencies/all/tinyxml2/
)
if(RETRO_NETWORKING)
target_include_directories(RetroEngine PRIVATE
dependencies/all/asio/asio/include/
)
endif()
if(DEFINED DEP_PATH)
target_include_directories(RetroEngine PRIVATE
dependencies/${DEP_PATH}/
)
endif()
target_compile_definitions(RetroEngine PRIVATE
RSDK_REVISION=${RETRO_REVISION}
RETRO_USE_MOD_LOADER=$<BOOL:${RETRO_MOD_LOADER}>
RETRO_USE_NETWORKING=$<BOOL:${RETRO_NETWORKING}>
RETRO_USING_OPENGL=$<BOOL:${RETRO_USE_HW_RENDER}>
RETRO_USE_SDL${RETRO_SDL_VERSION}=1
FORCE_CASE_INSENSITIVE=$<BOOL:${RETRO_FORCE_CASE_INSENSITIVE}>
RETRO_USE_ORIGINAL_CODE=$<BOOL:${RETRO_ORIGINAL_CODE}>
RSDK_AUTOBUILD=$<BOOL:${RETRO_DISABLE_PLUS}>
RETRO_DEV_EXTRA="${PLATFORM} - ${CMAKE_CXX_COMPILER_ID}"
DECOMP_VERSION="${DECOMP_VERSION}"
)