mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-02-13 17:10:08 +00:00
cmake: Enable userfaultfd
This commit is contained in:
parent
8b2c151f1f
commit
54cae5dff8
|
@ -15,6 +15,8 @@ if (NOT CMAKE_BUILD_TYPE)
|
|||
set(CMAKE_BUILD_TYPE Release)
|
||||
endif()
|
||||
|
||||
include(CMakeDependentOption)
|
||||
|
||||
project(shadPS4)
|
||||
|
||||
# Forcing PIE makes sure that the base address is high enough so that it doesn't clash with the PS4 memory.
|
||||
|
@ -31,6 +33,7 @@ endif()
|
|||
|
||||
option(ENABLE_QT_GUI "Enable the Qt GUI. If not selected then the emulator uses a minimal SDL-based UI instead" OFF)
|
||||
option(ENABLE_DISCORD_RPC "Enable the Discord RPC integration" ON)
|
||||
CMAKE_DEPENDENT_OPTION(ENABLE_USERFAULTFD "Enable write tracking using userfaultfd on unix" ON "NOT LINUX" OFF)
|
||||
|
||||
# First, determine whether to use CMAKE_OSX_ARCHITECTURES or CMAKE_SYSTEM_PROCESSOR.
|
||||
if (APPLE AND CMAKE_OSX_ARCHITECTURES)
|
||||
|
@ -833,6 +836,10 @@ if (ENABLE_QT_GUI)
|
|||
add_definitions(-DENABLE_QT_GUI)
|
||||
endif()
|
||||
|
||||
if (ENABLE_USERFAULTFD)
|
||||
add_definitions(-DENABLE_USERFAULTFD)
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
target_link_libraries(shadps4 PRIVATE mincore winpthreads)
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ namespace VideoCore {
|
|||
constexpr size_t PAGESIZE = 4_KB;
|
||||
constexpr size_t PAGEBITS = 12;
|
||||
|
||||
#if ENABLE_USERFAULTFD
|
||||
#ifdef ENABLE_USERFAULTFD
|
||||
struct PageManager::Impl {
|
||||
Impl(Vulkan::Rasterizer* rasterizer_) : rasterizer{rasterizer_} {
|
||||
uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK);
|
||||
|
|
Loading…
Reference in a new issue