This commit is contained in:
DH 2025-04-08 02:08:17 +03:00
parent 67ab3712b3
commit 556b53c234
8 changed files with 120 additions and 46 deletions

View file

@ -1,6 +1,6 @@
#!/bin/sh -ex
cd rpcs3/rpcs3 || exit 1
cd rpcs3/ || exit 1
git config --global --add safe.directory '*'
@ -8,8 +8,6 @@ git config --global --add safe.directory '*'
# shellcheck disable=SC2046
git submodule -q update --init $(awk '/path/ && !/llvm/ && !/opencv/ { print $3 }' .gitmodules)
mkdir build && cd build || exit 1
if [ "$COMPILER" = "gcc" ]; then
# These are set in the dockerfile
export CC="${GCC_BINARY}"

View file

@ -12,7 +12,7 @@ on:
workflow_dispatch:
jobs:
build-rpcsx:
build-linux:
runs-on: ubuntu-latest
steps:
@ -25,22 +25,15 @@ jobs:
run: |
sudo apt update
sudo apt install -y cmake build-essential libunwind-dev \
libvulkan-dev vulkan-validationlayers \
libsox-dev
echo "deb http://azure.archive.ubuntu.com/ubuntu noble main universe" | sudo tee /etc/apt/sources.list
sudo apt update
sudo apt install g++-14 ninja-build libasound2-dev libglfw3-dev nasm
VULKANVER=1.3.290
curl -sSfLo Vulkan-Headers.tar.gz https://github.com/KhronosGroup/Vulkan-Headers/archive/v${VULKANVER}.tar.gz
tar -xf Vulkan-Headers*.tar.gz
cd Vulkan-Headers*/
libvulkan-dev vulkan-validationlayers \
libsox-dev g++-14 ninja-build libasound2-dev libglfw3-dev nasm libudev-dev
cmake -B build -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=g++-14 -DCMAKE_INSTALL_PREFIX=/usr
cmake --build build -j$(($(nproc) + 2))
sudo cmake --build build --target install
sudo cmake --build build
- name: Build RPCSX
run: |
cmake -B build -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=g++-14 -DCMAKE_CXX_FLAGS_INIT="-march=native" && \
cmake -B build -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=g++-14 -DCMAKE_CXX_FLAGS_INIT="-march=native"
cmake --build build -j$(($(nproc) + 2))
- name: Upload RPCSX

View file

