Skip to content

Commit

Permalink
Made it easier to use the library with external zstdlib implementatio…
Browse files Browse the repository at this point in the history
…ns (mostly in non CMake builds).

In our internal repository, we have our own version of zstdlib and introducing extra copy is both undesirable and potentially dangerous (due to ODR violations).

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
  • Loading branch information
ondys and akien-mga committed Feb 21, 2023
1 parent 8903f6d commit b4a0fa2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ add_executable(basisu ${BASISU_SRC_LIST})

if (ZSTD)
target_compile_definitions(basisu PRIVATE BASISD_SUPPORT_KTX2_ZSTD=1)
target_include_directories(basisu PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/zstd)
else()
target_compile_definitions(basisu PRIVATE BASISD_SUPPORT_KTX2_ZSTD=0)
endif()
Expand Down
2 changes: 1 addition & 1 deletion encoder/basisu_comp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,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)
Expand Down
2 changes: 1 addition & 1 deletion transcoder/basisu_transcoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,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

Expand Down

0 comments on commit b4a0fa2

Please sign in to comment.