use winpthreads from mingw64

This commit is contained in:
georgemoralis 2024-05-09 23:45:09 +03:00
parent 93797af73f
commit b00b849d3f
7 changed files with 14 additions and 18 deletions

7
.gitmodules vendored
View File

@ -6,10 +6,6 @@
path = third-party/zydis path = third-party/zydis
url = https://github.com/zyantific/zydis.git url = https://github.com/zyantific/zydis.git
shallow = true shallow = true
[submodule "third-party/winpthread"]
path = third-party/winpthread
url = https://github.com/shadps4/winpthread.git
branch = main
[submodule "third-party/toml11"] [submodule "third-party/toml11"]
path = third-party/toml11 path = third-party/toml11
url = https://github.com/ToruNiina/toml11 url = https://github.com/ToruNiina/toml11
@ -64,3 +60,6 @@
[submodule "externals/xbyak"] [submodule "externals/xbyak"]
path = externals/xbyak path = externals/xbyak
url = https://github.com/herumi/xbyak url = https://github.com/herumi/xbyak
[submodule "externals/winpthreads"]
path = externals/winpthreads
url = https://github.com/shadps4-emu/winpthreads.git

View File

@ -403,7 +403,7 @@ if (ENABLE_QT_GUI)
endif() endif()
if (WIN32) if (WIN32)
target_link_libraries(shadps4 PRIVATE mincore winpthread clang_rt.builtins-x86_64.lib) target_link_libraries(shadps4 PRIVATE mincore winpthreads 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)
if (MSVC) if (MSVC)
@ -438,9 +438,3 @@ 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>)
if (WIN32)
add_custom_command(TARGET shadps4 POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${PROJECT_SOURCE_DIR}/third-party/winpthread/bin/libwinpthread-1.dll" $<TARGET_FILE_DIR:shadps4>)
endif()

View File

@ -66,3 +66,9 @@ add_subdirectory(robin-map EXCLUDE_FROM_ALL)
# Xbyak # Xbyak
add_subdirectory(xbyak EXCLUDE_FROM_ALL) add_subdirectory(xbyak EXCLUDE_FROM_ALL)
# Winpthreads
if (WIN32)
add_subdirectory(winpthreads EXCLUDE_FROM_ALL)
target_include_directories(winpthreads INTERFACE winpthreads/include)
endif()

1
externals/winpthreads vendored Submodule

@ -0,0 +1 @@
Subproject commit d937b60055aaea313422672ebd5cc8bfa87a1682

View File

@ -8,6 +8,9 @@
#include "core/libraries/error_codes.h" #include "core/libraries/error_codes.h"
#include "core/libraries/kernel/thread_management.h" #include "core/libraries/kernel/thread_management.h"
#include "core/libraries/libs.h" #include "core/libraries/libs.h"
#ifdef _WIN64
#include <windows.h>
#endif
namespace Libraries::Kernel { namespace Libraries::Kernel {

View File

@ -15,12 +15,6 @@ add_subdirectory(toml11 EXCLUDE_FROM_ALL)
# Vulkan # Vulkan
add_subdirectory(vulkan EXCLUDE_FROM_ALL) add_subdirectory(vulkan EXCLUDE_FROM_ALL)
# Winpthreads
if (WIN32)
add_subdirectory(winpthread EXCLUDE_FROM_ALL)
target_include_directories(winpthread INTERFACE winpthread/include)
endif()
# xxHash # xxHash
add_library(xxhash INTERFACE) add_library(xxhash INTERFACE)
target_include_directories(xxhash INTERFACE xxhash) target_include_directories(xxhash INTERFACE xxhash)

@ -1 +0,0 @@
Subproject commit 918de958b720c3ba7bc47f4988609c0109a0f75b