Okay FINE let's use pkg-config then

what's even the point of find_package when distros don't ship CMake
scripts for a damn thing
This commit is contained in:
Nadia Holmquist Pedersen 2023-04-15 23:18:10 +02:00
parent ea2fc0b6a8
commit 3f61538844
1 changed files with 3 additions and 7 deletions

View File

@ -82,9 +82,9 @@ endif()
pkg_check_modules(SDL2 REQUIRED IMPORTED_TARGET sdl2) pkg_check_modules(SDL2 REQUIRED IMPORTED_TARGET sdl2)
pkg_check_modules(Slirp REQUIRED IMPORTED_TARGET slirp) pkg_check_modules(Slirp REQUIRED IMPORTED_TARGET slirp)
pkg_check_modules(LibArchive REQUIRED IMPORTED_TARGET libarchive) pkg_check_modules(LibArchive REQUIRED IMPORTED_TARGET libarchive)
pkg_check_modules(Zstd IMPORTED_TARGET libzstd)
find_package(zstd CONFIG) cmake_dependent_option(ENABLE_ZSTD "Enable support for Zstandard-compressed ROMs" ON "Zstd_FOUND" OFF)
cmake_dependent_option(ENABLE_ZSTD "Enable support for Zstandard-compressed ROMs" ON "zstd_FOUND" OFF)
fix_interface_includes(PkgConfig::SDL2 PkgConfig::Slirp PkgConfig::LibArchive) fix_interface_includes(PkgConfig::SDL2 PkgConfig::Slirp PkgConfig::LibArchive)
@ -162,11 +162,7 @@ target_link_libraries(melonDS PRIVATE ${QT_LINK_LIBS} ${CMAKE_DL_LIBS})
if (ENABLE_ZSTD) if (ENABLE_ZSTD)
target_compile_definitions(melonDS PRIVATE ZSTD_ENABLED) target_compile_definitions(melonDS PRIVATE ZSTD_ENABLED)
if (BUILD_STATIC) target_link_libraries(melonDS PRIVATE PkgConfig::Zstd)
target_link_libraries(melonDS PRIVATE zstd::libzstd_static)
else()
target_link_libraries(melonDS PRIVATE zstd::libzstd_shared)
endif()
endif() endif()
if (UNIX) if (UNIX)