From cb51ab719741efc51c10fa29b2431f2bbcdc92b5 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Sat, 26 Mar 2022 22:55:01 +1000 Subject: [PATCH] Misc: Purge unused definitions --- src/CMakeLists.txt | 15 ++------------- src/common/CMakeLists.txt | 20 ++++++-------------- src/common/memory_arena.cpp | 10 +--------- src/common/vulkan/shader_compiler.cpp | 2 -- src/common/window_info.h | 1 - 5 files changed, 9 insertions(+), 39 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index cd61d4c82..61fd8f533 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,16 +1,9 @@ -if(BUILD_LIBRETRO_CORE) - add_definitions("-DLIBRETRO=1") -endif() - add_subdirectory(common) add_subdirectory(core) add_subdirectory(scmversion) +add_subdirectory(frontend-common) -if(NOT BUILD_LIBRETRO_CORE) - add_subdirectory(frontend-common) -endif() - -if(NOT BUILD_LIBRETRO_CORE AND NOT ANDROID) +if(NOT ANDROID) add_subdirectory(common-tests) if(WIN32) add_subdirectory(updater) @@ -25,10 +18,6 @@ if(BUILD_QT_FRONTEND) add_subdirectory(duckstation-qt) endif() -if(BUILD_LIBRETRO_CORE) - add_subdirectory(duckstation-libretro) -endif() - if(BUILD_REGTEST) add_subdirectory(duckstation-regtest) endif() diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index a21f409f3..7fbf9e239 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -146,20 +146,15 @@ if(WIN32) d3d11/stream_buffer.h d3d11/texture.cpp d3d11/texture.h + gl/context_wgl.cpp + gl/context_wgl.h + thirdparty/StackWalker.cpp + thirdparty/StackWalker.h + win32_progress_callback.cpp + win32_progress_callback.h windows_headers.h ) target_link_libraries(common PRIVATE d3dcompiler.lib) - - if(NOT LIBRETRO) - target_sources(common PRIVATE - gl/context_wgl.cpp - gl/context_wgl.h - thirdparty/StackWalker.cpp - thirdparty/StackWalker.h - win32_progress_callback.cpp - win32_progress_callback.h - ) - endif() endif() if(ANDROID) @@ -245,9 +240,6 @@ endif() if(APPLE) # Needed for Vulkan Swap Chain. target_link_libraries(common PRIVATE "objc") -endif() - -if(APPLE AND NOT BUILD_LIBRETRO_CORE) target_sources(common PRIVATE gl/context_agl.mm gl/context_agl.h diff --git a/src/common/memory_arena.cpp b/src/common/memory_arena.cpp index 19b225c47..c016ca216 100644 --- a/src/common/memory_arena.cpp +++ b/src/common/memory_arena.cpp @@ -113,15 +113,7 @@ static std::string GetFileMappingName() #error Unknown platform. #endif -#ifdef LIBRETRO - // libretro second-instance runahead is insane, and loads a second copy of the module in the same process, which means - // we'd overlap the memory mapping for the "primary" core. Work around this by taking the address of this function, - // which should be unique per instance. - std::string ret(StringUtil::StdStringFromFormat("duckstation_%u_%p", pid, ((void*)&GetFileMappingName))); -#else - std::string ret(StringUtil::StdStringFromFormat("duckstation_%u", pid)); -#endif - + const std::string ret(StringUtil::StdStringFromFormat("duckstation_%u", pid)); Log_InfoPrintf("File mapping name: %s", ret.c_str()); return ret; } diff --git a/src/common/vulkan/shader_compiler.cpp b/src/common/vulkan/shader_compiler.cpp index 9340522e6..45833e5d5 100644 --- a/src/common/vulkan/shader_compiler.cpp +++ b/src/common/vulkan/shader_compiler.cpp @@ -124,9 +124,7 @@ bool InitializeGlslang() return false; } -#ifndef LIBRETRO std::atexit([]() { glslang::FinalizeProcess(); }); -#endif glslang_initialized = true; return true; diff --git a/src/common/window_info.h b/src/common/window_info.h index be1cc15b4..fe27f0815 100644 --- a/src/common/window_info.h +++ b/src/common/window_info.h @@ -14,7 +14,6 @@ struct WindowInfo MacOS, Android, Display, - Libretro, }; enum class SurfaceFormat