1
0
mirror of synced 2024-11-28 09:30:51 +01: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 ZSTD
) )
find_package(zstd) find_package(ZSTD)
if (TARGET zstd::libzstd_static) if(ZSTD_FOUND)
addOptionalLibrary(zstd libzstd_static) set(LIBRARIES ${LIBRARIES} "${ZSTD_LIBRARY}")
elseif(TARGET zstd::libzstd_shared) message(STATUS "Enabling decompression support using ZSTD (${ZSTD_VERSION})")
addOptionalLibrary(zstd libzstd_shared) enable_plugin_feature(ZSTD)
endif() endif()
addOptionalLibrary(ZLIB ZLIB) addOptionalLibrary(ZLIB ZLIB)