Added USE_RETRO_ACHIEVEMENTS compiler flag

Added a flag to VS and CMake for enabling RetroAchievements integration.
This commit is contained in:
LillyJadeKatrin 2023-03-18 12:22:17 -04:00
parent 2836feac71
commit f3114b59f4
4 changed files with 16 additions and 3 deletions

View File

@ -72,6 +72,7 @@ option(USE_DISCORD_PRESENCE "Enables Discord Rich Presence, show the current gam
option(USE_MGBA "Enables GBA controllers emulation using libmgba" ON) option(USE_MGBA "Enables GBA controllers emulation using libmgba" ON)
option(ENABLE_AUTOUPDATE "Enables support for automatic updates" ON) option(ENABLE_AUTOUPDATE "Enables support for automatic updates" ON)
option(STEAM "Creates a build for Steam" OFF) option(STEAM "Creates a build for Steam" OFF)
option(USE_RETRO_ACHIEVEMENTS "Enables integration with retroachievements.org" ON)
# Maintainers: if you consider blanket disabling this for your users, please # Maintainers: if you consider blanket disabling this for your users, please
# consider the following points: # consider the following points:
@ -975,7 +976,9 @@ add_subdirectory(Externals/rangeset)
add_subdirectory(Externals/FatFs) add_subdirectory(Externals/FatFs)
add_subdirectory(Externals/rcheevos) if (USE_RETRO_ACHIEVEMENTS)
add_subdirectory(Externals/rcheevos)
endif()
######################################## ########################################
# Pre-build events: Define configuration variables and write SCM info header # Pre-build events: Define configuration variables and write SCM info header

View File

@ -602,7 +602,6 @@ PUBLIC
${MBEDTLS_LIBRARIES} ${MBEDTLS_LIBRARIES}
pugixml pugixml
RangeSet::RangeSet RangeSet::RangeSet
rcheevos
sfml-network sfml-network
sfml-system sfml-system
videonull videonull
@ -748,3 +747,8 @@ if(MSVC)
# Add precompiled header # Add precompiled header
target_link_libraries(core PRIVATE use_pch) target_link_libraries(core PRIVATE use_pch)
endif() endif()
if(USE_RETRO_ACHIEVEMENTS)
target_link_libraries(core PRIVATE rcheevos)
target_compile_definitions(core PRIVATE -DUSE_RETRO_ACHIEVEMENTS)
endif()

View File

@ -686,4 +686,9 @@ endif()
if(USE_DISCORD_PRESENCE) if(USE_DISCORD_PRESENCE)
target_compile_definitions(dolphin-emu PRIVATE -DUSE_DISCORD_PRESENCE) target_compile_definitions(dolphin-emu PRIVATE -DUSE_DISCORD_PRESENCE)
endif() endif()
if(USE_RETRO_ACHIEVEMENTS)
target_link_libraries(dolphin-emu PRIVATE rcheevos)
target_compile_definitions(dolphin-emu PRIVATE -DUSE_RETRO_ACHIEVEMENTS)
endif()

View File

@ -45,6 +45,7 @@
<PreprocessorDefinitions Condition="'$(AutoUpdate)'!='false'">AUTOUPDATE;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions Condition="'$(AutoUpdate)'!='false'">AUTOUPDATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>HAVE_SDL2;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>HAVE_SDL2;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Steam)'=='true'">STEAM;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions Condition="'$(Steam)'=='true'">STEAM;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>USE_RETRO_ACHIEVEMENTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<!-- Warnings one may want to ignore when using Level4. <!-- Warnings one may want to ignore when using Level4.
4201 nonstandard extension used : nameless struct/union 4201 nonstandard extension used : nameless struct/union