Skip to content

Commit

Permalink
Added USE_RETRO_ACHIEVEMENTS compiler flag
Browse files Browse the repository at this point in the history
Added a flag to VS and CMake for enabling RetroAchievements integration.
  • Loading branch information
LillyJadeKatrin committed Apr 2, 2023
1 parent 2836fea commit f3114b5
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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(ENABLE_AUTOUPDATE "Enables support for automatic updates" ON)
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
# consider the following points:
Expand Down Expand Up @@ -975,7 +976,9 @@ add_subdirectory(Externals/rangeset)

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
Expand Down
6 changes: 5 additions & 1 deletion Source/Core/Core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,6 @@ PUBLIC
${MBEDTLS_LIBRARIES}
pugixml
RangeSet::RangeSet
rcheevos
sfml-network
sfml-system
videonull
Expand Down Expand Up @@ -748,3 +747,8 @@ if(MSVC)
# Add precompiled header
target_link_libraries(core PRIVATE use_pch)
endif()

if(USE_RETRO_ACHIEVEMENTS)
target_link_libraries(core PRIVATE rcheevos)
target_compile_definitions(core PRIVATE -DUSE_RETRO_ACHIEVEMENTS)
endif()
7 changes: 6 additions & 1 deletion Source/Core/DolphinQt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -686,4 +686,9 @@ endif()

if(USE_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()
1 change: 1 addition & 0 deletions Source/VSProps/Base.Dolphin.props
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
<PreprocessorDefinitions Condition="'$(AutoUpdate)'!='false'">AUTOUPDATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>HAVE_SDL2;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Steam)'=='true'">STEAM;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>USE_RETRO_ACHIEVEMENTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>

<!-- Warnings one may want to ignore when using Level4.
4201 nonstandard extension used : nameless struct/union
Expand Down

0 comments on commit f3114b5

Please sign in to comment.