### Unix Installation Source: https://github.com/easyrpg/player/blob/master/CMakeLists.txt Installs desktop entry, icons, and metainfo files for Unix-like systems. ```cmake if(UNIX) # Install desktop entry, icons and metainfo install(FILES resources/unix/easyrpg-player.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications) install(FILES resources/unix/icon-48.png RENAME easyrpg-player.png DESTINATION ${CMAKE_INSTALL_DATADIR}/pixmaps) # legacy install(FILES resources/unix/icon-48.png RENAME easyrpg-player.png DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/48x48/apps) install(FILES resources/unix/easyrpg-player.svg DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps) install(FILES resources/unix/easyrpg-player.metainfo.xml DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo) endif() ``` -------------------------------- ### Example RPG_RT.ini Configuration Source: https://github.com/easyrpg/player/blob/master/resources/unix/easyrpg-player.6.adoc This example demonstrates setting game title, package flag, and custom screen resolution in the RPG_RT.ini file. ```ini [RPG_RT] GameTitle=My Game FullPackageFlag=1 WinW=640 WinH=480 [EasyRPG] Encoding=1252 ``` -------------------------------- ### Standard CMake Build Compilation and Installation Source: https://github.com/easyrpg/player/blob/master/docs/BUILDING.md Compile and install the EasyRPG Player after configuring it with CMake. This step requires root privileges for system-wide installation. ```bash cmake --build . sudo cmake --build . --target install ``` -------------------------------- ### Example EasyRPG.ini Configuration Source: https://github.com/easyrpg/player/blob/master/resources/unix/easyrpg-player.6.adoc This example shows how to configure game-specific settings and patch options within the EasyRPG.ini file. ```ini [Game] NewGame=1 Engine=rpg2k [Patch] CommonThisEvent=1 Maniac=1 ``` -------------------------------- ### macOS Platform Setup Source: https://github.com/easyrpg/player/blob/master/CMakeLists.txt Enables Objective-C++ language, adds macOS-specific source files, and links CoreAudio and Foundation frameworks. ```cmake if(APPLE) enable_language(OBJCXX) target_sources(${PROJECT_NAME} PRIVATE src/platform/macos/macos_utils.mm src/platform/macos/macos_utils.h) if(MACOS) find_library(MACOSAUDIOUNIT AudioUnit REQUIRED) target_sources(${PROJECT_NAME} PRIVATE src/platform/macos/midiout_device_coreaudio.cpp src/platform/macos/midiout_device_coreaudio.h) endif() find_library(MACOSFOUNDATION Foundation REQUIRED) find_library(MACOSAUDIOTOOLBOX AudioToolbox REQUIRED) target_link_libraries(${PROJECT_NAME} ${MACOSFOUNDATION} ${MACOSAUDIOUNIT} ${MACOSAUDIOTOOLBOX}) endif() ``` -------------------------------- ### PSVita Platform Setup Source: https://github.com/easyrpg/player/blob/master/CMakeLists.txt Sets up the build for the PlayStation Vita, including required SDK includes, compile definitions, options, and platform-specific source files. ```cmake elseif(PLAYER_TARGET_PLATFORM STREQUAL "psvita") include("$ENV{VITASDK}/share/vita.cmake" REQUIRED) target_compile_definitions(${PROJECT_NAME} PUBLIC PLAYER_UI=Psp2Ui) target_compile_options(${PROJECT_NAME} PUBLIC -Wno-psabi) # Remove abi warning after vitasdk ships newer gcc target_sources(${PROJECT_NAME} PRIVATE src/platform/psvita/audio.cpp src/platform/psvita/audio.h src/platform/psvita/clock.h src/platform/psvita/input_buttons.cpp src/platform/psvita/ui.cpp src/platform/psvita/ui.h) ``` -------------------------------- ### Install Fastlane Dependencies Source: https://github.com/easyrpg/player/blob/master/builds/android/fastlane/README.md Execute this command in the parent folder to install Fastlane dependencies using Bundler. ```bash bundle install --binstubs --path vendor/bundle ``` -------------------------------- ### 3DS Platform Setup Source: https://github.com/easyrpg/player/blob/master/CMakeLists.txt Configures build settings for the Nintendo 3DS platform, including source files and linking the 3ds-assets library. ```cmake elseif(PLAYER_TARGET_PLATFORM STREQUAL "3ds") $ PRIVATE src/platform/3ds/audio.cpp src/platform/3ds/audio.h src/platform/3ds/clock.h src/platform/3ds/input_buttons.cpp src/platform/3ds/ui.cpp src/platform/3ds/ui.h) target_link_libraries(${PROJECT_NAME} 3ds-assets) ``` -------------------------------- ### Project Version Setup Source: https://github.com/easyrpg/player/blob/master/CMakeLists.txt Initializes and formats project version variables, including handling missing tweak and patch components. It concatenates major, minor, patch, and tweak versions into a full string. ```cmake set(PLAYER_VERSION ${PROJECT_VERSION}) if(NOT PROJECT_VERSION_TWEAK) # a kludge to match the valid version format set(PROJECT_VERSION_TWEAK 0) if(NOT PROJECT_VERSION_PATCH) set(PROJECT_VERSION_PATCH 0) endif() endif() set(PLAYER_VERSION_FULL ${PLAYER_VERSION}) string(CONCAT PROJECT_VERSION ${PROJECT_VERSION_MAJOR} "." ${PROJECT_VERSION_MINOR} "." ${PROJECT_VERSION_PATCH} "." ${PROJECT_VERSION_TWEAK}) set(PLAYER_VERSION_DEFS EP_VERSION="${PLAYER_VERSION}" EP_VERSION_MAJOR=${PROJECT_VERSION_MAJOR} EP_VERSION_MINOR=${PROJECT_VERSION_MINOR} EP_VERSION_PATCH=${PROJECT_VERSION_PATCH} EP_VERSION_TWEAK=${PROJECT_VERSION_TWEAK}) ``` -------------------------------- ### Install Bash Completion Source: https://github.com/easyrpg/player/blob/master/CMakeLists.txt Installs bash completion scripts if bash-completion is found or on non-macOS Unix systems. ```cmake set(BASHCOMPLETION_STATUS "Unavailable") find_package(bash-completion QUIET) if(BASH_COMPLETION_FOUND OR (UNIX AND NOT APPLE)) set(BASHCOMPLETION_STATUS "Available") install(FILES resources/unix/bash-completion/easyrpg-player DESTINATION "${CMAKE_INSTALL_DATADIR}/bash-completion/completions") endif() ``` -------------------------------- ### Nintendo Switch Platform Setup Source: https://github.com/easyrpg/player/blob/master/CMakeLists.txt Configures the build for the Nintendo Switch, enabling ASM language, generating gfx assets, and linking necessary libraries like OpenGL and EGL. ```cmake elseif(PLAYER_TARGET_PLATFORM STREQUAL "switch") target_compile_definitions(${PROJECT_NAME} PUBLIC PLAYER_UI=NxUi PLAYER_NINTENDO) find_package(OpenGL CONFIG REQUIRED) find_library(GLAD glad REQUIRED) target_link_libraries(${PROJECT_NAME} OpenGL::EGL) # generate gfx assets enable_language(ASM) dkp_add_embedded_binary_library(switch-assets "${CMAKE_CURRENT_SOURCE_DIR}/resources/switch/touch_ui.png") target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) target_sources(${PROJECT_NAME} INTERFACE $ PRIVATE src/platform/switch/audio.cpp src/platform/switch/audio.h src/platform/switch/clock.h src/platform/switch/input_buttons.cpp src/platform/switch/ui.cpp src/platform/switch/ui.h) target_link_libraries(${PROJECT_NAME} switch-assets) ``` -------------------------------- ### Emscripten Installation Source: https://github.com/easyrpg/player/blob/master/CMakeLists.txt Installs the Emscripten-compiled JavaScript and WebAssembly files to the installation directory. ```cmake if(CMAKE_SYSTEM_NAME STREQUAL "Emscripten") # Emscripten does not install the wasm file (or the js file when building a shell) if(PLAYER_JS_BUILD_SHELL) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PLAYER_JS_OUTPUT_NAME}.js DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PLAYER_JS_OUTPUT_NAME}.wasm DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() ``` -------------------------------- ### CMake Minimum Required Version and Project Setup Source: https://github.com/easyrpg/player/blob/master/builds/libretro/CMakeLists.txt Sets the minimum required CMake version and defines the project name and language. ```cmake cmake_minimum_required(VERSION 3.16...3.31 FATAL_ERROR) project(retro_common VERSION 1.0 LANGUAGES C) ``` -------------------------------- ### Standard CMake Build Configuration Source: https://github.com/easyrpg/player/blob/master/docs/BUILDING.md Configure the EasyRPG Player project for a release build using CMake. Ensure CMake 3.18 or newer is installed. ```bash tar xf easyrpg-player-0.8.1.tar.xz cd easyrpg-player-0.8.1 cmake . -DCMAKE_BUILD_TYPE=Release ``` -------------------------------- ### Install Executable for Debug Component Source: https://github.com/easyrpg/player/blob/master/CMakeLists.txt Installs the 'easyrpg-player' target for the debug component, typically used for development and debugging purposes. ```cmake install(TARGETS easyrpg-player RUNTIME DESTINATION . COMPONENT debug) ``` -------------------------------- ### Generate Man Page Source: https://github.com/easyrpg/player/blob/master/CMakeLists.txt Configures the generation of the man page using asciidoctor if available. Installs the man page on Unix-like systems. ```cmake set(MAN_NAME easyrpg-player.6) find_program(ASCIIDOCTOR_EXECUTABLE asciidoctor) set(MANUAL_STATUS "Unavailable") if(ASCIIDOCTOR_EXECUTABLE) add_custom_command(OUTPUT resources/unix/${MAN_NAME} COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/resources/unix COMMAND ${ASCIIDOCTOR_EXECUTABLE} -a player_version="${PLAYER_VERSION}" -b manpage -D ${CMAKE_CURRENT_BINARY_DIR}/resources/unix ${CMAKE_CURRENT_SOURCE_DIR}/resources/unix/${MAN_NAME}.adoc DEPENDS resources/unix/${MAN_NAME}.adoc COMMENT "(Re-)building manpage ${MAN_NAME}" VERBATIM) if(UNIX) add_custom_target(player_man ALL DEPENDS resources/unix/${MAN_NAME}) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/resources/unix/${MAN_NAME} DESTINATION ${CMAKE_INSTALL_MANDIR}/man6) else() add_custom_target(player_man DEPENDS resources/unix/${MAN_NAME}) endif() if(NOT TARGET man) add_custom_target(man) endif() add_dependencies(man player_man) set(MANUAL_STATUS "Generated") else() # no asciidoctor, distribution archive? if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/resources/unix/${MAN_NAME}) install(FILES resources/unix/${MAN_NAME} DESTINATION share/man/man6) set(MANUAL_STATUS "Bundled") endif() endif() ``` -------------------------------- ### Executable Target Generation Source: https://github.com/easyrpg/player/blob/master/CMakeLists.txt Generates the symbol list for the easyrpg-player executable and installs map/list files for debugging. ```cmake dkp_target_generate_symbol_list(easyrpg-player) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/easyrpg-player.map ${CMAKE_CURRENT_BINARY_DIR}/easyrpg-player.lst DESTINATION . COMPONENT debug) endif() ``` -------------------------------- ### Configure Benchmarks Source: https://github.com/easyrpg/player/blob/master/CMakeLists.txt Builds benchmark executables if PLAYER_ENABLE_BENCHMARKS is ON. Links against the project and the benchmark library. ```cmake option(PLAYER_ENABLE_BENCHMARKS "Build benchmarks" OFF) if(PLAYER_ENABLE_BENCHMARKS) find_package(benchmark REQUIRED) file(GLOB BENCH_FILES ${CMAKE_CURRENT_SOURCE_DIR}/bench/*.cpp) foreach(i ${BENCH_FILES}) get_filename_component(name "${i}" NAME_WE) add_executable(bench_${name} ${i}) set_target_properties(bench_${name} PROPERTIES WIN32_EXECUTABLE FALSE) target_link_libraries(bench_${name} ${PROJECT_NAME}) target_link_libraries(bench_${name} benchmark) endforeach() endif() ``` -------------------------------- ### Configure for SDL2 Platform Source: https://github.com/easyrpg/player/blob/master/CMakeLists.txt Sets up the build for the SDL2 platform. This involves adding source files, defining compile flags, finding the SDL2 package, and linking SDL2main if available. It also includes platform-specific configurations for Android, Wii, and WiiU. ```cmake elseif(PLAYER_TARGET_PLATFORM STREQUAL "SDL2") target_sources(${PROJECT_NAME} PRIVATE src/platform/sdl/sdl2_ui.cpp src/platform/sdl/sdl2_ui.h) target_compile_definitions(${PROJECT_NAME} PUBLIC USE_SDL=2) # SDL2 depends on some systems on SDL2::SDL2main but SDL2::SDL2 is not always a dependency of it # Manually add the dependencies player_find_package(NAME SDL2 VERSION 2.0.14 TARGET SDL2::SDL2 REQUIRED) if(TARGET SDL2::SDL2main) target_link_libraries(${PROJECT_NAME} SDL2::SDL2main) endif() if(ANDROID) set(PLAYER_BUILD_EXECUTABLE OFF) elseif(NINTENDO_WII) target_compile_definitions(${PROJECT_NAME} PUBLIC PLAYER_NINTENDO) target_sources(${PROJECT_NAME} PRIVATE src/platform/wii/clock.h src/platform/wii/input_buttons.cpp) elseif(NINTENDO_WIIU) target_compile_definitions(${PROJECT_NAME} PUBLIC PLAYER_NINTENDO) target_sources(${PROJECT_NAME} PRIVATE src/platform/wiiu/main.h src/platform/wiiu/input_buttons.cpp) endif() if(WIN32) target_link_libraries(${PROJECT_NAME} "Dwmapi") endif() ``` -------------------------------- ### Configure for SDL1 Platform Source: https://github.com/easyrpg/player/blob/master/CMakeLists.txt Sets up the build for the SDL1 platform. This includes conditional configuration for Nintendo Wii, finding the SDL1 package, adding source files, and defining compile flags and configuration names. ```cmake elseif(PLAYER_TARGET_PLATFORM STREQUAL "SDL1") if(NINTENDO_WII) find_package(SDL REQUIRED) target_compile_definitions(${PROJECT_NAME} PUBLIC PLAYER_NINTENDO) target_include_directories(${PROJECT_NAME} PUBLIC ${SDL_INCLUDE_DIR}) target_sources(${PROJECT_NAME} PRIVATE src/platform/wii/clock.h src/platform/wii/input_buttons.cpp) else() player_find_package(NAME SDL1 TARGET SDL::SDLmain REQUIRED) endif() target_sources(${PROJECT_NAME} PRIVATE src/platform/sdl/axis.h src/platform/sdl/sdl_ui.cpp src/platform/sdl/sdl_ui.h) target_compile_definitions(${PROJECT_NAME} PUBLIC USE_SDL=1 EASYRPG_CONFIG_NAME="config_sdl1.ini") ``` -------------------------------- ### Windows Executable Build Source: https://github.com/easyrpg/player/blob/master/CMakeLists.txt Configures the build for Windows, including console handling for debug builds, resource compilation, and setting the startup project. ```cmake set(EXE_NAME ${PROJECT_NAME}_exe) if(CMAKE_SYSTEM_NAME STREQUAL "Emscripten") add_executable(${EXE_NAME} "src/platform/emscripten/main.cpp") else() add_executable(${EXE_NAME} "src/platform/sdl/main.cpp") endif() set_target_properties(${EXE_NAME} PROPERTIES OUTPUT_NAME "easyrpg-player") if(WIN32) # Open console for Debug builds set_target_properties(${EXE_NAME} PROPERTIES WIN32_EXECUTABLE $<$>:TRUE>>) # Add resources string(REPLACE "." "," RC_VERSION ${PROJECT_VERSION}) string(TIMESTAMP RC_YEAR "%Y") configure_file(resources/windows/player.rc.in resources/windows/player.rc @ONLY) target_sources(${EXE_NAME} PRIVATE resources/windows/player.manifest "${CMAKE_CURRENT_BINARY_DIR}/resources/windows/player.rc") # Set Visual Studio startup project set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT ${EXE_NAME}) # Change executable name set_target_properties(${EXE_NAME} PROPERTIES OUTPUT_NAME "Player") endif() ``` -------------------------------- ### Deploy Beta Version with Fastlane Supply Source: https://github.com/easyrpg/player/blob/master/builds/android/fastlane/README.md Use this command to push the APK and metadata for the beta track to the Google Play Store after a successful Gradle build. ```bash bin/fastlane supply --track beta ``` -------------------------------- ### Find and Configure libsndfile Source: https://github.com/easyrpg/player/blob/master/CMakeLists.txt Finds the libsndfile library for WAV playback and sets up the necessary definitions and target. ```cmake player_find_package(NAME SndFile CONDITION PLAYER_WITH_LIBSNDFILE DEFINITION HAVE_LIBSNDFILE TARGET SndFile::sndfile) ``` -------------------------------- ### Get Gamepads in Emscripten Shell Source: https://github.com/easyrpg/player/blob/master/resources/emscripten/emscripten-shell.html Retrieves the list of connected gamepads using the browser's Gamepad API. It supports both standard and webkit-prefixed versions. ```javascript function getGamepads() { var pads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []); return pads; } ``` -------------------------------- ### Find and Configure WildMidi Source: https://github.com/easyrpg/player/blob/master/CMakeLists.txt Finds the WildMidi library for MIDI audio playback and sets up the necessary definitions and targets. ```cmake player_find_package(NAME WildMidi CONDITION PLAYER_WITH_WILDMIDI DEFINITION HAVE_LIBWILDMIDI TARGET "WildMidi::libwildmidi;WildMidi::libwildmidi-static") ``` -------------------------------- ### Build Homebrew Ports with Game Bundling Source: https://github.com/easyrpg/player/blob/master/docs/BUILDING.md Enable game bundling for Switch, Wii U, and 3DS homebrew ports. Specify the path to the game data to be included in the build. ```bash -DPLAYER_BUNDLE=ON -DPLAYER_BUNDLE_PATH=path/to/myGame ``` -------------------------------- ### Bind Touch Node to Key Source: https://github.com/easyrpg/player/blob/master/resources/emscripten/emscripten-shell.html Binds a DOM node (like a button) to simulate a specific keyboard key on touch events. It handles touch start, end, and move to provide a responsive virtual button. ```javascript function bindKey(node, key) { keys.set(node.id, key); node.addEventListener('touchstart', event => { event.preventDefault(); simulateKeyboardEvent('keydown', key); keysDown.set(event.target.id, node.id); node.classList.add('active'); }); node.addEventListener('touchend', event => { event.preventDefault(); const pressedKey = keysDown.get(event.target.id); if (pressedKey && keys.has(pressedKey)) { const key = keys.get(pressedKey); simulateKeyboardEvent('keyup', key); } keysDown.delete(event.target.id); node.classList.remove('active'); if (lastTouchedId) { document.getElementById(lastTouchedId).classList.remove('active'); } }); // Inspired by https://github.com/pulsejet/mkxp-web/blob/262a2254b684567311c9f0e135ee29f6e8c3613e/extra/js/dpad.js node.addEventListener('touchmove', event => { const { target, clientX, clientY } = event.changedTouches[0]; const origTargetId = keysDown.get(target.id); const nextTargetId = document.elementFromPoint(clientX, clientY).id; if (origTargetId === nextTargetId) return; if (origTargetId) { const key = keys.get(origTargetId); simulateKeyboardEvent('keyup', key); keysDown.delete(target.id); document.getElementById(origTargetId).classList.remove('active'); } if (keys.has(nextTargetId)) { const key = keys.get(nextTargetId); simulateKeyboardEvent('keydown', key); keysDown.set(target.id, nextTargetId); lastTouchedId = nextTargetId; document.getElementById(nextTargetId).classList.add('active'); } }) } ``` -------------------------------- ### Find and Configure FluidSynth Source: https://github.com/easyrpg/player/blob/master/CMakeLists.txt Finds the FluidSynth library for MIDI audio playback and sets up the necessary definitions and target. ```cmake player_find_package(NAME FluidSynth CONDITION PLAYER_WITH_FLUIDSYNTH DEFINITION HAVE_FLUIDSYNTH TARGET FluidSynth::libfluidsynth) ``` -------------------------------- ### Find and Configure libmpg123 Source: https://github.com/easyrpg/player/blob/master/CMakeLists.txt Finds the libmpg123 library for MP3 playback and sets up the necessary definitions and target. ```cmake player_find_package(NAME mpg123 CONDITION PLAYER_WITH_MPG123 DEFINITION HAVE_LIBMPG123 TARGET MPG123::libmpg123) ``` -------------------------------- ### Configure for SDL3 Platform Source: https://github.com/easyrpg/player/blob/master/CMakeLists.txt Sets up the build for the SDL3 platform. This includes adding specific source files, defining compile flags, finding the SDL3 package, and conditionally disabling executable building on Android. ```cmake if(PLAYER_TARGET_PLATFORM STREQUAL "SDL3") target_sources(${PROJECT_NAME} PRIVATE src/platform/sdl/sdl3_ui.cpp src/platform/sdl/sdl3_ui.h) target_compile_definitions(${PROJECT_NAME} PUBLIC USE_SDL=3) player_find_package(NAME SDL3 VERSION 3.4.0 TARGET SDL3::SDL3 REQUIRED) if(ANDROID) set(PLAYER_BUILD_EXECUTABLE OFF) endif() if(WIN32) target_link_libraries(${PROJECT_NAME} "Dwmapi") endif() endif() ``` -------------------------------- ### macOS Executable Build Source: https://github.com/easyrpg/player/blob/master/CMakeLists.txt Configures the build for macOS, creating a .app bundle with a custom Info.plist and output name. ```cmake set(EXE_NAME "EasyRPG-Player.app") set_source_files_properties(${PROJECT_NAME}_BUNDLE_ICON PROPERTIES MACOSX_PACKAGE_LOCATION "Resources") add_executable(${EXE_NAME} MACOSX_BUNDLE "src/platform/sdl/main.cpp" ${PROJECT_NAME}_BUNDLE_ICON) configure_file(resources/macos/Info.plist.in resources/macos/Info.plist @ONLY) set_target_properties(${EXE_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_BINARY_DIR}/resources/macos/Info.plist") set_target_properties(${EXE_NAME} PROPERTIES OUTPUT_NAME "EasyRPG Player") ``` -------------------------------- ### Initialize and Update Git Submodules for libretro Source: https://github.com/easyrpg/player/blob/master/docs/BUILDING.md Initialize and update Git submodules, specifically for the libretro core, before building. This ensures all necessary components are present. ```bash git submodule init git submodule update ``` -------------------------------- ### Configure for libretro Platform Source: https://github.com/easyrpg/player/blob/master/CMakeLists.txt Sets up the build for the libretro platform. This disables executable building and links the 'retro_common' library. ```cmake elseif(PLAYER_TARGET_PLATFORM STREQUAL "libretro") target_compile_definitions(${PROJECT_NAME} PUBLIC PLAYER_UI=LibretroUi USE_LIBRETRO=1) set(PLAYER_BUILD_EXECUTABLE OFF) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/builds/libretro) target_link_libraries(${PROJECT_NAME} retro_common) ``` -------------------------------- ### Build Homebrew Ports with CMake Toolchain Source: https://github.com/easyrpg/player/blob/master/docs/BUILDING.md Configure the build for Nintendo and Sony homebrew ports using CMake. Specify the appropriate toolchain file based on the target platform. ```bash -DCMAKE_TOOLCHAIN_FILE=/cmake/3DS|Switch|Wii|WiiU.cmake (or /share/vita.toolchain.cmake) ``` -------------------------------- ### Find and Configure libvorbis Source: https://github.com/easyrpg/player/blob/master/CMakeLists.txt Finds the libvorbis library for Ogg Vorbis playback and sets up the necessary definitions and target. It includes a fallback to Tremor if libvorbis is not found. ```cmake player_find_package(NAME Vorbis CONDITION PLAYER_WITH_OGGVORBIS DEFINITION HAVE_OGGVORBIS TARGET Vorbis::vorbisfile) if(NOT TARGET Vorbis::vorbisfile) player_find_package(NAME Tremor CONDITION PLAYER_WITH_OGGVORBIS DEFINITION HAVE_TREMOR TARGET Tremor::Tremor) endif() ``` -------------------------------- ### Configure MIDI Audio Playback (wildmidi) Source: https://github.com/easyrpg/player/blob/master/CMakeLists.txt Conditionally enables MIDI audio playback using the wildmidi library. This option is dependent on PLAYER_HAS_AUDIO and the absence of PLAYER_NONFREE. ```cmake cmake_dependent_option(PLAYER_WITH_WILDMIDI "Play MIDI audio with wildmidi" ON "PLAYER_HAS_AUDIO;NOT PLAYER_NONFREE" OFF) ``` -------------------------------- ### Find and Configure libsamplerate Source: https://github.com/easyrpg/player/blob/master/CMakeLists.txt Finds the libsamplerate library and sets up necessary definitions and targets if it's available and selected for use, typically as a fallback for resampling. ```cmake player_find_package( NAME Samplerate CONDITION PLAYER_WITH_SAMPLERATE DEFINITION HAVE_LIBSAMPLERATE TARGET Samplerate::Samplerate) ``` -------------------------------- ### Enable Native MIDI Support Source: https://github.com/easyrpg/player/blob/master/CMakeLists.txt Configures native MIDI playback based on the target platform and available system libraries like ALSA. This snippet sets up compile definitions and links necessary libraries. ```cmake if(WIN32 OR MACOS) set(SUPPORT_NATIVE_MIDI ON) elseif(UNIX) find_package(ALSA) if(ALSA_FOUND) set(SUPPORT_NATIVE_MIDI ON) endif() endif() cmake_dependent_option(PLAYER_WITH_NATIVE_MIDI "Play MIDI audio using the API of the operating system" ON "SUPPORT_NATIVE_MIDI" OFF) if(PLAYER_WITH_NATIVE_MIDI) target_compile_definitions(${PROJECT_NAME} PUBLIC HAVE_NATIVE_MIDI=1) if(WIN32) target_link_libraries(${PROJECT_NAME} "winmm") elseif(ALSA_FOUND) target_compile_definitions(${PROJECT_NAME} PUBLIC HAVE_ALSA=1) target_sources(${PROJECT_NAME} PRIVATE src/platform/linux/midiout_device_alsa.cpp src/platform/linux/midiout_device_alsa.h) target_link_libraries(${PROJECT_NAME} ALSA::ALSA) find_package(Threads) if(Threads_FOUND) target_link_libraries(${PROJECT_NAME} Threads::Threads) endif() endif() endif() ``` -------------------------------- ### Configure MIDI Audio Playback (fluidsynth) Source: https://github.com/easyrpg/player/blob/master/CMakeLists.txt Conditionally enables MIDI audio playback using the fluidsynth library. This option is dependent on PLAYER_HAS_AUDIO and the absence of PLAYER_NONFREE. ```cmake cmake_dependent_option(PLAYER_WITH_FLUIDSYNTH "Play MIDI audio with fluidsynth" ON "PLAYER_HAS_AUDIO;NOT PLAYER_NONFREE" OFF) ``` -------------------------------- ### Build Android APK with Gradle Source: https://github.com/easyrpg/player/blob/master/docs/BUILDING.md Build a release Android APK for EasyRPG Player using Gradle. Replace DIR1 and DIR2 with the paths to player dependencies. ```bash tar xf easyrpg-player-0.8.1.tar.xz cd easyrpg-player-0.8.1/builds/android ./gradlew -PtoolchainDirs="DIR1;DIR2" assembleRelease ``` -------------------------------- ### Configure Doxygen Documentation Source: https://github.com/easyrpg/player/blob/master/CMakeLists.txt Configures and builds API documentation using Doxygen if found. Creates a custom target 'doc'. ```cmake find_package(Doxygen) set(DOXYGEN_STATUS "Unavailable") if(DOXYGEN_FOUND) set(DOXYGEN_STATUS "Available (target \"doc\")") configure_file(resources/Doxyfile.in resources/Doxyfile @ONLY) add_custom_target(player_doc ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/resources/Doxyfile DEPENDS ${PROJECT_NAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/resources COMMENT "Generating API documentation with Doxygen" VERBATIM) if(NOT TARGET doc) # Handle liblcf doc target add_custom_target(doc) endif() add_dependencies(doc player_doc) endif() ``` -------------------------------- ### Set Audio Backend Cache Variable Source: https://github.com/easyrpg/player/blob/master/CMakeLists.txt Configures the audio backend for the player. The available options depend on the target platform. This variable is cached for user configuration. ```cmake set(PLAYER_AUDIO_BACKEND "SDL3" CACHE STRING "Audio system to use. Options: SDL3 OFF") set_property(CACHE PLAYER_AUDIO_BACKEND PROPERTY STRINGS SDL3 OFF) ``` ```cmake set(PLAYER_AUDIO_BACKEND "SDL2" CACHE STRING "Audio system to use. Options: SDL2 AESND OFF") set_property(CACHE PLAYER_AUDIO_BACKEND PROPERTY STRINGS SDL2 AESND OFF) ``` ```cmake set(PLAYER_AUDIO_BACKEND "SDL2" CACHE STRING "Audio system to use. Options: SDL2 OFF") set_property(CACHE PLAYER_AUDIO_BACKEND PROPERTY STRINGS SDL2 OFF) ``` ```cmake set(PLAYER_AUDIO_BACKEND "AESND" CACHE STRING "Audio system to use. Options: SDL1 AESND OFF") set_property(CACHE PLAYER_AUDIO_BACKEND PROPERTY STRINGS SDL1 AESND OFF) ``` ```cmake set(PLAYER_AUDIO_BACKEND "SDL1" CACHE STRING "Audio system to use. Options: SDL1 OFF") set_property(CACHE PLAYER_AUDIO_BACKEND PROPERTY STRINGS SDL1 OFF) ``` ```cmake set(PLAYER_AUDIO_BACKEND ${PLAYER_TARGET_PLATFORM} CACHE STRING "Audio system to use. Options: ${PLAYER_TARGET_PLATFORM} OFF") set_property(CACHE PLAYER_AUDIO_BACKEND PROPERTY STRINGS ${PLAYER_TARGET_PLATFORM} OFF) ``` -------------------------------- ### Find and Configure SpeexDSP Source: https://github.com/easyrpg/player/blob/master/CMakeLists.txt Finds the speexDSP library and sets up necessary definitions and targets if it's available and selected for use. ```cmake player_find_package(NAME speexdsp CONDITION PLAYER_WITH_SPEEXDSP DEFINITION HAVE_LIBSPEEXDSP TARGET speexdsp::speexdsp) ``` -------------------------------- ### External Library Dependencies Source: https://github.com/easyrpg/player/blob/master/CMakeLists.txt Finds and links required external libraries: PNG (with zlib), fmt, and Pixman. ```cmake # Detect all required libraries # PNG pulls in zlib which has a broken config when not both static and shared library are installed player_find_package(NAME PNG TARGET PNG::PNG REQUIRED CONFIG_BROKEN) player_find_package(NAME fmt TARGET fmt::fmt VERSION 5.2 REQUIRED) # Do not use player_find_package. enable_language used by pixman on Android does not work properly inside functions find_package(Pixman REQUIRED) target_link_libraries(${PROJECT_NAME} PIXMAN::PIXMAN) ``` -------------------------------- ### Configure Bundle Options Source: https://github.com/easyrpg/player/blob/master/CMakeLists.txt Sets up options for embedding content (romfs/wuhb bundle) into the executable for specific Nintendo platforms. Allows configuration of the path to include and the type of bundle. ```cmake option(PLAYER_BUNDLE "Embed a directory in the executable" OFF) set(PLAYER_BUNDLE_PATH "content" CACHE PATH "Directory to include in executable") ``` -------------------------------- ### Configure MIDI Audio Playback (fluidlite) Source: https://github.com/easyrpg/player/blob/master/CMakeLists.txt Conditionally enables MIDI audio playback using the fluidlite library. This option is dependent on PLAYER_HAS_AUDIO and the absence of PLAYER_NONFREE. ```cmake cmake_dependent_option(PLAYER_WITH_FLUIDLITE "Play MIDI audio with fluidlite" ON "PLAYER_HAS_AUDIO;NOT PLAYER_NONFREE" OFF) ``` -------------------------------- ### Fastlane Lanes for Beta Deployment Source: https://github.com/easyrpg/player/blob/master/builds/android/fastlane/README.md Invoke the 'beta' lane using Fastlane to automate the beta deployment process, which may include Gradle and supply steps. ```bash bin/fastlane beta ``` -------------------------------- ### Add Audio Source Files Source: https://github.com/easyrpg/player/blob/master/CMakeLists.txt Adds the appropriate audio source files to the target based on the selected audio backend. This ensures the correct audio implementation is compiled. ```cmake target_sources(${PROJECT_NAME} PRIVATE src/platform/sdl/sdl3_audio.cpp src/platform/sdl/sdl3_audio.h) ``` ```cmake target_sources(${PROJECT_NAME} PRIVATE src/platform/sdl/sdl2_audio.cpp src/platform/sdl/sdl2_audio.h) ``` ```cmake target_sources(${PROJECT_NAME} PRIVATE src/platform/sdl/sdl_audio.cpp src/platform/sdl/sdl_audio.h) ``` ```cmake target_sources(${PROJECT_NAME} PRIVATE src/platform/wii/audio.cpp src/platform/wii/audio.h) target_compile_definitions(${PROJECT_NAME} PUBLIC AUDIO_AESND=1) ``` -------------------------------- ### Deploy Release Version with Fastlane Supply Source: https://github.com/easyrpg/player/blob/master/builds/android/fastlane/README.md Use this command to push the APK and metadata for the release track to the Google Play Store after a successful Gradle build. ```bash bin/fastlane supply ``` -------------------------------- ### Configure FreeType and HarfBuzz Options Source: https://github.com/easyrpg/player/blob/master/CMakeLists.txt Sets up options for FreeType font rendering and HarfBuzz text shaping. HarfBuzz is dependent on FreeType. ```cmake option(PLAYER_WITH_FREETYPE "Support FreeType font rendering" ON) cmake_dependent_option(PLAYER_WITH_HARFBUZZ "Enable HarfBuzz text shaping (Requires FreeType)" ON "PLAYER_WITH_FREETYPE" OFF) ``` -------------------------------- ### Configure Instrumentation Framework Source: https://github.com/easyrpg/player/blob/master/CMakeLists.txt Enables performance instrumentation hooks based on the PLAYER_ENABLE_INSTRUMENTATION cache variable. Supports VTune integration. ```cmake set(PLAYER_ENABLE_INSTRUMENTATION "OFF" CACHE STRING "Build performance instrumentation hooks") set_property(CACHE PLAYER_ENABLE_INSTRUMENTATION PROPERTY STRINGS OFF VTune) if(NOT ${PLAYER_ENABLE_INSTRUMENTATION} STREQUAL "OFF") target_compile_definitions(${PROJECT_NAME} PUBLIC PLAYER_INSTRUMENTATION=${PLAYER_ENABLE_INSTRUMENTATION}) if(${PLAYER_ENABLE_INSTRUMENTATION} STREQUAL "VTune") player_find_package(NAME VTune TARGET VTune::ITT REQUIRED) endif() endif() ``` -------------------------------- ### Find and Configure Opusfile Source: https://github.com/easyrpg/player/blob/master/CMakeLists.txt Finds the opusfile library for Opus audio playback and sets up the necessary definitions and target. ```cmake player_find_package(NAME OpusFile CONDITION PLAYER_WITH_OPUS DEFINITION HAVE_OPUS TARGET OpusFile::opusfile) ``` -------------------------------- ### Add Executable for Nintendo Wii Source: https://github.com/easyrpg/player/blob/master/CMakeLists.txt Configures the main executable for the Nintendo Wii platform, linking libraries and creating a DOL file. Includes conditional linking for SDL2::SDL2main. ```cmake add_executable(easyrpg-player src/platform/wii/main.cpp) target_link_libraries(easyrpg-player ${PROJECT_NAME} ${SDL_LIBRARIES} -laesnd -lfat -lwiikeyboard) if(TARGET SDL2::SDL2main) # Missing dependency? target_link_libraries(SDL2::SDL2main INTERFACE -lfat) endif() ogc_create_dol(easyrpg-player) string(TIMESTAMP WII_DATE "%Y%m%d000000") configure_file(resources/wii/meta.xml.in resources/wii/meta.xml @ONLY) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/easyrpg-player.dol RENAME boot.dol DESTINATION easyrpg-player COMPONENT wii) install(FILES resources/wii/icon.png ${CMAKE_CURRENT_BINARY_DIR}/resources/wii/meta.xml DESTINATION easyrpg-player COMPONENT wii) ``` -------------------------------- ### Configure Unit Tests Source: https://github.com/easyrpg/player/blob/master/CMakeLists.txt Configures and builds the unit test runner executable if PLAYER_ENABLE_TESTS is ON. Includes platform-specific definitions and linking for Emscripten. ```cmake option(PLAYER_ENABLE_TESTS "Execute unit tests after compilation finishes" ON) if(PLAYER_ENABLE_TESTS) file(GLOB TEST_FILES ${CMAKE_CURRENT_SOURCE_DIR}/tests/*.cpp) add_executable(test_runner_player EXCLUDE_FROM_ALL ${TEST_FILES}) set_target_properties(test_runner_player PROPERTIES OUTPUT_NAME "test_runner" WIN32_EXECUTABLE FALSE) if(CMAKE_SYSTEM_NAME STREQUAL "Emscripten") target_compile_definitions(test_runner_player PUBLIC EP_NATIVE_TEST_PATH=\"${CMAKE_CURRENT_SOURCE_DIR}/tests/assets\" ) target_compile_definitions(test_runner_player PUBLIC EP_TEST_PATH=\"/assets\" ) target_compile_definitions(test_runner_player PUBLIC DOCTEST_CONFIG_NO_EXCEPTIONS_BUT_WITH_ALL_ASSERTS=1) target_link_libraries(test_runner_player "nodefs.js") set_property(TARGET test_runner_player PROPERTY LINK_FLAGS "-sALLOW_MEMORY_GROWTH --bind") else() target_compile_definitions(test_runner_player PUBLIC EP_TEST_PATH=\"${CMAKE_CURRENT_SOURCE_DIR}/tests/assets\" ) endif() target_link_libraries(test_runner_player ${PLAYER_TEST_LIBRARIES}) if(CMAKE_COLOR_DIAGNOSTICS) set(DOCTEST_COLOROPT "--force-colors") endif() add_custom_target(check_player COMMAND test_runner_player ${DOCTEST_COLOROPT}) if(NOT TARGET check) add_custom_target(check) endif() add_dependencies(check_player test_runner_player) add_dependencies(check check_player) endif() ``` -------------------------------- ### Emscripten Shell Gamepad Event Listeners Source: https://github.com/easyrpg/player/blob/master/resources/emscripten/emscripten-shell.html Sets up event listeners for gamepad connection and disconnection. If gamepad events are not supported, it falls back to polling. ```javascript if (!haveEvents) { setInterval(scanGamePads, 500); } window.addEventListener('gamepadconnected', function(e) { addGamepad(e.gamepad); }); window.addEventListener('gamepaddisconnected', function(e) { removeGamepad(e.gamepad); }) ``` -------------------------------- ### Emscripten Platform Options Source: https://github.com/easyrpg/player/blob/master/CMakeLists.txt Configures build options for Emscripten, including whether to build a shell executable and the URL for games. ```cmake if(CMAKE_SYSTEM_NAME STREQUAL "Emscripten") option(PLAYER_JS_BUILD_SHELL "Build the Player executable as a shell file (.html) instead of a standalone javascript file (.js)" OFF) set(PLAYER_JS_GAME_URL "games/" CACHE STRING "Game URL/directory where the web player searches for games") set(PLAYER_JS_OUTPUT_NAME "easyrpg-player" CACHE STRING "Output name of the js, html and wasm files") set_property(SOURCE src/async_handler.cpp APPEND PROPERTY COMPILE_DEFINITIONS "EM_GAME_URL=\"${PLAYER_JS_GAME_URL}\"" ) endif() ``` -------------------------------- ### Configure MP3 Audio Playback (libmpg123) Source: https://github.com/easyrpg/player/blob/master/CMakeLists.txt Conditionally enables MP3 audio playback using the libmpg123 library. This option is dependent on PLAYER_HAS_AUDIO and the absence of PLAYER_NONFREE. ```cmake cmake_dependent_option(PLAYER_WITH_MPG123 "Play MP3 audio with libmpg123" ON "PLAYER_HAS_AUDIO;NOT PLAYER_NONFREE" OFF) ``` -------------------------------- ### Build libretro Core with CMake Source: https://github.com/easyrpg/player/blob/master/docs/BUILDING.md Build the libretro core of EasyRPG Player using CMake. Specify the target platform and whether to build shared libraries. ```bash cmake . -DPLAYER_TARGET_PLATFORM=libretro -DBUILD_SHARED_LIBS=ON|OFF ``` -------------------------------- ### Initialize EasyRPG Player Source: https://github.com/easyrpg/player/blob/master/resources/emscripten/emscripten-shell.html This code initializes the EasyRPG Player module when the window loads. It ensures the player is ready before interacting with the canvas. ```javascript window.addEventListener('load', (event) => { createEasyRpgPlayer({ game: undefined, saveFs: undefined }).then(function(Module) { // Module is ready easyrpgPlayer = Module; easyrpgPlayer.initApi(); canvas.focus(); // Custom code here }); }); ``` -------------------------------- ### Enable DRWAV Decoder Source: https://github.com/easyrpg/player/blob/master/CMakeLists.txt Configures the DRWAV decoder by defining WANT_DRWAV=1 and adding its source files if PLAYER_ENABLE_DRWAV is enabled. Includes the dr_wav.h header. ```cmake if(PLAYER_ENABLE_DRWAV) target_compile_definitions(${PROJECT_NAME} PUBLIC WANT_DRWAV=1) target_sources(${PROJECT_NAME} PRIVATE src/decoder_drwav.cpp src/decoder_drwav.h src/external/dr_wav.h) endif() endif() ``` -------------------------------- ### Configure Audio Resampler Source: https://github.com/easyrpg/player/blob/master/CMakeLists.txt Sets the audio resampler to be used, with options for Auto, speexDSP, libsamplerate, or none. The 'Auto' setting attempts to find speexDSP first, then libsamplerate. ```cmake set(PLAYER_AUDIO_RESAMPLER "Auto" CACHE STRING "Audio resampler to use. Options: Auto speexdsp samplerate OFF") set_property(CACHE PLAYER_AUDIO_RESAMPLER PROPERTY STRINGS Auto speexdsp samplerate OFF) if(PLAYER_AUDIO_RESAMPLER STREQUAL "Auto") set(PLAYER_AUDIO_RESAMPLER_IS_AUTO ON) endif() ``` -------------------------------- ### Configure WAV Audio Playback (libsndfile) Source: https://github.com/easyrpg/player/blob/master/CMakeLists.txt Conditionally enables WAV audio playback using the libsndfile library. This option is dependent on PLAYER_HAS_AUDIO and the absence of PLAYER_NONFREE. ```cmake cmake_dependent_option(PLAYER_WITH_LIBSNDFILE "Play WAV audio with libsndfile" ON "PLAYER_HAS_AUDIO;NOT PLAYER_NONFREE" OFF) ``` -------------------------------- ### Executable and Library Linking Source: https://github.com/easyrpg/player/blob/master/CMakeLists.txt Defines the main executable and links it with the project library. ```cmake if(PLAYER_BUILD_EXECUTABLE AND ${PLAYER_TARGET_PLATFORM} MATCHES "^SDL.*$" AND NOT PLAYER_CONSOLE_PORT) if(APPLE) set(EXE_NAME "EasyRPG-Player.app") set_source_files_properties(${PROJECT_NAME}_BUNDLE_ICON PROPERTIES MACOSX_PACKAGE_LOCATION "Resources") add_executable(${EXE_NAME} MACOSX_BUNDLE "src/platform/sdl/main.cpp" ${PROJECT_NAME}_BUNDLE_ICON) configure_file(resources/macos/Info.plist.in resources/macos/Info.plist @ONLY) set_target_properties(${EXE_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_BINARY_DIR}/resources/macos/Info.plist") set_target_properties(${EXE_NAME} PROPERTIES OUTPUT_NAME "EasyRPG Player") else() set(EXE_NAME ${PROJECT_NAME}_exe) if(CMAKE_SYSTEM_NAME STREQUAL "Emscripten") add_executable(${EXE_NAME} "src/platform/emscripten/main.cpp") else() add_executable(${EXE_NAME} "src/platform/sdl/main.cpp") endif() set_target_properties(${EXE_NAME} PROPERTIES OUTPUT_NAME "easyrpg-player") endif() if(WIN32) # Open console for Debug builds set_target_properties(${EXE_NAME} PROPERTIES WIN32_EXECUTABLE $<$>:TRUE>>) # Add resources string(REPLACE "." "," RC_VERSION ${PROJECT_VERSION}) string(TIMESTAMP RC_YEAR "%Y") configure_file(resources/windows/player.rc.in resources/windows/player.rc @ONLY) target_sources(${EXE_NAME} PRIVATE resources/windows/player.manifest "${CMAKE_CURRENT_BINARY_DIR}/resources/windows/player.rc") # Set Visual Studio startup project set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT ${EXE_NAME}) # Change executable name set_target_properties(${EXE_NAME} PROPERTIES OUTPUT_NAME "Player") endif() target_link_libraries(${EXE_NAME} ${PROJECT_NAME}) if(CMAKE_SYSTEM_NAME STREQUAL "Emscripten") # Do not confuse this with our own -DUSE_SDL # Prevent Emscripten from pulling in bundled SDL headers that break the build target_compile_options(${PROJECT_NAME} PUBLIC "-sUSE_SDL=0") set(PLAYER_JS_PREJS "${CMAKE_CURRENT_SOURCE_DIR}/resources/emscripten/emscripten-pre.js") set(PLAYER_JS_POSTJS "${CMAKE_CURRENT_SOURCE_DIR}/resources/emscripten/emscripten-post.js") set(PLAYER_JS_SHELL "${CMAKE_CURRENT_SOURCE_DIR}/resources/emscripten/emscripten-shell.html") set_property(TARGET ${EXE_NAME} PROPERTY LINK_FLAGS "-sALLOW_MEMORY_GROWTH -sMINIFY_HTML=0 -sMODULARIZE -sEXPORT_NAME=createEasyRpgPlayer -sEXIT_RUNTIME=0 --bind --pre-js ${PLAYER_JS_PREJS} --post-js ${PLAYER_JS_POSTJS} -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE=['$autoResumeAudioContext','$dynCall'] -sEXPORTED_RUNTIME_METHODS=['FS','HEAPU8'] -sEXPORTED_FUNCTIONS=_main,_malloc,_free") set_source_files_properties("src/platform/sdl/main.cpp" PROPERTIES OBJECT_DEPENDS "${PLAYER_JS_PREJS};${PLAYER_JS_POSTJS};${PLAYER_JS_SHELL}") if(PLAYER_JS_BUILD_SHELL) set_target_properties(${EXE_NAME} PROPERTIES SUFFIX ".html") set_property(TARGET ${EXE_NAME} APPEND_STRING PROPERTY LINK_FLAGS " --shell-file ${PLAYER_JS_SHELL}") endif() target_compile_options(${PROJECT_NAME} PUBLIC -fno-exceptions) target_sources(${PROJECT_NAME} PRIVATE src/platform/emscripten/clock.h src/platform/emscripten/interface.cpp src/platform/emscripten/interface.h) target_link_libraries(${EXE_NAME} "idbfs.js") set_target_properties(${EXE_NAME} PROPERTIES OUTPUT_NAME "${PLAYER_JS_OUTPUT_NAME}") endif() # installation include(GNUInstallDirs) if(APPLE) install(TARGETS ${EXE_NAME} RUNTIME DESTINATION BUNDLE DESTINATION "${CMAKE_BINARY_DIR}/Package") else() install(TARGETS ${EXE_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() if(UNIX) # Install desktop entry, icons and metainfo install(FILES resources/unix/easyrpg-player.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications) install(FILES resources/unix/icon-48.png RENAME easyrpg-player.png DESTINATION ${CMAKE_INSTALL_DATADIR}/pixmaps) # legacy install(FILES resources/unix/icon-48.png RENAME easyrpg-player.png DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/48x48/apps) install(FILES resources/unix/easyrpg-player.svg DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps) install(FILES resources/unix/easyrpg-player.metainfo.xml DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo) endif() if(MSVC) install(FILES $ DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL) endif() if(CMAKE_SYSTEM_NAME STREQUAL "Emscripten") # Emscripten does not install the wasm file (or the js file when building a shell) if(PLAYER_JS_BUILD_SHELL) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PLAYER_JS_OUTPUT_NAME}.js DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() install(FILES ${CMAKE_CURRENT_BINARY_BINARY_DIR}/${PLAYER_JS_OUTPUT_NAME}.wasm DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() elseif(PLAYER_CONSOLE_PORT AND NOT PLAYER_TARGET_PLATFORM STREQUAL "libretro") set(CPACK_PLATFORM "${PLAYER_TARGET_PLATFORM}") if(NINTENDO_3DS) ``` -------------------------------- ### Configure Ogg Vorbis Audio Playback (libvorbis) Source: https://github.com/easyrpg/player/blob/master/CMakeLists.txt Conditionally enables Ogg Vorbis audio playback using the libvorbis library. This option is dependent on PLAYER_HAS_AUDIO. ```cmake cmake_dependent_option(PLAYER_WITH_OGGVORBIS "Play Ogg Vorbis audio with libvorbis" ON "PLAYER_HAS_AUDIO" OFF) ```