CMake: Swap USE_ and WITH_ for ENABLE_

Consistency.
This commit is contained in:
Stenzek 2023-09-17 12:28:11 +10:00
parent 57cdb180c6
commit 68b59ee748
39 changed files with 187 additions and 187 deletions

View file

@ -239,7 +239,7 @@ jobs:
run: | run: |
mkdir build mkdir build
cd build cd build
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_NOGUI_FRONTEND=OFF -DBUILD_QT_FRONTEND=ON -DBUILD_TESTS=OFF -DUSE_WAYLAND=ON -DUSE_X11=ON -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_PREFIX_PATH=$HOME/deps -DCMAKE_TOOLCHAIN_FILE=../scripts/clang-toolchain.cmake .. cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_PREFIX_PATH=$HOME/deps -DCMAKE_TOOLCHAIN_FILE=../scripts/clang-toolchain.cmake ..
cmake --build . --parallel cmake --build . --parallel
cd .. cd ..
scripts/make-appimage.sh $(realpath .) $(realpath ./build) $HOME/deps DuckStation-x64 scripts/make-appimage.sh $(realpath .) $(realpath ./build) $HOME/deps DuckStation-x64

View file

@ -32,11 +32,11 @@ if(NOT ANDROID)
set(ENABLE_CUBEB ON) set(ENABLE_CUBEB ON)
set(ENABLE_DISCORD_PRESENCE ON) set(ENABLE_DISCORD_PRESENCE ON)
set(USE_SDL2 ON) set(ENABLE_SDL2 ON)
if(LINUX OR FREEBSD) if(LINUX OR FREEBSD)
option(USE_X11 "Support X11 window system" ON) option(ENABLE_X11 "Support X11 window system" ON)
option(USE_WAYLAND "Support Wayland window system" ON) option(ENABLE_WAYLAND "Support Wayland window system" ON)
endif() endif()
if(APPLE) if(APPLE)
option(SKIP_POSTPROCESS_BUNDLE "Disable bundle post-processing, including Qt additions" OFF) option(SKIP_POSTPROCESS_BUNDLE "Disable bundle post-processing, including Qt additions" OFF)
@ -45,7 +45,7 @@ endif()
# Required libraries. # Required libraries.
if(USE_SDL2) if(ENABLE_SDL2)
find_package(SDL2 2.28.2 REQUIRED) find_package(SDL2 2.28.2 REQUIRED)
endif() endif()
if(NOT WIN32 AND NOT ANDROID) if(NOT WIN32 AND NOT ANDROID)
@ -65,17 +65,17 @@ endif()
# Everything except Windows/Mac use EGL. # Everything except Windows/Mac use EGL.
if(ENABLE_OPENGL AND (LINUX OR FREEBSD OR ANDROID)) if(ENABLE_OPENGL AND (LINUX OR FREEBSD OR ANDROID))
find_package(EGL REQUIRED) find_package(EGL REQUIRED)
set(USE_EGL TRUE) set(ENABLE_EGL TRUE)
endif() endif()
if(USE_X11) if(ENABLE_X11)
find_package(X11 REQUIRED) find_package(X11 REQUIRED)
if (NOT X11_Xrandr_FOUND) if (NOT X11_Xrandr_FOUND)
message(FATAL_ERROR "XRandR extension is required") message(FATAL_ERROR "XRandR extension is required")
endif() endif()
endif() endif()
if(USE_WAYLAND) if(ENABLE_WAYLAND)
message(STATUS "Wayland support enabled") message(STATUS "Wayland support enabled")
endif() endif()

View file

@ -16,7 +16,7 @@ echo "Build x64..."
mkdir build-x64 mkdir build-x64
cd build-x64 cd build-x64
export MACOSX_DEPLOYMENT_TARGET=11.0 export MACOSX_DEPLOYMENT_TARGET=11.0
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_NOGUI_FRONTEND=OFF -DBUILD_QT_FRONTEND=ON -DUSE_SDL2=ON -DENABLE_OPENGL=OFF -DCMAKE_PREFIX_PATH="$DEPS" -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -G Ninja "../$SOURCEDIR" cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_OPENGL=OFF -DCMAKE_PREFIX_PATH="$DEPS" -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -G Ninja "../$SOURCEDIR"
cmake --build . --parallel cmake --build . --parallel
cd .. cd ..
@ -24,7 +24,7 @@ echo "Build arm64..."
mkdir build-arm64 mkdir build-arm64
cd build-arm64 cd build-arm64
export MACOSX_DEPLOYMENT_TARGET=11.00 export MACOSX_DEPLOYMENT_TARGET=11.00
cmake -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_BUILD_TYPE=Release -DBUILD_NOGUI_FRONTEND=OFF -DBUILD_QT_FRONTEND=ON -DUSE_SDL2=ON -DENABLE_OPENGL=OFF -DCMAKE_PREFIX_PATH="$DEPS" -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -G Ninja "../$SOURCEDIR" cmake -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_BUILD_TYPE=Release -DENABLE_OPENGL=OFF -DCMAKE_PREFIX_PATH="$DEPS" -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -G Ninja "../$SOURCEDIR"
cmake --build . --parallel cmake --build . --parallel
cd .. cd ..

View file

@ -94,7 +94,7 @@ if(NOT WIN32 AND NOT ANDROID)
) )
if(LIBBACKTRACE_FOUND) if(LIBBACKTRACE_FOUND)
target_compile_definitions(common PRIVATE "-DUSE_LIBBACKTRACE=1") target_compile_definitions(common PRIVATE "-DENABLE_LIBBACKTRACE=1")
target_link_libraries(common PRIVATE libbacktrace::libbacktrace) target_link_libraries(common PRIVATE libbacktrace::libbacktrace)
endif() endif()
endif() endif()

View file

@ -202,7 +202,7 @@ void CrashHandler::Uninstall()
} }
} }
#elif defined(USE_LIBBACKTRACE) #elif defined(ENABLE_LIBBACKTRACE)
#include <backtrace.h> #include <backtrace.h>
#include <cstdarg> #include <cstdarg>

View file

