Skip to content

Commit

Permalink
ADD: Add support zstd target with different name
Browse files Browse the repository at this point in the history
  • Loading branch information
Hailios committed Apr 4, 2024
1 parent 7f39978 commit 8472c8c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## 0.17.1 - TBD

### Enhancements
- Added support for Conan-installed zstd (credit: @Hailios)

### Bug fixes
- Added missing copying of `ts_event` when upgrading structs from DBNv1 to DBNv2
- Fixed setting of compiler warnings and warnings that had accumulated
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ target_link_libraries(
OpenSSL::Crypto
OpenSSL::SSL
Threads::Threads
zstd::zstd
${ZSTD_TARGET}
)

target_compile_definitions(
Expand Down
12 changes: 12 additions & 0 deletions cmake/FindZstd.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,15 @@ if(ZSTD_FOUND AND NOT TARGET zstd::zstd)
INTERFACE_INCLUDE_DIRECTORIES ${ZSTD_INCLUDE_DIR}
)
endif()

# Check if the Conan-provided target exists
if(TARGET zstd::libzstd_static)
# If the Conan target exists, use it
set(ZSTD_TARGET zstd::libzstd_static)
elseif(TARGET zstd::zstd)
# If the system-installed target exists, use it
set(ZSTD_TARGET zstd::zstd)
else()
# Error out if neither target is found
message(FATAL_ERROR "Zstd target not found.")
endif()

0 comments on commit 8472c8c

Please sign in to comment.