Skip to content

Commit 8472c8c

Browse files
committed
ADD: Add support zstd target with different name
1 parent 7f39978 commit 8472c8c

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## 0.17.1 - TBD
44

5+
### Enhancements
6+
- Added support for Conan-installed zstd (credit: @Hailios)
7+
58
### Bug fixes
69
- Added missing copying of `ts_event` when upgrading structs from DBNv1 to DBNv2
710
- Fixed setting of compiler warnings and warnings that had accumulated

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ target_link_libraries(
211211
OpenSSL::Crypto
212212
OpenSSL::SSL
213213
Threads::Threads
214-
zstd::zstd
214+
${ZSTD_TARGET}
215215
)
216216

217217
target_compile_definitions(

cmake/FindZstd.cmake

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,15 @@ if(ZSTD_FOUND AND NOT TARGET zstd::zstd)
5050
INTERFACE_INCLUDE_DIRECTORIES ${ZSTD_INCLUDE_DIR}
5151
)
5252
endif()
53+
54+
# Check if the Conan-provided target exists
55+
if(TARGET zstd::libzstd_static)
56+
# If the Conan target exists, use it
57+
set(ZSTD_TARGET zstd::libzstd_static)
58+
elseif(TARGET zstd::zstd)
59+
# If the system-installed target exists, use it
60+
set(ZSTD_TARGET zstd::zstd)
61+
else()
62+
# Error out if neither target is found
63+
message(FATAL_ERROR "Zstd target not found.")
64+
endif()

0 commit comments

Comments
 (0)