blob: 5a8650fe0c7ec2ba2a20fcd17161b5af784e0806 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8345623..9ef432e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -162,10 +162,6 @@ set(ENCODER_LIB_SRC_LIST
transcoder/basisu_transcoder.cpp
)
-if (ZSTD)
- set(ENCODER_LIB_SRC_LIST ${ENCODER_LIB_SRC_LIST} zstd/zstd.c)
-endif()
-
# Create the static library
add_library(basisu_encoder STATIC ${ENCODER_LIB_SRC_LIST})
@@ -180,6 +176,9 @@ target_link_libraries(examples PRIVATE basisu_encoder)
if (ZSTD)
target_compile_definitions(basisu PRIVATE BASISD_SUPPORT_KTX2_ZSTD=1)
target_compile_definitions(examples PRIVATE BASISD_SUPPORT_KTX2_ZSTD=1)
+
+ find_package(zstd CONFIG REQUIRED)
+ target_link_libraries(basisu_encoder PRIVATE zstd::libzstd)
else()
target_compile_definitions(basisu PRIVATE BASISD_SUPPORT_KTX2_ZSTD=0)
target_compile_definitions(examples PRIVATE BASISD_SUPPORT_KTX2_ZSTD=0)
diff --git a/encoder/basisu_comp.cpp b/encoder/basisu_comp.cpp
index a6a9963..3fb2994 100644
--- a/encoder/basisu_comp.cpp
+++ b/encoder/basisu_comp.cpp
@@ -33,7 +33,7 @@
#endif
#if BASISD_SUPPORT_KTX2_ZSTD
-#include "../zstd/zstd.h"
+#include <zstd.h>
#endif
// Set to 1 to disable the mipPadding alignment workaround (which only seems to be needed when no key-values are written at all)
diff --git a/transcoder/basisu_transcoder.cpp b/transcoder/basisu_transcoder.cpp
index ea994b0..996188e 100644
--- a/transcoder/basisu_transcoder.cpp
+++ b/transcoder/basisu_transcoder.cpp
@@ -164,7 +164,7 @@
// If BASISD_SUPPORT_KTX2_ZSTD is 0, UASTC files compressed with Zstd cannot be loaded.
#if BASISD_SUPPORT_KTX2_ZSTD
// We only use two Zstd API's: ZSTD_decompress() and ZSTD_isError()
- #include "../zstd/zstd.h"
+ #include <zstd.h>
#endif
#endif
|