mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-12-09 05:08:43 +00:00
several fixes (#112)
* updated fmt * submodules updated * fixed _TIMESPEC_DEFINED for winpthreads under windows * fixed sdl3 under qt * virtual_memory: Ensure mapped addresses stay inside the user area * Fixes LLE Libc crashing on linux --------- Co-authored-by: GPUCode <geoster3d@gmail.com>
This commit is contained in:
8
.gitmodules
vendored
8
.gitmodules
vendored
@@ -1,7 +1,3 @@
|
|||||||
[submodule "third-party/fmt"]
|
|
||||||
path = third-party/fmt
|
|
||||||
url = https://github.com/fmtlib/fmt.git
|
|
||||||
shallow = true
|
|
||||||
[submodule "third-party/magic_enum"]
|
[submodule "third-party/magic_enum"]
|
||||||
path = third-party/magic_enum
|
path = third-party/magic_enum
|
||||||
url = https://github.com/Neargye/magic_enum.git
|
url = https://github.com/Neargye/magic_enum.git
|
||||||
@@ -47,4 +43,6 @@
|
|||||||
[submodule "externals/sdl3"]
|
[submodule "externals/sdl3"]
|
||||||
path = externals/sdl3
|
path = externals/sdl3
|
||||||
url = https://github.com/shadps4-emu/ext-SDL.git
|
url = https://github.com/shadps4-emu/ext-SDL.git
|
||||||
|
[submodule "externals/fmt"]
|
||||||
|
path = externals/fmt
|
||||||
|
url = https://github.com/shadps4-emu/ext-fmt.git
|
||||||
|
|||||||
@@ -14,12 +14,6 @@ project(shadps4)
|
|||||||
|
|
||||||
option(ENABLE_QT_GUI "Enable the Qt GUI. If not selected then the emulator uses a minimal SDL-based UI instead" OFF)
|
option(ENABLE_QT_GUI "Enable the Qt GUI. If not selected then the emulator uses a minimal SDL-based UI instead" OFF)
|
||||||
|
|
||||||
if(ENABLE_QT_GUI)
|
|
||||||
find_package(Qt6 REQUIRED COMPONENTS Widgets Concurrent)
|
|
||||||
qt_standard_project_setup()
|
|
||||||
set(CMAKE_AUTORCC ON)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# This function should be passed a list of all files in a target. It will automatically generate
|
# This function should be passed a list of all files in a target. It will automatically generate
|
||||||
# file groups following the directory hierarchy, so that the layout of the files in IDEs matches the
|
# file groups following the directory hierarchy, so that the layout of the files in IDEs matches the
|
||||||
# one in the filesystem.
|
# one in the filesystem.
|
||||||
@@ -93,6 +87,12 @@ add_subdirectory(externals)
|
|||||||
add_subdirectory(third-party)
|
add_subdirectory(third-party)
|
||||||
include_directories(src)
|
include_directories(src)
|
||||||
|
|
||||||
|
if(ENABLE_QT_GUI)
|
||||||
|
find_package(Qt6 REQUIRED COMPONENTS Widgets Concurrent)
|
||||||
|
qt_standard_project_setup()
|
||||||
|
set(CMAKE_AUTORCC ON)
|
||||||
|
endif()
|
||||||
|
|
||||||
set(AUDIO_CORE src/audio_core/sdl_audio.cpp
|
set(AUDIO_CORE src/audio_core/sdl_audio.cpp
|
||||||
src/audio_core/sdl_audio.h
|
src/audio_core/sdl_audio.h
|
||||||
)
|
)
|
||||||
@@ -331,7 +331,7 @@ endif()
|
|||||||
|
|
||||||
create_target_directory_groups(shadps4)
|
create_target_directory_groups(shadps4)
|
||||||
|
|
||||||
target_link_libraries(shadps4 PRIVATE magic_enum::magic_enum fmt::fmt toml11::toml11)
|
target_link_libraries(shadps4 PRIVATE magic_enum::magic_enum fmt::fmt toml11::toml11 SDL3-shared)
|
||||||
target_link_libraries(shadps4 PRIVATE discord-rpc vulkan-1 xxhash Zydis)
|
target_link_libraries(shadps4 PRIVATE discord-rpc vulkan-1 xxhash Zydis)
|
||||||
|
|
||||||
if(NOT ENABLE_QT_GUI)
|
if(NOT ENABLE_QT_GUI)
|
||||||
@@ -352,6 +352,7 @@ if (WIN32)
|
|||||||
target_link_libraries(shadps4 PRIVATE mincore winpthread clang_rt.builtins-x86_64.lib)
|
target_link_libraries(shadps4 PRIVATE mincore winpthread clang_rt.builtins-x86_64.lib)
|
||||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS)
|
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS)
|
||||||
add_definitions(-DNOMINMAX -DWIN32_LEAN_AND_MEAN)
|
add_definitions(-DNOMINMAX -DWIN32_LEAN_AND_MEAN)
|
||||||
|
add_definitions(-D_TIMESPEC_DEFINED) #needed for conflicts with time.h of windows.h
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
@@ -373,12 +374,10 @@ add_custom_command(TARGET shadps4 POST_BUILD
|
|||||||
$<TARGET_FILE_DIR:shadps4>
|
$<TARGET_FILE_DIR:shadps4>
|
||||||
)
|
)
|
||||||
|
|
||||||
if(NOT ENABLE_QT_GUI)
|
|
||||||
add_custom_command(TARGET shadps4 POST_BUILD
|
add_custom_command(TARGET shadps4 POST_BUILD
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||||
$<TARGET_FILE:SDL3-shared>
|
$<TARGET_FILE:SDL3-shared>
|
||||||
$<TARGET_FILE_DIR:shadps4>)
|
$<TARGET_FILE_DIR:shadps4>)
|
||||||
endif()
|
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
add_custom_command(TARGET shadps4 POST_BUILD
|
add_custom_command(TARGET shadps4 POST_BUILD
|
||||||
|
|||||||
5
externals/CMakeLists.txt
vendored
5
externals/CMakeLists.txt
vendored
@@ -6,6 +6,9 @@ if (MSVC)
|
|||||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS)
|
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# fmtlib
|
||||||
|
add_subdirectory(fmt EXCLUDE_FROM_ALL)
|
||||||
|
|
||||||
# Discord-RPC
|
# Discord-RPC
|
||||||
set(BUILD_EXAMPLES OFF CACHE BOOL "")
|
set(BUILD_EXAMPLES OFF CACHE BOOL "")
|
||||||
add_subdirectory(discord-rpc EXCLUDE_FROM_ALL)
|
add_subdirectory(discord-rpc EXCLUDE_FROM_ALL)
|
||||||
@@ -30,7 +33,5 @@ set(WITH_NEW_STRATEGIES ON)
|
|||||||
set(WITH_NATIVE_INSTRUCTIONS ON)
|
set(WITH_NATIVE_INSTRUCTIONS ON)
|
||||||
add_subdirectory(zlib-ng)
|
add_subdirectory(zlib-ng)
|
||||||
|
|
||||||
if(NOT ENABLE_QT_GUI)
|
|
||||||
# SDL3
|
# SDL3
|
||||||
add_subdirectory(sdl3 EXCLUDE_FROM_ALL)
|
add_subdirectory(sdl3 EXCLUDE_FROM_ALL)
|
||||||
endif()
|
|
||||||
|
|||||||
2
externals/cryptopp-cmake
vendored
2
externals/cryptopp-cmake
vendored
Submodule externals/cryptopp-cmake updated: a99c80c266...19cd13af5f
1
externals/fmt
vendored
Submodule
1
externals/fmt
vendored
Submodule
Submodule externals/fmt added at aa52eb765d
2
externals/sdl3
vendored
2
externals/sdl3
vendored
Submodule externals/sdl3 updated: c8a066019b...cbb3c69cb0
2
externals/zlib-ng
vendored
2
externals/zlib-ng
vendored
Submodule externals/zlib-ng updated: af8169a724...3f35bfccff
@@ -2,7 +2,6 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#define _TIMESPEC_DEFINED
|
|
||||||
|
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include "common/types.h"
|
#include "common/types.h"
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#define _TIMESPEC_DEFINED
|
|
||||||
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
|||||||
@@ -170,7 +170,8 @@ u64 memory_alloc_aligned(u64 address, u64 size, MemoryMode mode, u64 alignment)
|
|||||||
}
|
}
|
||||||
return ptr;
|
return ptr;
|
||||||
#else
|
#else
|
||||||
void* hint_address = reinterpret_cast<void*>(AlignUp(address, alignment));
|
void* hint_address = address == 0 ? reinterpret_cast<void*>(USER_MIN)
|
||||||
|
: reinterpret_cast<void*>(AlignUp(address, alignment));
|
||||||
void* ptr = mmap(hint_address, size, convertMemoryMode(mode), MAP_ANON | MAP_PRIVATE, -1, 0);
|
void* ptr = mmap(hint_address, size, convertMemoryMode(mode), MAP_ANON | MAP_PRIVATE, -1, 0);
|
||||||
ASSERT(ptr != MAP_FAILED);
|
ASSERT(ptr != MAP_FAILED);
|
||||||
return reinterpret_cast<u64>(ptr);
|
return reinterpret_cast<u64>(ptr);
|
||||||
|
|||||||
3
third-party/CMakeLists.txt
vendored
3
third-party/CMakeLists.txt
vendored
@@ -6,9 +6,6 @@ if (MSVC)
|
|||||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS)
|
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# fmtlib
|
|
||||||
add_subdirectory(fmt EXCLUDE_FROM_ALL)
|
|
||||||
|
|
||||||
# MagicEnum
|
# MagicEnum
|
||||||
add_subdirectory(magic_enum EXCLUDE_FROM_ALL)
|
add_subdirectory(magic_enum EXCLUDE_FROM_ALL)
|
||||||
|
|
||||||
|
|||||||
1
third-party/fmt
vendored
1
third-party/fmt
vendored
Submodule third-party/fmt deleted from 8e42eef495
Reference in New Issue
Block a user