1
0
mirror of synced 2024-09-24 11:38:26 +02:00

build: Fix zstd not being linked in correctly (#1544)

Prior to this, at least on Linux/MacOS/etc, I guess it was not possible
to compile with Zstd included for `hex::dec::zstd_decompress()`:


![image](https://github.com/WerWolv/ImHex/assets/56618074/008dbb3d-eeaf-4f49-a918-4751ec69f00c)

Every other target lib for the decompression plugin would compile,
**except for** Zstd. Additionally, the target name `zstd` caused CMake
to not be able to find `Find(ZSTD).cmake` due to case-sensitivity
differences between Windows and Unix-based file paths, of course.
With that said, I'm not too sure if this will break building w/ Zstd on
Windows... Hopefully not 😄
This commit is contained in:
reggie 2024-02-13 13:22:28 -06:00 committed by GitHub
parent ee3d6ec24b
commit 56b2e09b01
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -32,11 +32,11 @@ add_imhex_plugin(
ZSTD
)
find_package(zstd)
if (TARGET zstd::libzstd_static)
addOptionalLibrary(zstd libzstd_static)
elseif(TARGET zstd::libzstd_shared)
addOptionalLibrary(zstd libzstd_shared)
find_package(ZSTD)
if(ZSTD_FOUND)
set(LIBRARIES ${LIBRARIES} "${ZSTD_LIBRARY}")
message(STATUS "Enabling decompression support using ZSTD (${ZSTD_VERSION})")
enable_plugin_feature(ZSTD)
endif()
addOptionalLibrary(ZLIB ZLIB)