mirror of
https://github.com/kichikuou/xsystem35-sdl2.git
synced 2026-10-03 04:08:00 +03:00
Refactor CMakeLists.txt
This commit is contained in:
+3
-29
@@ -117,19 +117,12 @@ else() # non-emscripten, non-android
|
||||
find_library(PORTMIDI portmidi)
|
||||
if (PORTMIDI)
|
||||
set(HAVE_PORTMIDI 1)
|
||||
set(ENABLE_MIDI_PORTMIDI 1)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Menu
|
||||
|
||||
if (EMSCRIPTEN)
|
||||
set(SRC_MENU menu_emscripten.c)
|
||||
elseif (ANDROID)
|
||||
set(SRC_MENU menu_android.c)
|
||||
elseif (ENABLE_GTK)
|
||||
set(SRC_MENU menu.c menu_callback.c menu_gui.c s39init.c)
|
||||
|
||||
if (ENABLE_GTK)
|
||||
# i18n support (currently only menus are translated)
|
||||
include(FindIntl)
|
||||
include(FindGettext)
|
||||
@@ -139,44 +132,30 @@ elseif (ENABLE_GTK)
|
||||
include_directories(${Intl_INCLUDE_DIRS})
|
||||
link_libraries(${Intl_LIBRARIES})
|
||||
endif()
|
||||
else ()
|
||||
set(SRC_MENU menu_sdl.c sdl_input.c)
|
||||
endif()
|
||||
|
||||
# PCM audio
|
||||
|
||||
if (EMSCRIPTEN)
|
||||
list(APPEND SRC_AUDIO)
|
||||
list(APPEND SRC_AUDIO pcm.emscripten.c bgm.emscripten.c bgi.c)
|
||||
list(APPEND SUMMARY_AUDIO "Emscripten")
|
||||
elseif (SDL2MIXER_FOUND)
|
||||
list(APPEND SRC_AUDIO pcm.sdlmixer.c bgm.sdlmixer.c bgi.c)
|
||||
list(APPEND SUMMARY_AUDIO "SDL_mixer")
|
||||
set(ENABLE_SDLMIXER 1)
|
||||
else()
|
||||
list(APPEND SRC_AUDIO pcm.dummy.c bgm.dummy.c)
|
||||
endif()
|
||||
|
||||
# CDROM
|
||||
|
||||
list(APPEND SRC_CDROM cdrom.bgm.c)
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
list(APPEND SRC_CDROM cdrom.Linux.c)
|
||||
list(APPEND SUMMARY_CDROM "Linux ioctl")
|
||||
set(ENABLE_CDROM_LINUX 1)
|
||||
elseif (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
|
||||
list(APPEND SRC_CDROM cdrom.FreeBSD.c)
|
||||
list(APPEND SUMMARY_CDROM "*BSD ioctl")
|
||||
set(ENABLE_CDROM_BSD 1)
|
||||
elseif (CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
|
||||
list(APPEND SRC_CDROM cdrom.emscripten.c)
|
||||
list(APPEND SUMMARY_CDROM "Emscripten")
|
||||
set(ENABLE_CDROM_EMSCRIPTEN 1)
|
||||
else()
|
||||
list(APPEND SRC_CDROM cdrom.empty.c)
|
||||
endif()
|
||||
if (SDL2MIXER_FOUND)
|
||||
list(APPEND SRC_CDROM cdrom.mp3.c)
|
||||
list(APPEND SUMMARY_CDROM "SDL_mixer (wav|mp3|ogg...)")
|
||||
set(ENABLE_CDROM_MP3 1)
|
||||
endif()
|
||||
@@ -185,14 +164,11 @@ set(CDROM_DEVICE "playlist.txt" CACHE STRING "CDROM Device Name")
|
||||
# MIDI
|
||||
|
||||
if (EMSCRIPTEN)
|
||||
list(APPEND SRC_MIDI midi.emscripten.c)
|
||||
list(APPEND SUMMARY_MIDI "Emscripten")
|
||||
elseif (ANDROID)
|
||||
list(APPEND SRC_MIDI midi.android.c)
|
||||
list(APPEND SUMMARY_MIDI "Android")
|
||||
else()
|
||||
if (HAVE_SIGACTION)
|
||||
list(APPEND SRC_MIDI midi.rawmidi.c midifile.c)
|
||||
list(APPEND SUMMARY_MIDI "raw")
|
||||
set(MIDI_DEVICE "/dev/midi" CACHE STRING "midi device")
|
||||
set(ENABLE_MIDI_RAWMIDI 1)
|
||||
@@ -212,14 +188,13 @@ else()
|
||||
endif()
|
||||
|
||||
if (SDL2MIXER_FOUND)
|
||||
list(APPEND SRC_MIDI midi.sdlmixer.c)
|
||||
list(APPEND SUMMARY_MIDI "SDL_mixer")
|
||||
set(ENABLE_MIDI_SDLMIXER 1)
|
||||
endif()
|
||||
|
||||
if (HAVE_PORTMIDI AND ENABLE_MIDI_PORTMIDI)
|
||||
list(APPEND SRC_MIDI midi.portmidi.c)
|
||||
if (HAVE_PORTMIDI)
|
||||
list(APPEND SUMMARY_MIDI "PortMidi")
|
||||
set(ENABLE_MIDI_PORTMIDI 1)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -242,7 +217,6 @@ message("------------------")
|
||||
set(PACKAGE ${PROJECT_NAME})
|
||||
configure_file(config.h.in config.h)
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||
add_compile_definitions(HAVE_CONFIG_H)
|
||||
add_compile_definitions($<$<CONFIG:Debug>:DEBUG>)
|
||||
|
||||
add_subdirectory(src)
|
||||
|
||||
+114
-40
@@ -21,57 +21,131 @@ target_include_directories(xsystem35 PRIVATE .)
|
||||
target_link_libraries(xsystem35 PRIVATE src_lib)
|
||||
|
||||
target_sources(xsystem35 PRIVATE
|
||||
xsystem35.c
|
||||
dri.c
|
||||
ags.c
|
||||
ald_manager.c
|
||||
alpha_plane.c
|
||||
bmp.c
|
||||
cache.c
|
||||
${SRC_AUDIO}
|
||||
${SRC_CDROM}
|
||||
${SRC_MIDI}
|
||||
${SRC_MENU})
|
||||
cali.c
|
||||
cdrom.bgm.c
|
||||
cdrom.c
|
||||
cg.c
|
||||
cmd2F.c
|
||||
cmd2F60.c
|
||||
cmd_check.c
|
||||
cmdb.c
|
||||
cmdc.c
|
||||
cmdd.c
|
||||
cmde.c
|
||||
cmdf.c
|
||||
cmdg.c
|
||||
cmdh.c
|
||||
cmdi.c
|
||||
cmdj.c
|
||||
cmdk.c
|
||||
cmdl.c
|
||||
cmdm.c
|
||||
cmdn.c
|
||||
cmdo.c
|
||||
cmdp.c
|
||||
cmdq.c
|
||||
cmds.c
|
||||
cmdt.c
|
||||
cmdu.c
|
||||
cmdv.c
|
||||
cmdw.c
|
||||
cmdy.c
|
||||
cmdz.c
|
||||
cursor.c
|
||||
dri.c
|
||||
ecopy.c
|
||||
filecheck.c
|
||||
font.c
|
||||
hacks.c
|
||||
image.c
|
||||
input.c
|
||||
jpeg.c
|
||||
message.c
|
||||
midi.c
|
||||
mmap.c
|
||||
msgskip.c
|
||||
mt19937-1.c
|
||||
music.c
|
||||
music_cdrom.c
|
||||
music_midi.c
|
||||
nact.c
|
||||
network.c
|
||||
pms.c
|
||||
profile.c
|
||||
qnt.c
|
||||
s39ain.c
|
||||
savedata.c
|
||||
scenario.c
|
||||
sdl_cursor.c
|
||||
sdl_draw.c
|
||||
sdl_effect.c
|
||||
sdl_event.c
|
||||
sdl_image.c
|
||||
sdl_video.c
|
||||
selection.c
|
||||
texthook.c
|
||||
variable.c
|
||||
vsp.c
|
||||
xsystem35.c
|
||||
)
|
||||
|
||||
# System3.x commands
|
||||
target_sources(xsystem35 PRIVATE
|
||||
cmdb.c cmdc.c cmdd.c cmde.c cmdf.c cmdg.c cmdh.c cmdi.c cmdj.c
|
||||
cmdk.c cmdl.c cmdm.c cmdn.c cmdo.c cmdp.c cmdq.c cmds.c cmdt.c
|
||||
cmdu.c cmdv.c cmdw.c cmdy.c cmdz.c cmd2F.c cmd2F60.c)
|
||||
if (EMSCRIPTEN)
|
||||
target_sources(xsystem35 PRIVATE pcm.emscripten.c bgm.emscripten.c bgi.c)
|
||||
elseif (SDL2MIXER_FOUND)
|
||||
target_sources(xsystem35 PRIVATE pcm.sdlmixer.c bgm.sdlmixer.c bgi.c)
|
||||
else()
|
||||
target_sources(xsystem35 PRIVATE pcm.dummy.c bgm.dummy.c)
|
||||
endif()
|
||||
|
||||
# Graphics
|
||||
if (ENABLE_CDROM_LINUX)
|
||||
target_sources(xsystem35 PRIVATE cdrom.Linux.c)
|
||||
elseif (ENABLE_CDROM_BSD)
|
||||
target_sources(xsystem35 PRIVATE cdrom.FreeBSD.c)
|
||||
elseif (ENABLE_CDROM_EMSCRIPTEN)
|
||||
target_sources(xsystem35 PRIVATE cdrom.emscripten.c)
|
||||
else()
|
||||
target_sources(xsystem35 PRIVATE cdrom.empty.c)
|
||||
endif()
|
||||
if (ENABLE_CDROM_MP3)
|
||||
target_sources(xsystem35 PRIVATE cdrom.mp3.c)
|
||||
endif()
|
||||
|
||||
target_sources(xsystem35 PRIVATE
|
||||
sdl_video.c sdl_draw.c sdl_event.c sdl_image.c sdl_cursor.c sdl_effect.c
|
||||
image.c font.c)
|
||||
if (EMSCRIPTEN)
|
||||
target_sources(xsystem35 PRIVATE midi.emscripten.c)
|
||||
elseif (ANDROID)
|
||||
target_sources(xsystem35 PRIVATE midi.android.c)
|
||||
else()
|
||||
if (ENABLE_MIDI_RAWMIDI)
|
||||
target_sources(xsystem35 PRIVATE midi.rawmidi.c midifile.c)
|
||||
endif()
|
||||
if (ENABLE_MIDI_SDLMIXER)
|
||||
target_sources(xsystem35 PRIVATE midi.sdlmixer.c)
|
||||
endif()
|
||||
if (ENABLE_MIDI_PORTMIDI)
|
||||
target_sources(xsystem35 PRIVATE midi.portmidi.c)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (EMSCRIPTEN)
|
||||
target_sources(xsystem35 PRIVATE menu_emscripten.c)
|
||||
elseif (ANDROID)
|
||||
target_sources(xsystem35 PRIVATE menu_android.c)
|
||||
elseif (ENABLE_GTK)
|
||||
target_sources(xsystem35 PRIVATE menu.c menu_callback.c menu_gui.c s39init.c)
|
||||
else ()
|
||||
target_sources(xsystem35 PRIVATE menu_sdl.c sdl_input.c)
|
||||
endif()
|
||||
|
||||
# CG
|
||||
target_sources(xsystem35 PRIVATE
|
||||
pms.c vsp.c bmp.c qnt.c jpeg.c)
|
||||
if (HAVE_WEBP)
|
||||
target_sources(xsystem35 PRIVATE webp.c)
|
||||
target_link_libraries(xsystem35 PRIVATE WebP)
|
||||
endif()
|
||||
|
||||
# Music
|
||||
target_sources(xsystem35 PRIVATE
|
||||
music.c music_cdrom.c music_midi.c midi.c cdrom.c)
|
||||
|
||||
# Misc
|
||||
target_sources(xsystem35 PRIVATE
|
||||
input.c profile.c mt19937-1.c filecheck.c mmap.c hacks.c)
|
||||
|
||||
# Scenario
|
||||
target_sources(xsystem35 PRIVATE
|
||||
cali.c scenario.c variable.c cmd_check.c nact.c
|
||||
selection.c message.c savedata.c s39ain.c texthook.c msgskip.c)
|
||||
|
||||
# Graphics
|
||||
target_sources(xsystem35 PRIVATE
|
||||
ags.c cg.c ecopy.c alpha_plane.c cursor.c)
|
||||
|
||||
# Network
|
||||
target_sources(xsystem35 PRIVATE
|
||||
network.c)
|
||||
|
||||
# Debugger
|
||||
if (ENABLE_DEBUGGER)
|
||||
target_sources(xsystem35 PRIVATE
|
||||
debug_symbol.c debugger.c debugger_cui.c debugger_dap.c)
|
||||
|
||||
+1
-3
@@ -20,9 +20,7 @@
|
||||
*/
|
||||
/* $Id: menu_callback.c,v 1.11 2003/04/25 17:23:55 chikama Exp $ */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
#include "config.h"
|
||||
|
||||
#include "portab.h"
|
||||
#include "menu.h"
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
#include "config.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
Reference in New Issue
Block a user