@ -6,6 +6,7 @@ option(WITH_RPCS3 "Enable RPCS3" OFF)
option(WITH_RPCS3_QT_UI "Enable RPCS3 UI" OFF)
option(WITHOUT_OPENGL "Disable OpenGL" OFF)
option(WITHOUT_OPENGLEW "Disable OpenGLEW" OFF)
option(WITHOUT_OPENAL "Disable OpenAL" OFF)
# rpcs3 options
option(USE_NATIVE_INSTRUCTIONS "USE_NATIVE_INSTRUCTIONS makes rpcs3 compile with -march=native, which is useful for local builds, but not good for packages." ON)
@ -28,6 +29,26 @@ option(HAS_MEMORY_BREAKPOINTS "Add support for memory breakpoints to the interpr
option(USE_LTO "Use LTO for building" ON)
if (NOT WITH_RPCS3)
set(WITHOUT_OPENGL on)
set(WITHOUT_OPENGLEW on)
set(WITHOUT_OPENAL on)
set(WITH_LLVM off)
set(USE_FAUDIO off)
set(USE_LIBEVDEV off)
set(USE_DISCORD_RPC off)
set(USE_SYSTEM_ZLIB off)
set(USE_VULKAN off)
set(USE_PRECOMPILED_HEADERS off)
set(USE_SDL off)
set(USE_SYSTEM_SDL off)
set(USE_SYSTEM_FFMPEG off)
set(USE_SYSTEM_OPENAL off)
set(USE_SYSTEM_CURL off)
set(USE_SYSTEM_OPENCV off)
set(HAS_MEMORY_BREAKPOINTS off)
endif()
set(CMAKE_CXX_EXTENSIONS off)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED on)
@ -35,7 +56,74 @@ set(CMAKE_BUILD_RPATH_USE_ORIGIN on)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 11)
message(FATAL_ERROR "RPCS3 requires at least gcc-11.")
endif()
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.0)
message(FATAL_ERROR "RPCS3 requires at least clang-12.0.")
endif()
endif()
include(CheckCXXCompilerFlag)
get_property(IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(IS_MULTI_CONFIG)
set(USE_DISCORD_RPC OFF CACHE BOOL "Discord RPC is only available with single-config generator" FORCE)
else()
if(NOT CMAKE_BUILD_TYPE)
message(STATUS "No build type selected, default to Release")
set(CMAKE_BUILD_TYPE "Release")
endif()
endif()
if(CMAKE_BUILD_TYPE MATCHES "Debug" AND NOT MSVC)
add_compile_definitions(_DEBUG)
endif()
if(MSVC)
option(USE_MSVC_STATIC_CRT "Use static MSVC C runtime" OFF)
if(NOT IS_MULTI_CONFIG)
if(NOT(CMAKE_BUILD_TYPE MATCHES "Release" AND USE_MSVC_STATIC_CRT))
set(USE_DISCORD_RPC OFF CACHE BOOL "Discord RPC is only available in Release and static CRT build." FORCE)
endif()
endif()
if(USE_MSVC_STATIC_CRT)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded")
else()
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreadedDLL")
endif()
add_compile_options(/MP)
endif()
find_program(CCACHE_FOUND ccache)
if(CCACHE_FOUND)
set(CMAKE_CXX_COMPILER_LAUNCHER ccache)
endif()
if(APPLE AND CMAKE_OSX_ARCHITECTURES STREQUAL "arm64")
include_directories(/opt/homebrew/include)
link_directories(/opt/homebrew/lib)
endif()
if(MSVC)
add_compile_options(/wd4530 /utf-8) # C++ exception handler used, but unwind semantics are not enabled
add_compile_definitions(WIN32_LEAN_AND_MEAN)
endif()
add_subdirectory(3rdparty EXCLUDE_FROM_ALL)
add_subdirectory(rx EXCLUDE_FROM_ALL)
target_compile_definitions(rx PRIVATE
RX_TAG=0
RX_TAG_VERSION=0
)
if (WITH_RPCSX)
find_package(nlohmann_json CONFIG)
@ -89,13 +177,6 @@ if (WITH_RPCSX)
add_subdirectory(rpcsx)
endif()
add_subdirectory(rx)
target_compile_definitions(rx PRIVATE
RX_TAG=0
RX_TAG_VERSION=0
)
if (WITH_RPCS3)
add_subdirectory(rpcs3)
endif()

View file

@ -6,12 +6,13 @@
#include "util/dyn_lib.hpp"
#include "Utilities/lockless.h"
#include <windows.h>
#include <winioctl.h>
#include <span>
#else
#include <sys/mman.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#include <cerrno>
#include <unistd.h>
#include <sys/types.h>
#endif
@ -32,7 +33,8 @@
#define __NR_memfd_create 279
#endif
static int memfd_create_(const char* name, uint flags)
static int
memfd_create_(const char* name, uint flags)
{
return syscall(__NR_memfd_create, name, flags);
}

View file

@ -265,13 +265,13 @@ if (NOT ANDROID)
install(FILES rpcs3.metainfo.xml
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/metainfo)
# Install other files
install(DIRECTORY rpcs3/bin/Icons
install(DIRECTORY ${CMAKE_SOURCE_DIR}/rpcs3/bin/Icons
DESTINATION ${CMAKE_INSTALL_DATADIR}/rpcs3)
install(DIRECTORY rpcs3/bin/GuiConfigs
install(DIRECTORY ${CMAKE_SOURCE_DIR}/rpcs3/bin/GuiConfigs
DESTINATION ${CMAKE_INSTALL_DATADIR}/rpcs3)
install(DIRECTORY rpcs3/bin/git
install(DIRECTORY ${CMAKE_SOURCE_DIR}/rpcs3/bin/git
DESTINATION ${CMAKE_INSTALL_DATADIR}/rpcs3)
install(DIRECTORY rpcs3/bin/test
install(DIRECTORY ${CMAKE_SOURCE_DIR}/rpcs3/bin/test
DESTINATION ${CMAKE_INSTALL_DATADIR}/rpcs3)
endif()
endif()

View file

@ -1436,20 +1436,20 @@ QString emu_settings::GetLocalizedSetting(const QString& original, emu_settings_
break;
}
if (strict)
{
std::string type_string;
if (const auto it = settings_location.find(type); it != settings_location.cend())
{
for (const char* loc : it->second)
{
if (!type_string.empty())
type_string += ": ";
type_string += loc;
}
}
fmt::throw_exception("Missing translation for emu setting (original=%s, type='%s'=%d, index=%d)", original, type_string.empty() ? "?" : type_string, static_cast<int>(type), index);
}
// if (strict)
// {
// std::string type_string;
// if (const auto it = settings_location.find(type); it != settings_location.cend())
// {
// for (const char* loc : it->second)
// {
// if (!type_string.empty())
// type_string += ": ";
// type_string += loc;
// }
// }
// fmt::throw_exception("Missing translation for emu setting (original=%s, type='%s'=%d, index=%d)", original, type_string.empty() ? "?" : type_string, static_cast<int>(type), index);
// }
return original;
}

View file

@ -1,11 +1,11 @@
[Desktop Entry]
Type=Application
Name=RPCS3
Name=RPCS3 Qt UI
GenericName=PlayStation 3 Emulator
Comment=An open-source PlayStation 3 emulator/debugger written in C++.
Icon=rpcs3
TryExec=rpcs3
Exec=rpcs3 %f
TryExec=rpcs3qt-ui-legacy
Exec=rpcs3qt-ui-legacy %f
Terminal=false
Categories=Game;Emulator;
Keywords=PS3;Playstation;

View file

@ -5,7 +5,7 @@
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>rpcs3</string>
<string>rpcs3qt-ui-legacy</string>
<key>CFBundleGetInfoString</key>
<string>Open-source Sony PlayStation 3 emulator</string>
<key>CFBundleIconFile</key>