aports/testing/pcsx2/zstd.patch
2023-04-20 00:13:30 +02:00

36 lines
1.5 KiB
Diff

diff --git a/cmake/Pcsx2Utils.cmake b/cmake/Pcsx2Utils.cmake
index 3b63d2b..b0d115a 100644
--- a/cmake/Pcsx2Utils.cmake
+++ b/cmake/Pcsx2Utils.cmake
@@ -213,7 +213,12 @@ function(find_optional_system_library library bundled_path)
find_package(${library} ${ARGN} QUIET)
if ((NOT ${library}_FOUND) AND (NOT ${RESOLVED_USE_SYSTEM_${upperlib}} STREQUAL "AUTO"))
find_package(${library} ${ARGN}) # For the message
- message(FATAL_ERROR "No system ${library} was found. Please install it or set USE_SYSTEM_${upperlib} to AUTO.")
+ if (NOT ${upperlib} STREQUAL "ZSTD")
+ message(FATAL_ERROR "No system ${library} was found. Please install it or set USE_SYSTEM_${upperlib} to AUTO.")
+ return()
+ else()
+ set(${library}_FOUND True)
+ endif()
endif()
endif()
if (${library}_FOUND)
diff --git a/cmake/SearchForStuff.cmake b/cmake/SearchForStuff.cmake
index f4d88a1..fd16d22 100644
--- a/cmake/SearchForStuff.cmake
+++ b/cmake/SearchForStuff.cmake
@@ -126,8 +126,10 @@ find_optional_system_library(fmt 3rdparty/fmt/fmt 7.1.3)
find_optional_system_library(ryml 3rdparty/rapidyaml/rapidyaml 0.4.0)
find_optional_system_library(zstd 3rdparty/zstd 1.4.5)
if (${zstd_TYPE} STREQUAL System)
- alias_library(Zstd::Zstd zstd::libzstd_shared)
- alias_library(pcsx2-zstd zstd::libzstd_shared)
+ find_package(PkgConfig REQUIRED)
+ pkg_check_modules(zstd REQUIRED IMPORTED_TARGET libzstd)
+ alias_library(Zstd::Zstd PkgConfig::zstd)
+ alias_library(pcsx2-zstd PkgConfig::zstd)
endif()
find_optional_system_library(libzip 3rdparty/libzip 1.8.0)