@ -128,23 +128,23 @@ target_link_libraries(core PRIVATE stb xxhash imgui rapidjson rcheevos)
if(${CPU_ARCH} STREQUAL "x64") if(${CPU_ARCH} STREQUAL "x64")
target_include_directories(core PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/../../dep/xbyak/xbyak") target_include_directories(core PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/../../dep/xbyak/xbyak")
target_compile_definitions(core PUBLIC "XBYAK_NO_EXCEPTION=1" "WITH_RECOMPILER=1" "WITH_MMAP_FASTMEM=1") target_compile_definitions(core PUBLIC "XBYAK_NO_EXCEPTION=1" "ENABLE_RECOMPILER=1" "ENABLE_MMAP_FASTMEM=1")
target_sources(core PRIVATE ${RECOMPILER_SRCS} target_sources(core PRIVATE ${RECOMPILER_SRCS}
cpu_recompiler_code_generator_x64.cpp cpu_recompiler_code_generator_x64.cpp
) )
message("Building x64 recompiler") message("Building x64 recompiler")
elseif(${CPU_ARCH} STREQUAL "aarch32") elseif(${CPU_ARCH} STREQUAL "aarch32")
target_compile_definitions(core PUBLIC "WITH_RECOMPILER=1") target_compile_definitions(core PUBLIC "ENABLE_RECOMPILER=1")
target_sources(core PRIVATE ${RECOMPILER_SRCS} target_sources(core PRIVATE ${RECOMPILER_SRCS}
cpu_recompiler_code_generator_aarch32.cpp cpu_recompiler_code_generator_aarch32.cpp
) )
target_link_libraries(core PUBLIC vixl) target_link_libraries(core PUBLIC vixl)
message("Building AArch32 recompiler") message("Building AArch32 recompiler")
elseif(${CPU_ARCH} STREQUAL "aarch64") elseif(${CPU_ARCH} STREQUAL "aarch64")
target_compile_definitions(core PUBLIC "WITH_RECOMPILER=1") target_compile_definitions(core PUBLIC "ENABLE_RECOMPILER=1")
if (NOT APPLE) if (NOT APPLE)
# Disabled until we support 16K pages. # Disabled until we support 16K pages.
target_compile_definitions(core PUBLIC "WITH_MMAP_FASTMEM=1") target_compile_definitions(core PUBLIC "ENABLE_MMAP_FASTMEM=1")
endif() endif()
target_sources(core PRIVATE ${RECOMPILER_SRCS} target_sources(core PRIVATE ${RECOMPILER_SRCS}
cpu_recompiler_code_generator_aarch64.cpp cpu_recompiler_code_generator_aarch64.cpp
@ -156,7 +156,7 @@ else()
endif() endif()
if(ENABLE_DISCORD_PRESENCE) if(ENABLE_DISCORD_PRESENCE)
target_compile_definitions(core PUBLIC -DWITH_DISCORD_PRESENCE=1) target_compile_definitions(core PUBLIC -DENABLE_DISCORD_PRESENCE=1)
target_link_libraries(core PRIVATE discord-rpc) target_link_libraries(core PRIVATE discord-rpc)
endif() endif()

View file

@ -52,7 +52,7 @@
Log_SetChannel(Achievements); Log_SetChannel(Achievements);
#ifdef WITH_RAINTEGRATION #ifdef ENABLE_RAINTEGRATION
// RA_Interface ends up including windows.h, with its silly macros. // RA_Interface ends up including windows.h, with its silly macros.
#ifdef _WIN32 #ifdef _WIN32
#include "common/windows_headers.h" #include "common/windows_headers.h"
@ -184,7 +184,7 @@ static void CloseLeaderboard();
static bool s_hardcore_mode = false; static bool s_hardcore_mode = false;
#ifdef WITH_RAINTEGRATION #ifdef ENABLE_RAINTEGRATION
static bool s_using_raintegration = false; static bool s_using_raintegration = false;
#endif #endif
@ -317,7 +317,7 @@ void Achievements::DownloadImage(std::string url, std::string cache_filename)
bool Achievements::IsActive() bool Achievements::IsActive()
{ {
#ifdef WITH_RAINTEGRATION #ifdef ENABLE_RAINTEGRATION
return (s_client != nullptr) || s_using_raintegration; return (s_client != nullptr) || s_using_raintegration;
#else #else
return (s_client != nullptr); return (s_client != nullptr);
@ -326,7 +326,7 @@ bool Achievements::IsActive()
bool Achievements::IsHardcoreModeActive() bool Achievements::IsHardcoreModeActive()
{ {
#ifdef WITH_RAINTEGRATION #ifdef ENABLE_RAINTEGRATION
if (IsUsingRAIntegration()) if (IsUsingRAIntegration())
return RA_HardcoreModeIsActive() != 0; return RA_HardcoreModeIsActive() != 0;
#endif #endif
@ -500,7 +500,7 @@ void Achievements::UpdateSettings(const Settings& old_config)
bool Achievements::Shutdown(bool allow_cancel) bool Achievements::Shutdown(bool allow_cancel)
{ {
#ifdef WITH_RAINTEGRATION #ifdef ENABLE_RAINTEGRATION
if (IsUsingRAIntegration()) if (IsUsingRAIntegration())
{ {
if (System::IsValid() && allow_cancel && !RA_ConfirmLoadNewRom(true)) if (System::IsValid() && allow_cancel && !RA_ConfirmLoadNewRom(true))
@ -612,7 +612,7 @@ void Achievements::IdleUpdate()
if (!IsActive()) if (!IsActive())
return; return;
#ifdef WITH_RAINTEGRATION #ifdef ENABLE_RAINTEGRATION
if (IsUsingRAIntegration()) if (IsUsingRAIntegration())
return; return;
#endif #endif
@ -628,7 +628,7 @@ void Achievements::FrameUpdate()
if (!IsActive()) if (!IsActive())
return; return;
#ifdef WITH_RAINTEGRATION #ifdef ENABLE_RAINTEGRATION
if (IsUsingRAIntegration()) if (IsUsingRAIntegration())
{ {
RA_DoAchievementsFrame(); RA_DoAchievementsFrame();
@ -748,7 +748,7 @@ void Achievements::UpdateRichPresence(std::unique_lock<std::recursive_mutex>& lo
Log_InfoPrintf("Rich presence updated: %s", s_rich_presence_string.c_str()); Log_InfoPrintf("Rich presence updated: %s", s_rich_presence_string.c_str());
Host::OnAchievementsRefreshed(); Host::OnAchievementsRefreshed();
#ifdef WITH_DISCORD_PRESCENCE #ifdef ENABLE_DISCORD_PRESENCE
lock.unlock(); lock.unlock();
System::UpdateDiscordPresence(); System::UpdateDiscordPresence();
lock.lock(); lock.lock();
@ -780,7 +780,7 @@ void Achievements::CancelGameLoad()
DisableHardcoreMode(); DisableHardcoreMode();
Host::OnAchievementsRefreshed(); Host::OnAchievementsRefreshed();
#ifdef WITH_RAINTEGRATION #ifdef ENABLE_RAINTEGRATION
if (IsUsingRAIntegration()) if (IsUsingRAIntegration())
{ {
RAIntegration::GameChanged(); RAIntegration::GameChanged();
@ -828,7 +828,7 @@ void Achievements::IdentifyGame(const std::string& path, CDImage* image)
s_game_path = path; s_game_path = path;
s_game_hash = std::move(game_hash); s_game_hash = std::move(game_hash);
#ifdef WITH_RAINTEGRATION #ifdef ENABLE_RAINTEGRATION
if (IsUsingRAIntegration()) if (IsUsingRAIntegration())
{ {
RAIntegration::GameChanged(); RAIntegration::GameChanged();
@ -1280,7 +1280,7 @@ void Achievements::HandleServerReconnectedEvent(const rc_client_event_t* event)
void Achievements::ResetClient() void Achievements::ResetClient()
{ {
#ifdef WITH_RAINTEGRATION #ifdef ENABLE_RAINTEGRATION
if (IsUsingRAIntegration()) if (IsUsingRAIntegration())
{ {
RA_OnReset(); RA_OnReset();
@ -1297,7 +1297,7 @@ void Achievements::ResetClient()
void Achievements::OnSystemPaused(bool paused) void Achievements::OnSystemPaused(bool paused)
{ {
#ifdef WITH_RAINTEGRATION #ifdef ENABLE_RAINTEGRATION
if (IsUsingRAIntegration()) if (IsUsingRAIntegration())
RA_SetPaused(paused); RA_SetPaused(paused);
#endif #endif
@ -1308,7 +1308,7 @@ void Achievements::DisableHardcoreMode()
if (!IsActive()) if (!IsActive())
return; return;
#ifdef WITH_RAINTEGRATION #ifdef ENABLE_RAINTEGRATION
if (IsUsingRAIntegration()) if (IsUsingRAIntegration())
{ {
if (RA_HardcoreModeIsActive()) if (RA_HardcoreModeIsActive())
@ -1397,7 +1397,7 @@ bool Achievements::DoState(StateWrapper& sw)
{ {
// reset runtime, no data (state might've been created without cheevos) // reset runtime, no data (state might've been created without cheevos)
Log_DevPrintf("State is missing cheevos data, resetting runtime"); Log_DevPrintf("State is missing cheevos data, resetting runtime");
#ifdef WITH_RAINTEGRATION #ifdef ENABLE_RAINTEGRATION
if (IsUsingRAIntegration()) if (IsUsingRAIntegration())
RA_OnReset(); RA_OnReset();
else else
@ -1414,7 +1414,7 @@ bool Achievements::DoState(StateWrapper& sw)
if (sw.HasError()) if (sw.HasError())
return false; return false;
#ifdef WITH_RAINTEGRATION #ifdef ENABLE_RAINTEGRATION
if (IsUsingRAIntegration()) if (IsUsingRAIntegration())
{ {
RA_RestoreState(reinterpret_cast<const char*>(data.get())); RA_RestoreState(reinterpret_cast<const char*>(data.get()));
@ -1437,7 +1437,7 @@ bool Achievements::DoState(StateWrapper& sw)
u32 data_size; u32 data_size;
std::unique_ptr<u8[]> data; std::unique_ptr<u8[]> data;
#ifdef WITH_RAINTEGRATION #ifdef ENABLE_RAINTEGRATION
if (IsUsingRAIntegration()) if (IsUsingRAIntegration())
{ {
const int size = RA_CaptureState(nullptr, 0); const int size = RA_CaptureState(nullptr, 0);
@ -1712,7 +1712,7 @@ void Achievements::Logout()
bool Achievements::ConfirmSystemReset() bool Achievements::ConfirmSystemReset()
{ {
#ifdef WITH_RAINTEGRATION #ifdef ENABLE_RAINTEGRATION
if (IsUsingRAIntegration()) if (IsUsingRAIntegration())
return RA_ConfirmLoadNewRom(false); return RA_ConfirmLoadNewRom(false);
#endif #endif
@ -1722,7 +1722,7 @@ bool Achievements::ConfirmSystemReset()
bool Achievements::ConfirmHardcoreModeDisable(const char* trigger) bool Achievements::ConfirmHardcoreModeDisable(const char* trigger)
{ {
#ifdef WITH_RAINTEGRATION #ifdef ENABLE_RAINTEGRATION
if (IsUsingRAIntegration()) if (IsUsingRAIntegration())
return (RA_WarnDisableHardcore(trigger) != 0); return (RA_WarnDisableHardcore(trigger) != 0);
#endif #endif
@ -2829,7 +2829,7 @@ void Achievements::CloseLeaderboard()
s_open_leaderboard = nullptr; s_open_leaderboard = nullptr;
} }
#ifdef WITH_RAINTEGRATION #ifdef ENABLE_RAINTEGRATION
#include "RA_Consoles.h" #include "RA_Consoles.h"

View file

@ -126,7 +126,7 @@ bool PrepareLeaderboardsWindow();
/// Renders the leaderboard list. /// Renders the leaderboard list.
void DrawLeaderboardsWindow(); void DrawLeaderboardsWindow();
#ifdef WITH_RAINTEGRATION #ifdef ENABLE_RAINTEGRATION
/// Prevents the internal implementation from being used. Instead, RAIntegration will be /// Prevents the internal implementation from being used. Instead, RAIntegration will be
/// called into when achievement-related events occur. /// called into when achievement-related events occur.
void SwitchToRAIntegration(); void SwitchToRAIntegration();

View file

@ -116,7 +116,7 @@ static Common::MemoryArena m_memory_arena;
static CPUFastmemMode m_fastmem_mode = CPUFastmemMode::Disabled; static CPUFastmemMode m_fastmem_mode = CPUFastmemMode::Disabled;
#ifdef WITH_MMAP_FASTMEM #ifdef ENABLE_MMAP_FASTMEM
static u8* m_fastmem_base = nullptr; static u8* m_fastmem_base = nullptr;
static std::vector<Common::MemoryArena::View> m_fastmem_ram_views; static std::vector<Common::MemoryArena::View> m_fastmem_ram_views;
static std::vector<Common::MemoryArena::View> m_fastmem_reserved_views; static std::vector<Common::MemoryArena::View> m_fastmem_reserved_views;
@ -164,7 +164,7 @@ void Shutdown()
std::free(m_fastmem_lut); std::free(m_fastmem_lut);
m_fastmem_lut = nullptr; m_fastmem_lut = nullptr;
#ifdef WITH_MMAP_FASTMEM #ifdef ENABLE_MMAP_FASTMEM
m_fastmem_base = nullptr; m_fastmem_base = nullptr;
m_fastmem_ram_views.clear(); m_fastmem_ram_views.clear();
#endif #endif
@ -381,7 +381,7 @@ CPUFastmemMode GetFastmemMode()
u8* GetFastmemBase() u8* GetFastmemBase()
{ {
#ifdef WITH_MMAP_FASTMEM #ifdef ENABLE_MMAP_FASTMEM
if (m_fastmem_mode == CPUFastmemMode::MMap) if (m_fastmem_mode == CPUFastmemMode::MMap)
return m_fastmem_base; return m_fastmem_base;
#endif #endif
@ -393,7 +393,7 @@ u8* GetFastmemBase()
void UpdateFastmemViews(CPUFastmemMode mode) void UpdateFastmemViews(CPUFastmemMode mode)
{ {
#ifndef WITH_MMAP_FASTMEM #ifndef ENABLE_MMAP_FASTMEM
Assert(mode != CPUFastmemMode::MMap); Assert(mode != CPUFastmemMode::MMap);
#else #else
m_fastmem_ram_views.clear(); m_fastmem_ram_views.clear();
@ -403,7 +403,7 @@ void UpdateFastmemViews(CPUFastmemMode mode)
m_fastmem_mode = mode; m_fastmem_mode = mode;
if (mode == CPUFastmemMode::Disabled) if (mode == CPUFastmemMode::Disabled)
{ {
#ifdef WITH_MMAP_FASTMEM #ifdef ENABLE_MMAP_FASTMEM
m_fastmem_base = nullptr; m_fastmem_base = nullptr;
#endif #endif
std::free(m_fastmem_lut); std::free(m_fastmem_lut);
@ -411,7 +411,7 @@ void UpdateFastmemViews(CPUFastmemMode mode)
return; return;
} }
#ifdef WITH_MMAP_FASTMEM #ifdef ENABLE_MMAP_FASTMEM
if (mode == CPUFastmemMode::MMap) if (mode == CPUFastmemMode::MMap)
{ {
std::free(m_fastmem_lut); std::free(m_fastmem_lut);
@ -488,7 +488,7 @@ void UpdateFastmemViews(CPUFastmemMode mode)
} }
#endif #endif
#ifdef WITH_MMAP_FASTMEM #ifdef ENABLE_MMAP_FASTMEM
m_fastmem_base = nullptr; m_fastmem_base = nullptr;
#endif #endif
@ -533,7 +533,7 @@ bool CanUseFastmemForAddress(VirtualMemoryAddress address)
switch (m_fastmem_mode) switch (m_fastmem_mode)
{ {
#ifdef WITH_MMAP_FASTMEM #ifdef ENABLE_MMAP_FASTMEM
case CPUFastmemMode::MMap: case CPUFastmemMode::MMap:
{ {
// Currently since we don't map the mirrors, don't use fastmem for them. // Currently since we don't map the mirrors, don't use fastmem for them.
@ -578,7 +578,7 @@ void ClearRAMCodePage(u32 index)
void SetCodePageFastmemProtection(u32 page_index, bool writable) void SetCodePageFastmemProtection(u32 page_index, bool writable)
{ {
#ifdef WITH_MMAP_FASTMEM #ifdef ENABLE_MMAP_FASTMEM
if (m_fastmem_mode == CPUFastmemMode::MMap) if (m_fastmem_mode == CPUFastmemMode::MMap)
{ {
// unprotect fastmem pages // unprotect fastmem pages
@ -609,7 +609,7 @@ void ClearRAMCodePageFlags()
{ {
m_ram_code_bits.reset(); m_ram_code_bits.reset();
#ifdef WITH_MMAP_FASTMEM #ifdef ENABLE_MMAP_FASTMEM
if (m_fastmem_mode == CPUFastmemMode::MMap) if (m_fastmem_mode == CPUFastmemMode::MMap)
{ {
// unprotect fastmem pages // unprotect fastmem pages

View file

@ -89,7 +89,7 @@ enum : size_t
// Offsets within the memory arena. // Offsets within the memory arena.
MEMORY_ARENA_RAM_OFFSET = 0, MEMORY_ARENA_RAM_OFFSET = 0,
#ifdef WITH_MMAP_FASTMEM #ifdef ENABLE_MMAP_FASTMEM
// Fastmem region size is 4GB to cover the entire 32-bit address space. // Fastmem region size is 4GB to cover the entire 32-bit address space.
FASTMEM_REGION_SIZE = UINT64_C(0x100000000), FASTMEM_REGION_SIZE = UINT64_C(0x100000000),
#endif #endif

View file

@ -4,10 +4,10 @@
<ItemDefinitionGroup> <ItemDefinitionGroup>
<ClCompile> <ClCompile>
<PreprocessorDefinitions>WITH_DISCORD_PRESENCE=1;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>ENABLE_DISCORD_PRESENCE=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="('$(Platform)'!='ARM64')">WITH_RAINTEGRATION=1;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions Condition="('$(Platform)'!='ARM64')">ENABLE_RAINTEGRATION=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="('$(Platform)'=='x64' Or '$(Platform)'=='ARM' Or '$(Platform)'=='ARM64')">WITH_RECOMPILER=1;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions Condition="('$(Platform)'=='x64' Or '$(Platform)'=='ARM' Or '$(Platform)'=='ARM64')">ENABLE_RECOMPILER=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="('$(Platform)'=='x64' Or '$(Platform)'=='ARM64')">WITH_MMAP_FASTMEM=1;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions Condition="('$(Platform)'=='x64' Or '$(Platform)'=='ARM64')">ENABLE_MMAP_FASTMEM=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(SolutionDir)dep\xxhash\include;$(SolutionDir)dep\zlib\include;$(SolutionDir)dep\rcheevos\include;$(SolutionDir)dep\rapidjson\include;$(SolutionDir)dep\discord-rpc\include</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(SolutionDir)dep\xxhash\include;$(SolutionDir)dep\zlib\include;$(SolutionDir)dep\rcheevos\include;$(SolutionDir)dep\rapidjson\include;$(SolutionDir)dep\discord-rpc\include</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Platform)'!='ARM64'">%(AdditionalIncludeDirectories);$(SolutionDir)dep\rainterface</AdditionalIncludeDirectories> <AdditionalIncludeDirectories Condition="'$(Platform)'!='ARM64'">%(AdditionalIncludeDirectories);$(SolutionDir)dep\rainterface</AdditionalIncludeDirectories>

View file

@ -14,7 +14,7 @@
#include "timing_event.h" #include "timing_event.h"
Log_SetChannel(CPU::CodeCache); Log_SetChannel(CPU::CodeCache);
#ifdef WITH_RECOMPILER #ifdef ENABLE_RECOMPILER
#include "cpu_recompiler_code_generator.h" #include "cpu_recompiler_code_generator.h"
#endif #endif
@ -29,7 +29,7 @@ static constexpr u32 RECOMPILE_FRAMES_TO_FALL_BACK_TO_INTERPRETER = 100;
static constexpr u32 RECOMPILE_COUNT_TO_FALL_BACK_TO_INTERPRETER = 20; static constexpr u32 RECOMPILE_COUNT_TO_FALL_BACK_TO_INTERPRETER = 20;
static constexpr u32 INVALIDATE_THRESHOLD_TO_DISABLE_LINKING = 10; static constexpr u32 INVALIDATE_THRESHOLD_TO_DISABLE_LINKING = 10;
#ifdef WITH_RECOMPILER #ifdef ENABLE_RECOMPILER
// Currently remapping the code buffer doesn't work in macOS or Haiku. // Currently remapping the code buffer doesn't work in macOS or Haiku.
#if !defined(__HAIKU__) && !defined(__APPLE__) #if !defined(__HAIKU__) && !defined(__APPLE__)
@ -56,7 +56,7 @@ static JitCodeBuffer s_code_buffer;
#endif #endif
#ifdef WITH_RECOMPILER #ifdef ENABLE_RECOMPILER
static FastMapTable s_fast_map[FAST_MAP_TABLE_COUNT]; static FastMapTable s_fast_map[FAST_MAP_TABLE_COUNT];
static std::unique_ptr<CodeBlock::HostCodePointer[]> s_fast_map_pointers; static std::unique_ptr<CodeBlock::HostCodePointer[]> s_fast_map_pointers;
@ -227,7 +227,7 @@ static void ClearState();
static BlockMap s_blocks; static BlockMap s_blocks;
static std::array<std::vector<CodeBlock*>, Bus::RAM_8MB_CODE_PAGE_COUNT> m_ram_block_map; static std::array<std::vector<CodeBlock*>, Bus::RAM_8MB_CODE_PAGE_COUNT> m_ram_block_map;
#ifdef WITH_RECOMPILER #ifdef ENABLE_RECOMPILER
static HostCodeMap s_host_code_map; static HostCodeMap s_host_code_map;
static void AddBlockToHostCodeMap(CodeBlock* block); static void AddBlockToHostCodeMap(CodeBlock* block);
@ -237,17 +237,17 @@ static bool InitializeFastmem();
static void ShutdownFastmem(); static void ShutdownFastmem();
static Common::PageFaultHandler::HandlerResult LUTPageFaultHandler(void* exception_pc, void* fault_address, static Common::PageFaultHandler::HandlerResult LUTPageFaultHandler(void* exception_pc, void* fault_address,
bool is_write); bool is_write);
#ifdef WITH_MMAP_FASTMEM #ifdef ENABLE_MMAP_FASTMEM
static Common::PageFaultHandler::HandlerResult MMapPageFaultHandler(void* exception_pc, void* fault_address, static Common::PageFaultHandler::HandlerResult MMapPageFaultHandler(void* exception_pc, void* fault_address,
bool is_write); bool is_write);
#endif #endif
#endif // WITH_RECOMPILER #endif // ENABLE_RECOMPILER
void Initialize() void Initialize()
{ {
Assert(s_blocks.empty()); Assert(s_blocks.empty());
#ifdef WITH_RECOMPILER #ifdef ENABLE_RECOMPILER
if (g_settings.IsUsingRecompiler()) if (g_settings.IsUsingRecompiler())
{ {
#ifdef USE_STATIC_CODE_BUFFER #ifdef USE_STATIC_CODE_BUFFER
@ -266,7 +266,7 @@ void Initialize()
AllocateFastMap(); AllocateFastMap();
#ifdef WITH_RECOMPILER #ifdef ENABLE_RECOMPILER
if (g_settings.IsUsingRecompiler()) if (g_settings.IsUsingRecompiler())
{ {
if (g_settings.IsUsingFastmem() && !InitializeFastmem()) if (g_settings.IsUsingFastmem() && !InitializeFastmem())
@ -289,7 +289,7 @@ void ClearState()
delete it.second; delete it.second;
s_blocks.clear(); s_blocks.clear();
#ifdef WITH_RECOMPILER #ifdef ENABLE_RECOMPILER
s_host_code_map.clear(); s_host_code_map.clear();
s_code_buffer.Reset(); s_code_buffer.Reset();
ResetFastMap(); ResetFastMap();
@ -299,7 +299,7 @@ void ClearState()
void Shutdown() void Shutdown()
{ {
ClearState(); ClearState();
#ifdef WITH_RECOMPILER #ifdef ENABLE_RECOMPILER
ShutdownFastmem(); ShutdownFastmem();
FreeFastMap(); FreeFastMap();
s_code_buffer.Destroy(); s_code_buffer.Destroy();
@ -395,7 +395,7 @@ template<PGXPMode pgxp_mode>
g_state.npc = g_state.pc; g_state.npc = g_state.pc;
} }
#ifdef WITH_RECOMPILER #ifdef ENABLE_RECOMPILER
void CompileDispatcher() void CompileDispatcher()
{ {
@ -449,7 +449,7 @@ FastMapTable* GetFastMapPointer()
{ {
switch (g_settings.cpu_execution_mode) switch (g_settings.cpu_execution_mode)
{ {
#ifdef WITH_RECOMPILER #ifdef ENABLE_RECOMPILER
case CPUExecutionMode::Recompiler: case CPUExecutionMode::Recompiler:
ExecuteRecompiler(); ExecuteRecompiler();
break; break;
@ -473,7 +473,7 @@ FastMapTable* GetFastMapPointer()
} }
} }
#if defined(WITH_RECOMPILER) #if defined(ENABLE_RECOMPILER)
JitCodeBuffer& GetCodeBuffer() JitCodeBuffer& GetCodeBuffer()
{ {
@ -486,11 +486,11 @@ void Reinitialize()
{ {
ClearState(); ClearState();
#ifdef WITH_RECOMPILER #ifdef ENABLE_RECOMPILER
ShutdownFastmem(); ShutdownFastmem();
#endif #endif
#if defined(WITH_RECOMPILER) #if defined(ENABLE_RECOMPILER)
s_code_buffer.Destroy(); s_code_buffer.Destroy();
if (g_settings.IsUsingRecompiler()) if (g_settings.IsUsingRecompiler())
@ -507,7 +507,7 @@ void Reinitialize()
} }
#endif #endif
#ifdef WITH_RECOMPILER #ifdef ENABLE_RECOMPILER
if (g_settings.IsUsingRecompiler()) if (g_settings.IsUsingRecompiler())
{ {
if (g_settings.IsUsingFastmem() && !InitializeFastmem()) if (g_settings.IsUsingFastmem() && !InitializeFastmem())
@ -523,7 +523,7 @@ void Reinitialize()
void Flush() void Flush()
{ {
ClearState(); ClearState();
#ifdef WITH_RECOMPILER #ifdef ENABLE_RECOMPILER
if (g_settings.IsUsingRecompiler()) if (g_settings.IsUsingRecompiler())
CompileDispatcher(); CompileDispatcher();
#endif #endif
@ -601,7 +601,7 @@ CodeBlock* LookupBlock(CodeBlockKey key, bool allow_flush)
// add it to the page map if it's in ram // add it to the page map if it's in ram
AddBlockToPageMap(block); AddBlockToPageMap(block);
#ifdef WITH_RECOMPILER #ifdef ENABLE_RECOMPILER
SetFastMap(block->GetPC(), block->host_code); SetFastMap(block->GetPC(), block->host_code);
AddBlockToHostCodeMap(block); AddBlockToHostCodeMap(block);
#endif #endif
@ -636,7 +636,7 @@ bool RevalidateBlock(CodeBlock* block, bool allow_flush)
// re-add it to the page map since it's still up-to-date // re-add it to the page map since it's still up-to-date
block->invalidated = false; block->invalidated = false;
AddBlockToPageMap(block); AddBlockToPageMap(block);
#ifdef WITH_RECOMPILER #ifdef ENABLE_RECOMPILER
SetFastMap(block->GetPC(), block->host_code); SetFastMap(block->GetPC(), block->host_code);
#endif #endif
return true; return true;
@ -647,7 +647,7 @@ recompile:
// and we don't want to nuke the block we're compiling... // and we don't want to nuke the block we're compiling...
RemoveReferencesToBlock(block); RemoveReferencesToBlock(block);
#ifdef WITH_RECOMPILER #ifdef ENABLE_RECOMPILER
RemoveBlockFromHostCodeMap(block); RemoveBlockFromHostCodeMap(block);
#endif #endif
@ -684,7 +684,7 @@ recompile:
AddBlockToPageMap(block); AddBlockToPageMap(block);
#ifdef WITH_RECOMPILER #ifdef ENABLE_RECOMPILER
// re-add to page map again // re-add to page map again
SetFastMap(block->GetPC(), block->host_code); SetFastMap(block->GetPC(), block->host_code);
AddBlockToHostCodeMap(block); AddBlockToHostCodeMap(block);
@ -809,7 +809,7 @@ bool CompileBlock(CodeBlock* block, bool allow_flush)
return false; return false;
} }
#ifdef WITH_RECOMPILER #ifdef ENABLE_RECOMPILER
if (g_settings.IsUsingRecompiler()) if (g_settings.IsUsingRecompiler())
{ {
// Ensure we're not going to run out of space while compiling this block. // Ensure we're not going to run out of space while compiling this block.
@ -846,7 +846,7 @@ bool CompileBlock(CodeBlock* block, bool allow_flush)
return true; return true;
} }
#ifdef WITH_RECOMPILER #ifdef ENABLE_RECOMPILER
void FastCompileBlockFunction() void FastCompileBlockFunction()
{ {
@ -920,7 +920,7 @@ static void InvalidateBlock(CodeBlock* block, bool allow_frame_invalidation)
UnlinkBlock(block); UnlinkBlock(block);
#ifdef WITH_RECOMPILER #ifdef ENABLE_RECOMPILER
SetFastMap(block->GetPC(), FastCompileBlockFunction); SetFastMap(block->GetPC(), FastCompileBlockFunction);
#endif #endif
} }
@ -956,7 +956,7 @@ void RemoveReferencesToBlock(CodeBlock* block)
BlockMap::iterator iter = s_blocks.find(block->key.GetPC()); BlockMap::iterator iter = s_blocks.find(block->key.GetPC());
Assert(iter != s_blocks.end() && iter->second == block); Assert(iter != s_blocks.end() && iter->second == block);
#ifdef WITH_RECOMPILER #ifdef ENABLE_RECOMPILER
SetFastMap(block->GetPC(), FastCompileBlockFunction); SetFastMap(block->GetPC(), FastCompileBlockFunction);
#endif #endif
@ -965,7 +965,7 @@ void RemoveReferencesToBlock(CodeBlock* block)
RemoveBlockFromPageMap(block); RemoveBlockFromPageMap(block);
UnlinkBlock(block); UnlinkBlock(block);
#ifdef WITH_RECOMPILER #ifdef ENABLE_RECOMPILER
if (!block->invalidated) if (!block->invalidated)
RemoveBlockFromHostCodeMap(block); RemoveBlockFromHostCodeMap(block);
#endif #endif
@ -1017,7 +1017,7 @@ void LinkBlock(CodeBlock* from, CodeBlock* to, void* host_pc, void* host_resolve
li.block = from; li.block = from;
to->link_predecessors.push_back(li); to->link_predecessors.push_back(li);
#ifdef WITH_RECOMPILER #ifdef ENABLE_RECOMPILER
// apply in code // apply in code
if (host_pc) if (host_pc)
{ {
@ -1034,7 +1034,7 @@ void UnlinkBlock(CodeBlock* block)
if (block->link_predecessors.empty() && block->link_successors.empty()) if (block->link_predecessors.empty() && block->link_successors.empty())
return; return;
#ifdef WITH_RECOMPILER #ifdef ENABLE_RECOMPILER
if (g_settings.IsUsingRecompiler() && g_settings.cpu_recompiler_block_linking) if (g_settings.IsUsingRecompiler() && g_settings.cpu_recompiler_block_linking)
s_code_buffer.WriteProtect(false); s_code_buffer.WriteProtect(false);
#endif #endif
@ -1045,7 +1045,7 @@ void UnlinkBlock(CodeBlock* block)
[block](const CodeBlock::LinkInfo& li) { return li.block == block; }); [block](const CodeBlock::LinkInfo& li) { return li.block == block; });
Assert(iter != li.block->link_successors.end()); Assert(iter != li.block->link_successors.end());
#ifdef WITH_RECOMPILER #ifdef ENABLE_RECOMPILER
// Restore blocks linked to this block back to the resolver // Restore blocks linked to this block back to the resolver
if (li.host_pc) if (li.host_pc)
{ {
@ -1064,7 +1064,7 @@ void UnlinkBlock(CodeBlock* block)
[block](const CodeBlock::LinkInfo& li) { return li.block == block; }); [block](const CodeBlock::LinkInfo& li) { return li.block == block; });
Assert(iter != li.block->link_predecessors.end()); Assert(iter != li.block->link_predecessors.end());
#ifdef WITH_RECOMPILER #ifdef ENABLE_RECOMPILER
// Restore blocks we're linking to back to the resolver, since the successor won't be linked to us to backpatch if // Restore blocks we're linking to back to the resolver, since the successor won't be linked to us to backpatch if
// it changes. // it changes.
if (li.host_pc) if (li.host_pc)
@ -1079,13 +1079,13 @@ void UnlinkBlock(CodeBlock* block)
} }
block->link_successors.clear(); block->link_successors.clear();
#ifdef WITH_RECOMPILER #ifdef ENABLE_RECOMPILER
if (g_settings.IsUsingRecompiler() && g_settings.cpu_recompiler_block_linking) if (g_settings.IsUsingRecompiler() && g_settings.cpu_recompiler_block_linking)
s_code_buffer.WriteProtect(true); s_code_buffer.WriteProtect(true);
#endif #endif
} }
#ifdef WITH_RECOMPILER #ifdef ENABLE_RECOMPILER
void AddBlockToHostCodeMap(CodeBlock* block) void AddBlockToHostCodeMap(CodeBlock* block)
{ {
@ -1111,7 +1111,7 @@ bool InitializeFastmem()
const CPUFastmemMode mode = g_settings.cpu_fastmem_mode; const CPUFastmemMode mode = g_settings.cpu_fastmem_mode;
Assert(mode != CPUFastmemMode::Disabled); Assert(mode != CPUFastmemMode::Disabled);
#ifdef WITH_MMAP_FASTMEM #ifdef ENABLE_MMAP_FASTMEM
const auto handler = (mode == CPUFastmemMode::MMap) ? MMapPageFaultHandler : LUTPageFaultHandler; const auto handler = (mode == CPUFastmemMode::MMap) ? MMapPageFaultHandler : LUTPageFaultHandler;
#else #else
const auto handler = LUTPageFaultHandler; const auto handler = LUTPageFaultHandler;
@ -1137,7 +1137,7 @@ void ShutdownFastmem()
CPU::UpdateFastmemBase(); CPU::UpdateFastmemBase();
} }
#ifdef WITH_MMAP_FASTMEM #ifdef ENABLE_MMAP_FASTMEM
Common::PageFaultHandler::HandlerResult MMapPageFaultHandler(void* exception_pc, void* fault_address, bool is_write) Common::PageFaultHandler::HandlerResult MMapPageFaultHandler(void* exception_pc, void* fault_address, bool is_write)
{ {
@ -1256,11 +1256,11 @@ Common::PageFaultHandler::HandlerResult LUTPageFaultHandler(void* exception_pc,
return Common::PageFaultHandler::HandlerResult::ExecuteNextHandler; return Common::PageFaultHandler::HandlerResult::ExecuteNextHandler;
} }
#endif // WITH_RECOMPILER #endif // ENABLE_RECOMPILER
} // namespace CPU::CodeCache } // namespace CPU::CodeCache
#ifdef WITH_RECOMPILER #ifdef ENABLE_RECOMPILER
void CPU::Recompiler::Thunks::ResolveBranch(CodeBlock* block, void* host_pc, void* host_resolve_pc, u32 host_pc_size) void CPU::Recompiler::Thunks::ResolveBranch(CodeBlock* block, void* host_pc, void* host_resolve_pc, u32 host_pc_size)
{ {
@ -1294,4 +1294,4 @@ void CPU::Recompiler::Thunks::LogPC(u32 pc)
#endif #endif
} }
#endif // WITH_RECOMPILER #endif // ENABLE_RECOMPILER

View file

@ -13,7 +13,7 @@
#include <unordered_map> #include <unordered_map>
#include <vector> #include <vector>
#ifdef WITH_RECOMPILER #ifdef ENABLE_RECOMPILER
#include "cpu_recompiler_types.h" #include "cpu_recompiler_types.h"
#endif #endif
@ -88,7 +88,7 @@ struct CodeBlock
TickCount uncached_fetch_ticks = 0; TickCount uncached_fetch_ticks = 0;
u32 icache_line_count = 0; u32 icache_line_count = 0;
#ifdef WITH_RECOMPILER #ifdef ENABLE_RECOMPILER
std::vector<Recompiler::LoadStoreBackpatchInfo> loadstore_backpatch_info; std::vector<Recompiler::LoadStoreBackpatchInfo> loadstore_backpatch_info;
#endif #endif
@ -127,14 +127,14 @@ void Initialize();
void Shutdown(); void Shutdown();
[[noreturn]] void Execute(); [[noreturn]] void Execute();
#ifdef WITH_RECOMPILER #ifdef ENABLE_RECOMPILER
using DispatcherFunction = void (*)(); using DispatcherFunction = void (*)();
using SingleBlockDispatcherFunction = void (*)(const CodeBlock::HostCodePointer); using SingleBlockDispatcherFunction = void (*)(const CodeBlock::HostCodePointer);
FastMapTable* GetFastMapPointer(); FastMapTable* GetFastMapPointer();
#endif #endif
#if defined(WITH_RECOMPILER) #if defined(ENABLE_RECOMPILER)
JitCodeBuffer& GetCodeBuffer(); JitCodeBuffer& GetCodeBuffer();
#endif #endif

View file

@ -2746,7 +2746,7 @@ void FullscreenUI::DrawInterfaceSettingsPage()
ImGuiFullscreen::SetTheme(bsi->GetBoolValue("Main", "UseLightFullscreenUITheme", false)); ImGuiFullscreen::SetTheme(bsi->GetBoolValue("Main", "UseLightFullscreenUITheme", false));
} }
#ifdef WITH_DISCORD_PRESENCE #ifdef ENABLE_DISCORD_PRESENCE
MenuHeading(FSUI_CSTR("Integration")); MenuHeading(FSUI_CSTR("Integration"));
DrawToggleSetting(bsi, FSUI_ICONSTR(ICON_FA_CHARGING_STATION, "Enable Discord Presence"), DrawToggleSetting(bsi, FSUI_ICONSTR(ICON_FA_CHARGING_STATION, "Enable Discord Presence"),
"Shows the game you are currently playing as part of your profile on Discord.", "Main", "Shows the game you are currently playing as part of your profile on Discord.", "Main",
@ -3220,7 +3220,7 @@ void FullscreenUI::DrawControllerSettingsPage()
MenuHeading(FSUI_CSTR("Input Sources")); MenuHeading(FSUI_CSTR("Input Sources"));
#ifdef USE_SDL2 #ifdef ENABLE_SDL2
DrawToggleSetting(bsi, FSUI_ICONSTR(ICON_FA_COG, "Enable SDL Input Source"), DrawToggleSetting(bsi, FSUI_ICONSTR(ICON_FA_COG, "Enable SDL Input Source"),
FSUI_CSTR("The SDL input source supports most controllers."), "InputSources", "SDL", true, true, FSUI_CSTR("The SDL input source supports most controllers."), "InputSources", "SDL", true, true,
false); false);
@ -3781,7 +3781,7 @@ void FullscreenUI::DrawDisplaySettingsPage()
break; break;
#endif #endif
#ifdef WITH_VULKAN #ifdef ENABLE_VULKAN
case GPURenderer::HardwareVulkan: case GPURenderer::HardwareVulkan:
{ {
DrawToggleSetting(bsi, FSUI_CSTR("Threaded Presentation"), DrawToggleSetting(bsi, FSUI_CSTR("Threaded Presentation"),
@ -4416,7 +4416,7 @@ void FullscreenUI::DrawAudioSettingsPage()
void FullscreenUI::DrawAchievementsSettingsPage() void FullscreenUI::DrawAchievementsSettingsPage()
{ {
#ifdef WITH_RAINTEGRATION #ifdef ENABLE_RAINTEGRATION
if (Achievements::IsUsingRAIntegration()) if (Achievements::IsUsingRAIntegration())
{ {
BeginMenuButtons(); BeginMenuButtons();

View file

@ -319,7 +319,7 @@ std::unique_ptr<AudioStream> Host::CreateAudioStream(AudioBackend backend, u32 s
{ {
switch (backend) switch (backend)
{ {
#ifdef USE_CUBEB #ifdef ENABLE_CUBEB
case AudioBackend::Cubeb: case AudioBackend::Cubeb:
return AudioStream::CreateCubebAudioStream(sample_rate, channels, buffer_ms, latency_ms, stretch); return AudioStream::CreateCubebAudioStream(sample_rate, channels, buffer_ms, latency_ms, stretch);
#endif #endif

View file

@ -659,7 +659,7 @@ void Settings::FixIncompatibleSettings(bool display_osd_messages)
} }
} }
#ifndef WITH_MMAP_FASTMEM #ifndef ENABLE_MMAP_FASTMEM
if (g_settings.cpu_fastmem_mode == CPUFastmemMode::MMap) if (g_settings.cpu_fastmem_mode == CPUFastmemMode::MMap)
{ {
Log_WarningPrintf("mmap fastmem is not available on this platform, using LUT instead."); Log_WarningPrintf("mmap fastmem is not available on this platform, using LUT instead.");
@ -929,10 +929,10 @@ static constexpr auto s_gpu_renderer_names = make_array(
#ifdef __APPLE__ #ifdef __APPLE__
"Metal", "Metal",
#endif #endif
#ifdef WITH_VULKAN #ifdef ENABLE_VULKAN
"Vulkan", "Vulkan",
#endif #endif
#ifdef WITH_OPENGL #ifdef ENABLE_OPENGL
"OpenGL", "OpenGL",
#endif #endif
"Software"); "Software");
@ -943,10 +943,10 @@ static constexpr auto s_gpu_renderer_display_names = make_array(
#ifdef __APPLE__ #ifdef __APPLE__
TRANSLATE_NOOP("GPURenderer", "Hardware (Metal)"), TRANSLATE_NOOP("GPURenderer", "Hardware (Metal)"),
#endif #endif
#ifdef WITH_VULKAN #ifdef ENABLE_VULKAN
TRANSLATE_NOOP("GPURenderer", "Hardware (Vulkan)"), TRANSLATE_NOOP("GPURenderer", "Hardware (Vulkan)"),
#endif #endif
#ifdef WITH_OPENGL #ifdef ENABLE_OPENGL
TRANSLATE_NOOP("GPURenderer", "Hardware (OpenGL)"), TRANSLATE_NOOP("GPURenderer", "Hardware (OpenGL)"),
#endif #endif
TRANSLATE_NOOP("GPURenderer", "Software")); TRANSLATE_NOOP("GPURenderer", "Software"));
@ -988,11 +988,11 @@ RenderAPI Settings::GetRenderAPIForRenderer(GPURenderer renderer)
#ifdef __APPLE__ #ifdef __APPLE__
return RenderAPI::Metal; return RenderAPI::Metal;
#endif #endif
#ifdef WITH_VULKAN #ifdef ENABLE_VULKAN
case GPURenderer::HardwareVulkan: case GPURenderer::HardwareVulkan:
return RenderAPI::Vulkan; return RenderAPI::Vulkan;
#endif #endif
#ifdef WITH_OPENGL #ifdef ENABLE_OPENGL
case GPURenderer::HardwareOpenGL: case GPURenderer::HardwareOpenGL:
return RenderAPI::OpenGL; return RenderAPI::OpenGL;
#endif #endif
@ -1247,7 +1247,7 @@ const char* Settings::GetDisplayScalingDisplayName(DisplayScalingMode mode)
static constexpr const char* s_audio_backend_names[] = { static constexpr const char* s_audio_backend_names[] = {
"Null", "Null",
#ifdef USE_CUBEB #ifdef ENABLE_CUBEB
"Cubeb", "Cubeb",
#endif #endif
#ifdef _WIN32 #ifdef _WIN32
@ -1259,7 +1259,7 @@ static constexpr const char* s_audio_backend_names[] = {
}; };
static constexpr const char* s_audio_backend_display_names[] = { static constexpr const char* s_audio_backend_display_names[] = {
TRANSLATE_NOOP("AudioBackend", "Null (No Output)"), TRANSLATE_NOOP("AudioBackend", "Null (No Output)"),
#ifdef USE_CUBEB #ifdef ENABLE_CUBEB
TRANSLATE_NOOP("AudioBackend", "Cubeb"), TRANSLATE_NOOP("AudioBackend", "Cubeb"),
#endif #endif
#ifdef _WIN32 #ifdef _WIN32

View file

@ -420,9 +420,9 @@ struct Settings
static constexpr GPURenderer DEFAULT_GPU_RENDERER = GPURenderer::HardwareD3D11; static constexpr GPURenderer DEFAULT_GPU_RENDERER = GPURenderer::HardwareD3D11;
#elif defined(__APPLE__) #elif defined(__APPLE__)
static constexpr GPURenderer DEFAULT_GPU_RENDERER = GPURenderer::HardwareMetal; static constexpr GPURenderer DEFAULT_GPU_RENDERER = GPURenderer::HardwareMetal;
#elif defined(WITH_OPENGL) #elif defined(ENABLE_OPENGL)
static constexpr GPURenderer DEFAULT_GPU_RENDERER = GPURenderer::HardwareOpenGL; static constexpr GPURenderer DEFAULT_GPU_RENDERER = GPURenderer::HardwareOpenGL;
#elif defined(WITH_VULKAN) #elif defined(ENABLE_VULKAN)
static constexpr GPURenderer DEFAULT_GPU_RENDERER = GPURenderer::HardwareVulkan; static constexpr GPURenderer DEFAULT_GPU_RENDERER = GPURenderer::HardwareVulkan;
#else #else
static constexpr GPURenderer DEFAULT_GPU_RENDERER = GPURenderer::Software; static constexpr GPURenderer DEFAULT_GPU_RENDERER = GPURenderer::Software;
@ -434,9 +434,9 @@ struct Settings
static constexpr float DEFAULT_GPU_PGXP_DEPTH_THRESHOLD = 300.0f; static constexpr float DEFAULT_GPU_PGXP_DEPTH_THRESHOLD = 300.0f;
static constexpr float GPU_PGXP_DEPTH_THRESHOLD_SCALE = 4096.0f; static constexpr float GPU_PGXP_DEPTH_THRESHOLD_SCALE = 4096.0f;
#ifdef WITH_RECOMPILER #ifdef ENABLE_RECOMPILER
static constexpr CPUExecutionMode DEFAULT_CPU_EXECUTION_MODE = CPUExecutionMode::Recompiler; static constexpr CPUExecutionMode DEFAULT_CPU_EXECUTION_MODE = CPUExecutionMode::Recompiler;
#ifdef WITH_MMAP_FASTMEM #ifdef ENABLE_MMAP_FASTMEM
static constexpr CPUFastmemMode DEFAULT_CPU_FASTMEM_MODE = CPUFastmemMode::MMap; static constexpr CPUFastmemMode DEFAULT_CPU_FASTMEM_MODE = CPUFastmemMode::MMap;
#else #else
static constexpr CPUFastmemMode DEFAULT_CPU_FASTMEM_MODE = CPUFastmemMode::LUT; static constexpr CPUFastmemMode DEFAULT_CPU_FASTMEM_MODE = CPUFastmemMode::LUT;
@ -446,7 +446,7 @@ struct Settings
static constexpr CPUFastmemMode DEFAULT_CPU_FASTMEM_MODE = CPUFastmemMode::Disabled; static constexpr CPUFastmemMode DEFAULT_CPU_FASTMEM_MODE = CPUFastmemMode::Disabled;
#endif #endif
#if defined(USE_CUBEB) #if defined(ENABLE_CUBEB)
static constexpr AudioBackend DEFAULT_AUDIO_BACKEND = AudioBackend::Cubeb; static constexpr AudioBackend DEFAULT_AUDIO_BACKEND = AudioBackend::Cubeb;
#elif defined(_WIN32) #elif defined(_WIN32)
static constexpr AudioBackend DEFAULT_AUDIO_BACKEND = AudioBackend::XAudio2; static constexpr AudioBackend DEFAULT_AUDIO_BACKEND = AudioBackend::XAudio2;

View file

@ -74,7 +74,7 @@ Log_SetChannel(System);
#include <mmsystem.h> #include <mmsystem.h>
#endif #endif
#ifdef WITH_DISCORD_PRESENCE #ifdef ENABLE_DISCORD_PRESENCE
#include "discord_rpc.h" #include "discord_rpc.h"
#endif #endif
@ -132,7 +132,7 @@ static void UpdateSessionTime(const std::string& prev_serial);
static void SetTimerResolutionIncreased(bool enabled); static void SetTimerResolutionIncreased(bool enabled);
#ifdef WITH_DISCORD_PRESENCE #ifdef ENABLE_DISCORD_PRESENCE
static void InitializeDiscordPresence(); static void InitializeDiscordPresence();
static void ShutdownDiscordPresence(); static void ShutdownDiscordPresence();
static void PollDiscordPresence(); static void PollDiscordPresence();
@ -231,7 +231,7 @@ static u32 s_runahead_replay_frames = 0;
// Used to track play time. We use a monotonic timer here, in case of clock changes. // Used to track play time. We use a monotonic timer here, in case of clock changes.
static u64 s_session_start_time = 0; static u64 s_session_start_time = 0;
#ifdef WITH_DISCORD_PRESENCE #ifdef ENABLE_DISCORD_PRESENCE
static bool s_discord_presence_active = false; static bool s_discord_presence_active = false;
#endif #endif
@ -245,7 +245,7 @@ void System::Internal::ProcessStartup()
// This will call back to Host::LoadSettings() -> ReloadSources(). // This will call back to Host::LoadSettings() -> ReloadSources().
LoadSettings(false); LoadSettings(false);
#ifdef WITH_RAINTEGRATION #ifdef ENABLE_RAINTEGRATION
if (Host::GetBaseBoolSettingValue("Cheevos", "UseRAIntegration", false)) if (Host::GetBaseBoolSettingValue("Cheevos", "UseRAIntegration", false))
Achievements::SwitchToRAIntegration(); Achievements::SwitchToRAIntegration();
#endif #endif
@ -255,7 +255,7 @@ void System::Internal::ProcessStartup()
void System::Internal::ProcessShutdown() void System::Internal::ProcessShutdown()
{ {
#ifdef WITH_DISCORD_PRESENCE #ifdef ENABLE_DISCORD_PRESENCE
ShutdownDiscordPresence(); ShutdownDiscordPresence();
#endif #endif
@ -268,7 +268,7 @@ void System::Internal::IdlePollUpdate()
{ {
InputManager::PollSources(); InputManager::PollSources();
#ifdef WITH_DISCORD_PRESENCE #ifdef ENABLE_DISCORD_PRESENCE
PollDiscordPresence(); PollDiscordPresence();
#endif #endif
@ -1664,7 +1664,7 @@ void System::ClearRunningGame()
Achievements::GameChanged(s_running_game_path, nullptr); Achievements::GameChanged(s_running_game_path, nullptr);
#ifdef WITH_DISCORD_PRESENCE #ifdef ENABLE_DISCORD_PRESENCE
UpdateDiscordPresence(); UpdateDiscordPresence();
#endif #endif
} }
@ -1740,7 +1740,7 @@ void System::FrameDone()
if (Achievements::IsActive()) if (Achievements::IsActive())
Achievements::FrameUpdate(); Achievements::FrameUpdate();
#ifdef WITH_DISCORD_PRESENCE #ifdef ENABLE_DISCORD_PRESENCE
PollDiscordPresence(); PollDiscordPresence();
#endif #endif
@ -3316,7 +3316,7 @@ void System::UpdateRunningGame(const char* path, CDImage* image, bool booting)
SaveStateSelectorUI::RefreshList(); SaveStateSelectorUI::RefreshList();
#ifdef WITH_DISCORD_PRESENCE #ifdef ENABLE_DISCORD_PRESENCE
UpdateDiscordPresence(); UpdateDiscordPresence();
#endif #endif
@ -4718,7 +4718,7 @@ u64 System::GetSessionPlayedTime()
return static_cast<u64>(std::round(Common::Timer::ConvertValueToSeconds(ctime - s_session_start_time))); return static_cast<u64>(std::round(Common::Timer::ConvertValueToSeconds(ctime - s_session_start_time)));
} }
#ifdef WITH_DISCORD_PRESENCE #ifdef ENABLE_DISCORD_PRESENCE
void System::InitializeDiscordPresence() void System::InitializeDiscordPresence()
{ {

View file

@ -479,7 +479,7 @@ void UpdateMemorySaveStateSettings();
bool LoadRewindState(u32 skip_saves = 0, bool consume_state = true); bool LoadRewindState(u32 skip_saves = 0, bool consume_state = true);
void SetRunaheadReplayFlag(); void SetRunaheadReplayFlag();
#ifdef WITH_DISCORD_PRESENCE #ifdef ENABLE_DISCORD_PRESENCE
/// Called when rich presence changes. /// Called when rich presence changes.
void UpdateDiscordPresence(); void UpdateDiscordPresence();
#endif #endif

View file

@ -65,10 +65,10 @@ enum class GPURenderer : u8
#ifdef __APPLE__ #ifdef __APPLE__
HardwareMetal, HardwareMetal,
#endif #endif
#ifdef WITH_VULKAN #ifdef ENABLE_VULKAN
HardwareVulkan, HardwareVulkan,
#endif #endif
#ifdef WITH_OPENGL #ifdef ENABLE_OPENGL
HardwareOpenGL, HardwareOpenGL,
#endif #endif
Software, Software,
@ -144,7 +144,7 @@ enum class DisplayScalingMode : u8
enum class AudioBackend : u8 enum class AudioBackend : u8
{ {
Null, Null,
#ifdef USE_CUBEB #ifdef ENABLE_CUBEB
Cubeb, Cubeb,
#endif #endif
#ifdef _WIN32 #ifdef _WIN32

View file

@ -22,7 +22,7 @@ if(WIN32)
DEBUG_POSTFIX "-debug") DEBUG_POSTFIX "-debug")
endif() endif()
if(USE_X11) if(ENABLE_X11)
message(STATUS "Building X11 NoGUI Platform.") message(STATUS "Building X11 NoGUI Platform.")
target_compile_definitions(duckstation-nogui PRIVATE "NOGUI_PLATFORM_X11=1") target_compile_definitions(duckstation-nogui PRIVATE "NOGUI_PLATFORM_X11=1")
target_sources(duckstation-nogui PRIVATE target_sources(duckstation-nogui PRIVATE
@ -33,7 +33,7 @@ if(USE_X11)
target_link_libraries(duckstation-nogui PRIVATE "${X11_LIBRARIES}" "${X11_Xrandr_LIB}") target_link_libraries(duckstation-nogui PRIVATE "${X11_LIBRARIES}" "${X11_Xrandr_LIB}")
endif() endif()
if(USE_WAYLAND) if(ENABLE_WAYLAND)
message(STATUS "Building Wayland NoGUI Platform.") message(STATUS "Building Wayland NoGUI Platform.")
find_package(ECM REQUIRED NO_MODULE) find_package(ECM REQUIRED NO_MODULE)
list(APPEND CMAKE_MODULE_PATH "${ECM_MODULE_PATH}") list(APPEND CMAKE_MODULE_PATH "${ECM_MODULE_PATH}")

View file

@ -103,7 +103,7 @@ void AudioSettingsWidget::updateDriverNames()
std::vector<std::string> names; std::vector<std::string> names;
std::vector<std::pair<std::string, std::string>> devices; std::vector<std::pair<std::string, std::string>> devices;
#ifdef USE_CUBEB #ifdef ENABLE_CUBEB
if (backend == AudioBackend::Cubeb) if (backend == AudioBackend::Cubeb)
{ {
names = AudioStream::GetCubebDriverNames(); names = AudioStream::GetCubebDriverNames();

View file

@ -14,7 +14,7 @@
#include "util/d3d11_device.h" #include "util/d3d11_device.h"
#include "util/d3d12_device.h" #include "util/d3d12_device.h"
#endif #endif
#ifdef WITH_VULKAN #ifdef ENABLE_VULKAN
#include "util/vulkan_device.h" #include "util/vulkan_device.h"
#endif #endif
@ -199,7 +199,7 @@ void DisplaySettingsWidget::populateGPUAdaptersAndResolutions()
aml = GPUDevice::WrapGetMetalAdapterAndModeList(); aml = GPUDevice::WrapGetMetalAdapterAndModeList();
break; break;
#endif #endif
#ifdef WITH_VULKAN #ifdef ENABLE_VULKAN
case GPURenderer::HardwareVulkan: case GPURenderer::HardwareVulkan:
aml = VulkanDevice::StaticGetAdapterAndModeList(); aml = VulkanDevice::StaticGetAdapterAndModeList();
threaded_presentation_supported = true; threaded_presentation_supported = true;

View file

@ -99,7 +99,7 @@ GeneralSettingsWidget::GeneralSettingsWidget(SettingsDialog* dialog, QWidget* pa
dialog->registerWidgetHelp(m_ui.autoLoadCheats, tr("Automatically Load Cheats"), tr("Unchecked"), dialog->registerWidgetHelp(m_ui.autoLoadCheats, tr("Automatically Load Cheats"), tr("Unchecked"),
tr("Automatically loads and applies cheats on game start.")); tr("Automatically loads and applies cheats on game start."));
#ifdef WITH_DISCORD_PRESENCE #ifdef ENABLE_DISCORD_PRESENCE
{ {
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.enableDiscordPresence, "Main", "EnableDiscordPresence", SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.enableDiscordPresence, "Main", "EnableDiscordPresence",
false); false);

View file

@ -144,7 +144,7 @@ void MainWindow::initialize()
switchToGameListView(); switchToGameListView();
updateWindowTitle(); updateWindowTitle();
#ifdef WITH_RAINTEGRATION #ifdef ENABLE_RAINTEGRATION
if (Achievements::IsUsingRAIntegration()) if (Achievements::IsUsingRAIntegration())
Achievements::RAIntegration::MainWindowChanged((void*)winId()); Achievements::RAIntegration::MainWindowChanged((void*)winId());
#endif #endif
@ -1616,7 +1616,7 @@ void MainWindow::setupAdditionalUi()
connect(action, &QAction::triggered, [scale]() { g_emu_thread->requestDisplaySize(scale); }); connect(action, &QAction::triggered, [scale]() { g_emu_thread->requestDisplaySize(scale); });
} }
#ifdef WITH_RAINTEGRATION #ifdef ENABLE_RAINTEGRATION
if (Achievements::IsUsingRAIntegration()) if (Achievements::IsUsingRAIntegration())
{ {
QMenu* raMenu = new QMenu(QStringLiteral("RAIntegration"), m_ui.menu_Tools); QMenu* raMenu = new QMenu(QStringLiteral("RAIntegration"), m_ui.menu_Tools);

View file

@ -1764,7 +1764,7 @@ void QtHost::PrintCommandLineHelp(const char* progname)
std::fprintf(stderr, " -settings <filename>: Loads a custom settings configuration from the\n" std::fprintf(stderr, " -settings <filename>: Loads a custom settings configuration from the\n"
" specified filename. Default settings applied if file not found.\n"); " specified filename. Default settings applied if file not found.\n");
std::fprintf(stderr, " -earlyconsole: Creates console as early as possible, for logging.\n"); std::fprintf(stderr, " -earlyconsole: Creates console as early as possible, for logging.\n");
#ifdef WITH_RAINTEGRATION #ifdef ENABLE_RAINTEGRATION
std::fprintf(stderr, " -raintegration: Use RAIntegration instead of built-in achievement support.\n"); std::fprintf(stderr, " -raintegration: Use RAIntegration instead of built-in achievement support.\n");
#endif #endif
std::fprintf(stderr, " --: Signals that no more arguments will follow and the remaining\n" std::fprintf(stderr, " --: Signals that no more arguments will follow and the remaining\n"
@ -1905,7 +1905,7 @@ bool QtHost::ParseCommandLineParametersAndInitializeConfig(QApplication& app,
InitializeEarlyConsole(); InitializeEarlyConsole();
continue; continue;
} }
#ifdef WITH_RAINTEGRATION #ifdef ENABLE_RAINTEGRATION
else if (CHECK_ARG("-raintegration")) else if (CHECK_ARG("-raintegration"))
{ {
Achievements::SwitchToRAIntegration(); Achievements::SwitchToRAIntegration();

View file

@ -86,7 +86,7 @@ void QtHost::InstallTranslator()
if (!has_base_ts) if (!has_base_ts)
{ {
// Try without the country suffix. // Try without the country suffix.
const int index = language.lastIndexOf('_'); const int index = language.lastIndexOf('-');
if (index > 0) if (index > 0)
{ {
base_path = QStringLiteral("%1/qt_%2.qm").arg(base_dir).arg(language.left(index)); base_path = QStringLiteral("%1/qt_%2.qm").arg(base_dir).arg(language.left(index));

View file

@ -74,22 +74,22 @@ target_include_directories(util PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/..")
target_link_libraries(util PUBLIC common simpleini imgui) target_link_libraries(util PUBLIC common simpleini imgui)
target_link_libraries(util PRIVATE stb libchdr zlib soundtouch Zstd::Zstd reshadefx) target_link_libraries(util PRIVATE stb libchdr zlib soundtouch Zstd::Zstd reshadefx)
if(USE_CUBEB) if(ENABLE_CUBEB)
target_sources(util PRIVATE target_sources(util PRIVATE
cubeb_audio_stream.cpp cubeb_audio_stream.cpp
cubeb_audio_stream.h cubeb_audio_stream.h
) )
target_compile_definitions(util PUBLIC "USE_CUBEB=1") target_compile_definitions(util PUBLIC "ENABLE_CUBEB=1")
target_link_libraries(util PRIVATE cubeb) target_link_libraries(util PRIVATE cubeb)
endif() endif()
if(USE_X11) if(ENABLE_X11)
target_compile_definitions(util PRIVATE "-DUSE_X11=1") target_compile_definitions(util PRIVATE "-DENABLE_X11=1")
target_link_libraries(util PRIVATE X11::X11 X11::Xrandr) target_link_libraries(util PRIVATE X11::X11 X11::Xrandr)
endif() endif()
if(USE_WAYLAND) if(ENABLE_WAYLAND)
target_compile_definitions(util PRIVATE "-DUSE_WAYLAND=1") target_compile_definitions(util PRIVATE "-DENABLE_WAYLAND=1")
endif() endif()
if(ENABLE_OPENGL) if(ENABLE_OPENGL)
@ -106,7 +106,7 @@ if(ENABLE_OPENGL)
opengl_texture.cpp opengl_texture.cpp
opengl_texture.h opengl_texture.h
) )
target_compile_definitions(util PUBLIC "WITH_OPENGL=1") target_compile_definitions(util PUBLIC "ENABLE_OPENGL=1")
target_link_libraries(util PRIVATE glad) target_link_libraries(util PRIVATE glad)
if(WIN32) if(WIN32)
@ -122,9 +122,9 @@ if(ENABLE_OPENGL)
gl/context_egl.cpp gl/context_egl.cpp
gl/context_egl.h gl/context_egl.h
) )
target_compile_definitions(util PRIVATE "-DUSE_EGL=1") target_compile_definitions(util PRIVATE "-DENABLE_EGL=1")
if(USE_X11) if(ENABLE_X11)
target_sources(util PRIVATE target_sources(util PRIVATE
gl/context_egl_x11.cpp gl/context_egl_x11.cpp
gl/context_egl_x11.h gl/context_egl_x11.h
@ -135,7 +135,7 @@ if(ENABLE_OPENGL)
# makes the data types opaque, we can still use it with X11 if needed. # makes the data types opaque, we can still use it with X11 if needed.
target_compile_definitions(util PRIVATE "-DEGL_NO_X11=1") target_compile_definitions(util PRIVATE "-DEGL_NO_X11=1")
endif() endif()
if(USE_WAYLAND) if(ENABLE_WAYLAND)
target_sources(util PRIVATE target_sources(util PRIVATE
gl/context_egl_wayland.cpp gl/context_egl_wayland.cpp
gl/context_egl_wayland.h gl/context_egl_wayland.h
@ -188,15 +188,15 @@ if(ENABLE_VULKAN)
vulkan_texture.cpp vulkan_texture.cpp
vulkan_texture.h vulkan_texture.h
) )
target_compile_definitions(util PUBLIC "WITH_VULKAN=1") target_compile_definitions(util PUBLIC "ENABLE_VULKAN=1")
endif() endif()
if(USE_SDL2) if(ENABLE_SDL2)
target_sources(util PRIVATE target_sources(util PRIVATE
sdl_input_source.cpp sdl_input_source.cpp
sdl_input_source.h sdl_input_source.h
) )
target_compile_definitions(util PUBLIC "USE_SDL2=1") target_compile_definitions(util PUBLIC "ENABLE_SDL2=1")
target_link_libraries(util PUBLIC SDL2::SDL2) target_link_libraries(util PUBLIC SDL2::SDL2)
# Copy bundled SDL2 to output on Windows. # Copy bundled SDL2 to output on Windows.

View file

@ -79,7 +79,7 @@ public:
static std::unique_ptr<AudioStream> CreateNullStream(u32 sample_rate, u32 channels, u32 buffer_ms); static std::unique_ptr<AudioStream> CreateNullStream(u32 sample_rate, u32 channels, u32 buffer_ms);
#ifdef USE_CUBEB #ifdef ENABLE_CUBEB
static std::unique_ptr<AudioStream> CreateCubebAudioStream(u32 sample_rate, u32 channels, u32 buffer_ms, static std::unique_ptr<AudioStream> CreateCubebAudioStream(u32 sample_rate, u32 channels, u32 buffer_ms,
u32 latency_ms, AudioStretchMode stretch); u32 latency_ms, AudioStretchMode stretch);
static std::vector<std::string> GetCubebDriverNames(); static std::vector<std::string> GetCubebDriverNames();

View file

@ -19,11 +19,11 @@
#elif defined(__APPLE__) #elif defined(__APPLE__)
#include "context_agl.h" #include "context_agl.h"
#else #else
#ifdef USE_EGL #ifdef ENABLE_EGL
#ifdef USE_WAYLAND #ifdef ENABLE_WAYLAND
#include "context_egl_wayland.h" #include "context_egl_wayland.h"
#endif #endif
#ifdef USE_X11 #ifdef ENABLE_X11
#include "context_egl_x11.h" #include "context_egl_x11.h"
#endif #endif
#endif #endif
@ -121,11 +121,11 @@ std::unique_ptr<GL::Context> Context::Create(const WindowInfo& wi, const Version
#elif defined(__APPLE__) #elif defined(__APPLE__)
context = ContextAGL::Create(wi, versions_to_try, num_versions_to_try); context = ContextAGL::Create(wi, versions_to_try, num_versions_to_try);
#else #else
#if defined(USE_X11) #if defined(ENABLE_X11)
if (wi.type == WindowInfo::Type::X11) if (wi.type == WindowInfo::Type::X11)
context = ContextEGLX11::Create(wi, versions_to_try, num_versions_to_try); context = ContextEGLX11::Create(wi, versions_to_try, num_versions_to_try);
#endif #endif
#if defined(USE_WAYLAND) #if defined(ENABLE_WAYLAND)
if (wi.type == WindowInfo::Type::Wayland) if (wi.type == WindowInfo::Type::Wayland)
context = ContextEGLWayland::Create(wi, versions_to_try, num_versions_to_try); context = ContextEGLWayland::Create(wi, versions_to_try, num_versions_to_try);
#endif #endif

View file

@ -25,11 +25,11 @@ Log_SetChannel(GPUDevice);
#include "d3d_common.h" #include "d3d_common.h"
#endif #endif
#ifdef WITH_OPENGL #ifdef ENABLE_OPENGL
#include "opengl_device.h" #include "opengl_device.h"
#endif #endif
#ifdef WITH_VULKAN #ifdef ENABLE_VULKAN
#include "vulkan_device.h" #include "vulkan_device.h"
#endif #endif
@ -337,12 +337,12 @@ std::string GPUDevice::GetShaderCacheBaseName(const std::string_view& type) cons
ret = fmt::format("d3d12_{}{}", type, debug_suffix); ret = fmt::format("d3d12_{}{}", type, debug_suffix);
break; break;
#endif #endif
#ifdef WITH_VULKAN #ifdef ENABLE_VULKAN
case RenderAPI::Vulkan: case RenderAPI::Vulkan:
ret = fmt::format("vulkan_{}{}", type, debug_suffix); ret = fmt::format("vulkan_{}{}", type, debug_suffix);
break; break;
#endif #endif
#ifdef WITH_OPENGL #ifdef ENABLE_OPENGL
case RenderAPI::OpenGL: case RenderAPI::OpenGL:
ret = fmt::format("opengl_{}{}", type, debug_suffix); ret = fmt::format("opengl_{}{}", type, debug_suffix);
break; break;
@ -747,12 +747,12 @@ std::unique_ptr<GPUDevice> GPUDevice::CreateDeviceForAPI(RenderAPI api)
{ {
switch (api) switch (api)
{ {
#ifdef WITH_VULKAN #ifdef ENABLE_VULKAN
case RenderAPI::Vulkan: case RenderAPI::Vulkan:
return std::make_unique<VulkanDevice>(); return std::make_unique<VulkanDevice>();
#endif #endif
#ifdef WITH_OPENGL #ifdef ENABLE_OPENGL
case RenderAPI::OpenGL: case RenderAPI::OpenGL:
case RenderAPI::OpenGLES: case RenderAPI::OpenGLES:
return std::make_unique<OpenGLDevice>(); return std::make_unique<OpenGLDevice>();

View file

@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2019-2022 Connor McLaughlin <stenzek@gmail.com> // SPDX-FileCopyrightText: 2019-2023 Connor McLaughlin <stenzek@gmail.com>
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0) // SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
#include "input_manager.h" #include "input_manager.h"
@ -481,7 +481,7 @@ static std::array<const char*, static_cast<u32>(InputSourceType::Count)> s_input
"XInput", "XInput",
"RawInput", "RawInput",
#endif #endif
#ifdef USE_SDL2 #ifdef ENABLE_SDL2
"SDL", "SDL",
#endif #endif
#ifdef __ANDROID__ #ifdef __ANDROID__
@ -517,7 +517,7 @@ bool InputManager::GetInputSourceDefaultEnabled(InputSourceType type)
return false; return false;
#endif #endif
#ifdef USE_SDL2 #ifdef ENABLE_SDL2
case InputSourceType::SDL: case InputSourceType::SDL:
return true; return true;
#endif #endif
@ -1926,7 +1926,7 @@ void InputManager::ReloadSources(SettingsInterface& si, std::unique_lock<std::mu
UpdateInputSourceState(si, settings_lock, InputSourceType::XInput, &InputSource::CreateXInputSource); UpdateInputSourceState(si, settings_lock, InputSourceType::XInput, &InputSource::CreateXInputSource);
UpdateInputSourceState(si, settings_lock, InputSourceType::RawInput, &InputSource::CreateWin32RawInputSource); UpdateInputSourceState(si, settings_lock, InputSourceType::RawInput, &InputSource::CreateWin32RawInputSource);
#endif #endif
#ifdef USE_SDL2 #ifdef ENABLE_SDL2
UpdateInputSourceState(si, settings_lock, InputSourceType::SDL, &InputSource::CreateSDLSource); UpdateInputSourceState(si, settings_lock, InputSourceType::SDL, &InputSource::CreateSDLSource);
#endif #endif
#ifdef __ANDROID__ #ifdef __ANDROID__

View file

@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2019-2022 Connor McLaughlin <stenzek@gmail.com> // SPDX-FileCopyrightText: 2019-2023 Connor McLaughlin <stenzek@gmail.com>
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0) // SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
#pragma once #pragma once
@ -27,7 +27,7 @@ enum class InputSourceType : u32
XInput, XInput,
RawInput, RawInput,
#endif #endif
#ifdef USE_SDL2 #ifdef ENABLE_SDL2
SDL, SDL,
#endif #endif
#ifdef __ANDROID__ #ifdef __ANDROID__

View file

@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2019-2022 Connor McLaughlin <stenzek@gmail.com> // SPDX-FileCopyrightText: 2019-2023 Connor McLaughlin <stenzek@gmail.com>
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0) // SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
#pragma once #pragma once
@ -74,7 +74,7 @@ public:
static std::unique_ptr<InputSource> CreateXInputSource(); static std::unique_ptr<InputSource> CreateXInputSource();
static std::unique_ptr<InputSource> CreateWin32RawInputSource(); static std::unique_ptr<InputSource> CreateWin32RawInputSource();
#endif #endif
#ifdef USE_SDL2 #ifdef ENABLE_SDL2
static std::unique_ptr<InputSource> CreateSDLSource(); static std::unique_ptr<InputSource> CreateSDLSource();
#endif #endif
#ifdef __ANDROID__ #ifdef __ANDROID__

View file

@ -7,7 +7,7 @@
#include <cstdio> #include <cstdio>
#include <cstring> #include <cstring>
#ifdef WITH_OPENGL #ifdef ENABLE_OPENGL
#include "opengl_loader.h" #include "opengl_loader.h"
#endif #endif
@ -18,10 +18,10 @@ ShaderGen::ShaderGen(RenderAPI render_api, bool supports_dual_source_blend)
m_spirv(render_api == RenderAPI::Vulkan || render_api == RenderAPI::Metal), m_spirv(render_api == RenderAPI::Vulkan || render_api == RenderAPI::Metal),
m_supports_dual_source_blend(supports_dual_source_blend), m_use_glsl_interface_blocks(false) m_supports_dual_source_blend(supports_dual_source_blend), m_use_glsl_interface_blocks(false)
{ {
#if defined(WITH_OPENGL) || defined(WITH_VULKAN) #if defined(ENABLE_OPENGL) || defined(ENABLE_VULKAN)
if (m_glsl) if (m_glsl)
{ {
#ifdef WITH_OPENGL #ifdef ENABLE_OPENGL
if (m_render_api == RenderAPI::OpenGL || m_render_api == RenderAPI::OpenGLES) if (m_render_api == RenderAPI::OpenGL || m_render_api == RenderAPI::OpenGLES)
SetGLSLVersionString(); SetGLSLVersionString();
@ -47,7 +47,7 @@ ShaderGen::~ShaderGen() = default;
bool ShaderGen::UseGLSLBindingLayout() bool ShaderGen::UseGLSLBindingLayout()
{ {
#ifdef WITH_OPENGL #ifdef ENABLE_OPENGL
return (GLAD_GL_ES_VERSION_3_1 || GLAD_GL_VERSION_4_3 || return (GLAD_GL_ES_VERSION_3_1 || GLAD_GL_VERSION_4_3 ||
(GLAD_GL_ARB_explicit_attrib_location && GLAD_GL_ARB_explicit_uniform_location && (GLAD_GL_ARB_explicit_attrib_location && GLAD_GL_ARB_explicit_uniform_location &&
GLAD_GL_ARB_shading_language_420pack)); GLAD_GL_ARB_shading_language_420pack));
@ -61,7 +61,7 @@ void ShaderGen::DefineMacro(std::stringstream& ss, const char* name, bool enable
ss << "#define " << name << " " << BoolToUInt32(enabled) << "\n"; ss << "#define " << name << " " << BoolToUInt32(enabled) << "\n";
} }
#ifdef WITH_OPENGL #ifdef ENABLE_OPENGL
void ShaderGen::SetGLSLVersionString() void ShaderGen::SetGLSLVersionString()
{ {
const char* glsl_version = reinterpret_cast<const char*>(glGetString(GL_SHADING_LANGUAGE_VERSION)); const char* glsl_version = reinterpret_cast<const char*>(glGetString(GL_SHADING_LANGUAGE_VERSION));
@ -113,7 +113,7 @@ void ShaderGen::WriteHeader(std::stringstream& ss)
else if (m_spirv) else if (m_spirv)
ss << "#version 450 core\n\n"; ss << "#version 450 core\n\n";
#ifdef WITH_OPENGL #ifdef ENABLE_OPENGL
// Extension enabling for OpenGL. // Extension enabling for OpenGL.
if (m_render_api == RenderAPI::OpenGLES) if (m_render_api == RenderAPI::OpenGLES)
{ {
@ -160,7 +160,7 @@ void ShaderGen::WriteHeader(std::stringstream& ss)
DefineMacro(ss, "API_VULKAN", m_render_api == RenderAPI::Vulkan); DefineMacro(ss, "API_VULKAN", m_render_api == RenderAPI::Vulkan);
DefineMacro(ss, "API_METAL", m_render_api == RenderAPI::Metal); DefineMacro(ss, "API_METAL", m_render_api == RenderAPI::Metal);
#ifdef WITH_OPENGL #ifdef ENABLE_OPENGL
if (m_render_api == RenderAPI::OpenGLES) if (m_render_api == RenderAPI::OpenGLES)
{ {
ss << "precision highp float;\n"; ss << "precision highp float;\n";
@ -356,7 +356,7 @@ void ShaderGen::DeclareTextureBuffer(std::stringstream& ss, const char* name, u3
const char* ShaderGen::GetInterpolationQualifier(bool interface_block, bool centroid_interpolation, const char* ShaderGen::GetInterpolationQualifier(bool interface_block, bool centroid_interpolation,
bool sample_interpolation, bool is_out) const bool sample_interpolation, bool is_out) const
{ {
#ifdef WITH_OPENGL #ifdef ENABLE_OPENGL
const bool shading_language_420pack = GLAD_GL_ARB_shading_language_420pack; const bool shading_language_420pack = GLAD_GL_ARB_shading_language_420pack;
#else #else
const bool shading_language_420pack = false; const bool shading_language_420pack = false;

View file

@ -31,7 +31,7 @@ protected:
const char* GetInterpolationQualifier(bool interface_block, bool centroid_interpolation, bool sample_interpolation, const char* GetInterpolationQualifier(bool interface_block, bool centroid_interpolation, bool sample_interpolation,
bool is_out) const; bool is_out) const;
#ifdef WITH_OPENGL #ifdef ENABLE_OPENGL
void SetGLSLVersionString(); void SetGLSLVersionString();
#endif #endif

View file

@ -5,8 +5,8 @@
<ItemDefinitionGroup> <ItemDefinitionGroup>
<ClCompile> <ClCompile>
<PreprocessorDefinitions>%(PreprocessorDefinitions);SOUNDTOUCH_FLOAT_SAMPLES;SOUNDTOUCH_ALLOW_SSE;ST_NO_EXCEPTION_HANDLING=1</PreprocessorDefinitions> <PreprocessorDefinitions>%(PreprocessorDefinitions);SOUNDTOUCH_FLOAT_SAMPLES;SOUNDTOUCH_ALLOW_SSE;ST_NO_EXCEPTION_HANDLING=1</PreprocessorDefinitions>
<PreprocessorDefinitions>USE_CUBEB=1;USE_SDL2=1;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>ENABLE_CUBEB=1;ENABLE_SDL2=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Platform)'!='ARM64'">%(PreprocessorDefinitions);WITH_OPENGL=1;WITH_VULKAN=1</PreprocessorDefinitions> <PreprocessorDefinitions Condition="'$(Platform)'!='ARM64'">%(PreprocessorDefinitions);ENABLE_OPENGL=1;ENABLE_VULKAN=1</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Platform)'=='ARM64'">%(PreprocessorDefinitions);SOUNDTOUCH_USE_NEON</PreprocessorDefinitions> <PreprocessorDefinitions Condition="'$(Platform)'=='ARM64'">%(PreprocessorDefinitions);SOUNDTOUCH_USE_NEON</PreprocessorDefinitions>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(SolutionDir)dep\soundtouch\include;$(SolutionDir)dep\imgui\include;$(SolutionDir)dep\simpleini\include;$(SolutionDir)dep\libchdr\include;$(SolutionDir)dep\cubeb\include;$(SolutionDir)dep\d3d12ma\include;$(SolutionDir)dep\zstd\lib</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(SolutionDir)dep\soundtouch\include;$(SolutionDir)dep\imgui\include;$(SolutionDir)dep\simpleini\include;$(SolutionDir)dep\libchdr\include;$(SolutionDir)dep\cubeb\include;$(SolutionDir)dep\d3d12ma\include;$(SolutionDir)dep\zstd\lib</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Platform)'!='ARM64'">%(AdditionalIncludeDirectories);$(SolutionDir)dep\glad\include;$(SolutionDir)dep\vulkan\include;$(SolutionDir)dep\glslang</AdditionalIncludeDirectories> <AdditionalIncludeDirectories Condition="'$(Platform)'!='ARM64'">%(AdditionalIncludeDirectories);$(SolutionDir)dep\glad\include;$(SolutionDir)dep\vulkan\include;$(SolutionDir)dep\glslang</AdditionalIncludeDirectories>

View file

@ -15,18 +15,18 @@
#elif defined(__ANDROID__) #elif defined(__ANDROID__)
#define VK_USE_PLATFORM_ANDROID_KHR #define VK_USE_PLATFORM_ANDROID_KHR
#else #else
#ifdef USE_X11 #ifdef ENABLE_X11
#define VK_USE_PLATFORM_XLIB_KHR #define VK_USE_PLATFORM_XLIB_KHR
#endif #endif
#ifdef USE_WAYLAND #ifdef ENABLE_WAYLAND
#define VK_USE_PLATFORM_WAYLAND_KHR #define VK_USE_PLATFORM_WAYLAND_KHR
#endif #endif
#endif #endif
#include "vulkan/vulkan.h" #include "vulkan/vulkan.h"
#if defined(USE_X11) #if defined(ENABLE_X11)
// This breaks a bunch of our code. They shouldn't be #defines in the first place. // This breaks a bunch of our code. They shouldn't be #defines in the first place.
#ifdef None #ifdef None

View file

@ -82,7 +82,7 @@ bool WindowInfo::QueryRefreshRateForWindow(const WindowInfo& wi, float* refresh_
#else #else
#ifdef USE_X11 #ifdef ENABLE_X11
#include "common/scoped_guard.h" #include "common/scoped_guard.h"
#include "common/log.h" #include "common/log.h"
@ -220,11 +220,11 @@ static bool GetRefreshRateFromXRandR(const WindowInfo& wi, float* refresh_rate)
return true; return true;
} }
#endif // USE_X11 #endif // ENABLE_X11
bool WindowInfo::QueryRefreshRateForWindow(const WindowInfo& wi, float* refresh_rate) bool WindowInfo::QueryRefreshRateForWindow(const WindowInfo& wi, float* refresh_rate)
{ {
#if defined(USE_X11) #if defined(ENABLE_X11)
if (wi.type == WindowInfo::Type::X11) if (wi.type == WindowInfo::Type::X11)
return GetRefreshRateFromXRandR(wi, refresh_rate); return GetRefreshRateFromXRandR(wi, refresh_rate);
#endif #endif