Skip to content

Commit

Permalink
build: Fix lzma support and simplify zstd building
Browse files Browse the repository at this point in the history
  • Loading branch information
WerWolv committed Jul 9, 2024
1 parent edb1a88 commit cb406ea
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
6 changes: 5 additions & 1 deletion cmake/modules/FindZSTD.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,8 @@ if (ZSTD_FOUND)
message(STATUS "Found Zstd: ${ZSTD_LIBRARY}")
endif()

mark_as_advanced(ZSTD_INCLUDE_DIR ZSTD_LIBRARY)
mark_as_advanced(ZSTD_INCLUDE_DIR ZSTD_LIBRARY)

add_library(ZSTD::zstd INTERFACE IMPORTED)
set_property(TARGET ZSTD::zstd PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${ZSTD_INCLUDE_DIR})
set_property(TARGET ZSTD::zstd PROPERTY INTERFACE_LINK_LIBRARIES ${ZSTD_LIBRARY})
10 changes: 4 additions & 6 deletions plugins/decompress/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,12 @@ add_imhex_plugin(
ZSTD "zstd Support"
)

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()
set(LIBLZMA_HAS_AUTO_DECODER 1)
set(LIBLZMA_HAS_EASY_ENCODER 1)
set(LIBLZMA_HAS_LZMA_PRESET 1)

addOptionalLibrary(ZLIB ZLIB)
addOptionalLibrary(BZip2 BZip2)
addOptionalLibrary(LibLZMA LibLZMA)
addOptionalLibrary(ZSTD zstd)
target_link_libraries(decompress PRIVATE ${LIBRARIES})

0 comments on commit cb406ea

Please sign in to comment.