Preparing for migration

This commit is contained in:
DH 2025-04-03 13:48:06 +03:00
parent 37dbd77628
commit afd3b97647
1672 changed files with 362 additions and 362 deletions

View file

@ -1,149 +0,0 @@
cmake_minimum_required(VERSION 3.28)
project(rpcs3 LANGUAGES C CXX)
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()
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)
option(WITH_LLVM "Enable usage of LLVM library" ON)
option(BUILD_LLVM "Build LLVM from git submodule" OFF)
option(STATIC_LINK_LLVM "Link against LLVM statically. This will get set to ON if you build LLVM from the submodule." OFF)
option(USE_FAUDIO "FAudio audio backend" ON)
option(USE_LIBEVDEV "libevdev-based joystick support" ON)
option(USE_DISCORD_RPC "Discord rich presence integration" OFF)
option(USE_SYSTEM_ZLIB "Prefer system ZLIB instead of the builtin one" ON)
option(USE_VULKAN "Vulkan render backend" ON)
option(USE_PRECOMPILED_HEADERS "Use precompiled headers" OFF)
option(USE_SDL "Enables SDL input handler" OFF)
option(USE_SYSTEM_SDL "Prefer system SDL instead of the builtin one" ON)
option(USE_SYSTEM_FFMPEG "Prefer system ffmpeg instead of the prebuild one" OFF)
option(USE_SYSTEM_OPENAL "Prefer system OpenAL instead of the prebuild one" ON)
option(USE_SYSTEM_CURL "Prefer system Curl instead of the prebuild one" ON)
option(USE_SYSTEM_OPENCV "Prefer system OpenCV instead of the builtin one" ON)
option(HAS_MEMORY_BREAKPOINTS "Add support for memory breakpoints to the interpreter" OFF)
option(USE_LTO "Use LTO for building" ON)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/buildfiles/cmake")
include(CheckCXXCompilerFlag)
get_property(IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(IS_MULTI_CONFIG)
# TODO(cjj19970505@live.cn)
# Currently DicordRPC is included as a binary compiled with /MT flag.
# We need all 4 binaries(/MT /MTd /MD /MDd) or including the source instead of binary.
set(USE_DISCORD_RPC OFF CACHE BOOL "Discord RPC is only avaliable 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)
# TODO(cjj19970505@live.cn)
# DiscordRPC binary in 3rdparty is compiled /MT
# So theoretically we should enable DiscordRPC in Release and static CRT build
# since we might encounter some rumtime issues when more than one CRT version are presented.
# https://docs.microsoft.com/en-us/cpp/c-runtime-library/crt-library-features?view=msvc-160#what-problems-exist-if-an-application-uses-more-than-one-crt-version
# Add other DiscordRPC binaries(compiled with /MTd, /MD, /MDd) or compile it from source may address this issue.
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$<$<CONFIG:Debug>:Debug>")
else()
# though doc ( https://cmake.org/cmake/help/latest/variable/CMAKE_MSVC_RUNTIME_LIBRARY.html )
# says if that property is not set then CMake uses the default value MultiThreaded$<$<CONFIG:Debug>:Debug>DLL
# to select a MSVC runtime library.
# But yaml-cpp set /MT(d) if CMAKE_MSVC_RUNTIME_LIBRARY is undefined
# So we have to define it explicitly
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
endif()
# TODO(cjj19970505@live.cn)
# offical QT uses dynamic CRT.
# When building our lib with static CRT and debug build type
# and linking with Qt with dynamic CRT and debug build,
# error is encountered in runtime (which is expected).
# But building our lib with static CRT and release build type,
# and linking with Qt with dynamic CRT and release build seems to be working,
# which is the same config with VS solution.
# (though technically it might still have some hidden errors).
# So we allow static CRT in both relase and debug build, but prompt warning in debug build.
# For more info:
# https://docs.microsoft.com/en-us/cpp/c-runtime-library/crt-library-features?view=msvc-160#what-problems-exist-if-an-application-uses-more-than-one-crt-version
# https://wiki.qt.io/Technical_FAQ#Why_does_a_statically_built_Qt_use_the_dynamic_Visual_Studio_runtime_libraries_.3F_Do_I_need_to_deploy_those_with_my_application_.3F
if(USE_MSVC_STATIC_CRT)
if(IS_MULTI_CONFIG OR CMAKE_BUILD_TYPE MATCHES "Debug")
message(AUTHOR_WARNING "Debug build currently can not work with static CRT.")
endif()
endif()
add_compile_options(/MP)
endif()
if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
message( FATAL_ERROR "RPCS3 can only be compiled on 64-bit platforms." )
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
endif()
add_subdirectory(3rdparty)
if (DISABLE_LTO)
if (CMAKE_C_FLAGS)
string(REGEX REPLACE "-flto[^ ]*" "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
endif()
if (CMAKE_CXX_FLAGS)
string(REGEX REPLACE "-flto[^ ]*" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
endif()
endif()
string(FIND "${CMAKE_C_FLAGS} ${CMAKE_CXX_FLAGS}" "-flto" FOUND_LTO)
if (NOT FOUND_LTO EQUAL -1)
message(FATAL_ERROR "RPCS3 doesn't support building with LTO, use -DDISABLE_LTO=TRUE to force-disable it")
endif()
if(NOT WIN32)
add_compile_options(-pthread)
endif()
# TODO: do real installation, including copying directory structure
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${PROJECT_BINARY_DIR}/bin")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${PROJECT_BINARY_DIR}/bin")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${PROJECT_BINARY_DIR}/bin")
add_subdirectory(rpcs3)
set_directory_properties(PROPERTIES VS_STARTUP_PROJECT rpcs3)

View file

View file

@ -1,110 +1,110 @@
[submodule "rpcs3-ffmpeg"]
path = 3rdparty/ffmpeg
path = rpcs3/3rdparty/ffmpeg
url = ../../RPCS3/ffmpeg-core.git
ignore = dirty
[submodule "asmjit"]
path = 3rdparty/asmjit/asmjit
path = rpcs3/3rdparty/asmjit/asmjit
url = ../../asmjit/asmjit.git
branch = master
ignore = dirty
[submodule "3rdparty/llvm/llvm"]
path = 3rdparty/llvm/llvm
path = rpcs3/3rdparty/llvm/llvm
url = ../../llvm/llvm-project.git
ignore = dirty
[submodule "3rdparty/glslang"]
path = 3rdparty/glslang/glslang
path = rpcs3/3rdparty/glslang/glslang
url = ../../KhronosGroup/glslang.git
ignore = dirty
[submodule "3rdparty/zlib"]
path = 3rdparty/zlib/zlib
path = rpcs3/3rdparty/zlib/zlib
url = ../../madler/zlib
ignore = dirty
[submodule "3rdparty/hidapi"]
path = 3rdparty/hidapi/hidapi
path = rpcs3/3rdparty/hidapi/hidapi
url = ../../RPCS3/hidapi.git
branch = master
ignore = dirty
[submodule "3rdparty/pugixml"]
path = 3rdparty/pugixml
path = rpcs3/3rdparty/pugixml
url = ../../zeux/pugixml.git
ignore = dirty
[submodule "3rdparty/yaml-cpp"]
path = 3rdparty/yaml-cpp/yaml-cpp
path = rpcs3/3rdparty/yaml-cpp/yaml-cpp
url = ../../RPCS3/yaml-cpp.git
ignore = dirty
[submodule "3rdparty/libpng"]
path = 3rdparty/libpng/libpng
path = rpcs3/3rdparty/libpng/libpng
url = ../../glennrp/libpng.git
ignore = dirty
[submodule "3rdparty/libusb"]
path = 3rdparty/libusb/libusb
path = rpcs3/3rdparty/libusb/libusb
url = ../../libusb/libusb.git
ignore = dirty
[submodule "3rdparty/FAudio"]
path = 3rdparty/FAudio
path = rpcs3/3rdparty/FAudio
url = ../../FNA-XNA/FAudio.git
ignore = dirty
[submodule "3rdparty/curl"]
path = 3rdparty/curl/curl
path = rpcs3/3rdparty/curl/curl
url = ../../curl/curl.git
ignore = dirty
[submodule "3rdparty/wolfssl"]
path = 3rdparty/wolfssl/wolfssl
path = rpcs3/3rdparty/wolfssl/wolfssl
url = ../../wolfSSL/wolfssl.git
ignore = dirty
[submodule "3rdparty/flatbuffers"]
path = 3rdparty/flatbuffers
path = rpcs3/3rdparty/flatbuffers
url = ../../google/flatbuffers.git
ignore = dirty
[submodule "3rdparty/cubeb/cubeb"]
path = 3rdparty/cubeb/cubeb
path = rpcs3/3rdparty/cubeb/cubeb
url = ../../mozilla/cubeb.git
ignore = dirty
[submodule "3rdparty/SoundTouch/soundtouch"]
path = 3rdparty/SoundTouch/soundtouch
path = rpcs3/3rdparty/SoundTouch/soundtouch
url = ../../RPCS3/soundtouch.git
ignore = dirty
[submodule "3rdparty/libsdl-org/SDL"]
path = 3rdparty/libsdl-org/SDL
path = rpcs3/3rdparty/libsdl-org/SDL
url = ../../libsdl-org/SDL.git
ignore = dirty
[submodule "3rdparty/miniupnp/miniupnp"]
path = 3rdparty/miniupnp/miniupnp
path = rpcs3/3rdparty/miniupnp/miniupnp
url = ../../miniupnp/miniupnp.git
ignore = dirty
[submodule "3rdparty/rtmidi/rtmidi"]
path = 3rdparty/rtmidi/rtmidi
path = rpcs3/3rdparty/rtmidi/rtmidi
url = ../../thestk/rtmidi
ignore = dirty
[submodule "3rdparty/zstd/zstd"]
path = 3rdparty/zstd/zstd
path = rpcs3/3rdparty/zstd/zstd
url = ../../facebook/zstd
ignore = dirty
[submodule "3rdparty/7zip/7zip"]
path = 3rdparty/7zip/7zip
path = rpcs3/3rdparty/7zip/7zip
url = ../../ip7z/7zip.git
ignore = dirty
[submodule "3rdparty/OpenAL/openal-soft"]
path = 3rdparty/OpenAL/openal-soft
path = rpcs3/3rdparty/OpenAL/openal-soft
url = ../../kcat/openal-soft.git
ignore = dirty
[submodule "3rdparty/stblib/stb"]
path = 3rdparty/stblib/stb
path = rpcs3/3rdparty/stblib/stb
url = ../../nothings/stb.git
ignore = dirty
[submodule "3rdparty/opencv/opencv"]
path = 3rdparty/opencv/opencv
path = rpcs3/3rdparty/opencv/opencv
url = ../../Megamouse/opencv_minimal.git
ignore = dirty
[submodule "3rdparty/fusion/fusion"]
path = 3rdparty/fusion/fusion
path = rpcs3/3rdparty/fusion/fusion
url = ../../xioTechnologies/Fusion.git
ignore = dirty
[submodule "3rdparty/discord-rpc/discord-rpc"]
path = 3rdparty/discord-rpc/discord-rpc
path = rpcs3/3rdparty/discord-rpc/discord-rpc
url = ../../Vestrel/discord-rpc
ignore = dirty
[submodule "3rdparty/GPUOpen/VulkanMemoryAllocator"]
path = 3rdparty/GPUOpen/VulkanMemoryAllocator
path = rpcs3/3rdparty/GPUOpen/VulkanMemoryAllocator
url = ../../Megamouse/VulkanMemoryAllocator.git
ignore = dirty

Some files were not shown because too many files have changed in this diff Show more