forked from Clownacy/clowndoom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
202 lines (185 loc) · 5.47 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
cmake_minimum_required(VERSION 3.19)
project(zyndoom LANGUAGES C)
option(WILDMIDI "Render MIDI using the WildMIDI library" ON)
option(FRENCH "Change the language of various strings to French" OFF)
add_executable(zyndoom WIN32
"linuxdoom-1.10/clownlibs/clowncommon/clowncommon.h"
"linuxdoom-1.10/clownlibs/dictionary.c"
"linuxdoom-1.10/clownlibs/dictionary.h"
"linuxdoom-1.10/am_map.c"
"linuxdoom-1.10/am_map.h"
"linuxdoom-1.10/d_englsh.h"
"linuxdoom-1.10/d_event.h"
"linuxdoom-1.10/d_french.h"
"linuxdoom-1.10/d_items.c"
"linuxdoom-1.10/d_items.h"
"linuxdoom-1.10/d_main.c"
"linuxdoom-1.10/d_main.h"
"linuxdoom-1.10/d_net.c"
"linuxdoom-1.10/d_net.h"
"linuxdoom-1.10/doomdata.h"
"linuxdoom-1.10/doomdef.c"
"linuxdoom-1.10/doomdef.h"
"linuxdoom-1.10/doomstat.c"
"linuxdoom-1.10/doomstat.h"
"linuxdoom-1.10/doomtype.h"
"linuxdoom-1.10/d_player.h"
"linuxdoom-1.10/dstrings.h"
"linuxdoom-1.10/d_textur.h"
"linuxdoom-1.10/d_think.h"
"linuxdoom-1.10/d_ticcmd.h"
"linuxdoom-1.10/f_finale.c"
"linuxdoom-1.10/f_finale.h"
"linuxdoom-1.10/f_wipe.c"
"linuxdoom-1.10/f_wipe.h"
"linuxdoom-1.10/g_game.c"
"linuxdoom-1.10/g_game.h"
"linuxdoom-1.10/hu_lib.c"
"linuxdoom-1.10/hu_lib.h"
"linuxdoom-1.10/hu_stuff.c"
"linuxdoom-1.10/hu_stuff.h"
"linuxdoom-1.10/ib_sound.h"
"linuxdoom-1.10/ib_system.h"
"linuxdoom-1.10/ib_video.h"
"linuxdoom-1.10/i_main.c"
"linuxdoom-1.10/i_net.c"
"linuxdoom-1.10/i_net.h"
"linuxdoom-1.10/info.c"
"linuxdoom-1.10/info.h"
"linuxdoom-1.10/i_sound.c"
"linuxdoom-1.10/i_sound.h"
"linuxdoom-1.10/i_system.c"
"linuxdoom-1.10/i_system.h"
"linuxdoom-1.10/i_video.c"
"linuxdoom-1.10/i_video.h"
"linuxdoom-1.10/m_argv.c"
"linuxdoom-1.10/m_argv.h"
"linuxdoom-1.10/m_bbox.c"
"linuxdoom-1.10/m_bbox.h"
"linuxdoom-1.10/m_cheat.c"
"linuxdoom-1.10/m_cheat.h"
"linuxdoom-1.10/m_fixed.c"
"linuxdoom-1.10/m_fixed.h"
"linuxdoom-1.10/m_menu.c"
"linuxdoom-1.10/m_menu.h"
"linuxdoom-1.10/m_misc.c"
"linuxdoom-1.10/m_misc.h"
"linuxdoom-1.10/m_random.c"
"linuxdoom-1.10/m_random.h"
"linuxdoom-1.10/m_swap.h"
"linuxdoom-1.10/p_ceilng.c"
"linuxdoom-1.10/p_doors.c"
"linuxdoom-1.10/p_enemy.c"
"linuxdoom-1.10/p_floor.c"
"linuxdoom-1.10/p_inter.c"
"linuxdoom-1.10/p_inter.h"
"linuxdoom-1.10/p_lights.c"
"linuxdoom-1.10/p_local.h"
"linuxdoom-1.10/p_map.c"
"linuxdoom-1.10/p_maputl.c"
"linuxdoom-1.10/p_mobj.c"
"linuxdoom-1.10/p_mobj.h"
"linuxdoom-1.10/p_plats.c"
"linuxdoom-1.10/p_pspr.c"
"linuxdoom-1.10/p_pspr.h"
"linuxdoom-1.10/p_saveg.c"
"linuxdoom-1.10/p_saveg.h"
"linuxdoom-1.10/p_setup.c"
"linuxdoom-1.10/p_setup.h"
"linuxdoom-1.10/p_sight.c"
"linuxdoom-1.10/p_spec.c"
"linuxdoom-1.10/p_spec.h"
"linuxdoom-1.10/p_switch.c"
"linuxdoom-1.10/p_telept.c"
"linuxdoom-1.10/p_tick.c"
"linuxdoom-1.10/p_tick.h"
"linuxdoom-1.10/p_user.c"
"linuxdoom-1.10/r_bsp.c"
"linuxdoom-1.10/r_bsp.h"
"linuxdoom-1.10/r_data.c"
"linuxdoom-1.10/r_data.h"
"linuxdoom-1.10/r_defs.h"
"linuxdoom-1.10/r_draw.c"
"linuxdoom-1.10/r_draw.h"
"linuxdoom-1.10/r_local.h"
"linuxdoom-1.10/r_main.c"
"linuxdoom-1.10/r_main.h"
"linuxdoom-1.10/r_plane.c"
"linuxdoom-1.10/r_plane.h"
"linuxdoom-1.10/r_segs.c"
"linuxdoom-1.10/r_segs.h"
"linuxdoom-1.10/r_sky.c"
"linuxdoom-1.10/r_sky.h"
"linuxdoom-1.10/r_state.h"
"linuxdoom-1.10/r_things.c"
"linuxdoom-1.10/r_things.h"
"linuxdoom-1.10/sounds.c"
"linuxdoom-1.10/sounds.h"
"linuxdoom-1.10/s_sound.c"
"linuxdoom-1.10/s_sound.h"
"linuxdoom-1.10/st_lib.c"
"linuxdoom-1.10/st_lib.h"
"linuxdoom-1.10/st_stuff.c"
"linuxdoom-1.10/st_stuff.h"
"linuxdoom-1.10/tables.c"
"linuxdoom-1.10/tables.h"
"linuxdoom-1.10/v_video.c"
"linuxdoom-1.10/v_video.h"
"linuxdoom-1.10/wi_stuff.c"
"linuxdoom-1.10/wi_stuff.h"
"linuxdoom-1.10/w_wad.c"
"linuxdoom-1.10/w_wad.h"
"linuxdoom-1.10/z_zone.c"
"linuxdoom-1.10/z_zone.h"
)
set_target_properties(zyndoom PROPERTIES C_STANDARD 90)
if(CMAKE_C_BYTE_ORDER STREQUAL "BIG_ENDIAN")
target_compile_definitions(zyndoom PRIVATE PLATFORM_IS_BIG_ENDIAN)
target_sources(zyndoom "linuxdoom-1.10/m_swap.c")
endif()
if(WIN32)
target_link_libraries(zyndoom PRIVATE ws2_32)
endif()
if(FRENCH)
target_compile_definitions(zyndoom PRIVATE FRENCH)
endif()
if(NOT MSVC)
target_link_libraries(zyndoom PRIVATE m)
endif()
# Handling linking/building WildMIDI
if(WILDMIDI)
target_compile_definitions(zyndoom PRIVATE WILDMIDI)
find_package(WildMidi)
if(WildMidi_FOUND)
target_link_libraries(zyndoom PRIVATE WildMidi::libwildmidi)
else()
# Set and hide these internal options
set(WANT_ALSA OFF CACHE INTERNAL "" FORCE)
set(WANT_DEVTEST OFF CACHE INTERNAL "" FORCE)
set(WANT_OPENAL OFF CACHE INTERNAL "" FORCE)
set(WANT_OSS OFF CACHE INTERNAL "" FORCE)
set(WANT_OSX_DEPLOYMENT OFF CACHE INTERNAL "" FORCE)
set(WANT_STATIC ON CACHE INTERNAL "" FORCE)
add_subdirectory("external/wildmidi" EXCLUDE_FROM_ALL SYSTEM)
target_compile_options(libwildmidi-static PRIVATE "-w")
target_link_libraries(zyndoom PRIVATE libwildmidi-static)
endif()
endif()
target_sources(zyndoom PRIVATE
"linuxdoom-1.10/ib_sound/sdl.c"
"linuxdoom-1.10/ib_system/sdl.c"
"linuxdoom-1.10/ib_video/sdl.c"
)
find_package(SDL2)
if(NOT SDL2_FOUND)
set(SDL_STATIC ON CACHE INTERNAL "" FORCE)
add_subdirectory("external/SDL" EXCLUDE_FROM_ALL SYSTEM)
if(SDL_STATIC)
target_link_libraries(zyndoom PRIVATE SDL2::SDL2main SDL2::SDL2-static)
else()
target_link_libraries(zyndoom PRIVATE SDL2::SDL2main SDL2::SDL2)
endif()
else()
target_link_libraries(zyndoom PRIVATE SDL2::SDL2main SDL2::SDL2)
endif()
target_compile_definitions(zyndoom PRIVATE INCLUDE_SDL2_MAIN)