From e2d142914863a3141ee8151074c4c0f4c1a1fbf1 Mon Sep 17 00:00:00 2001 From: Ondrej Stava Date: Fri, 23 Apr 2021 18:59:45 -0700 Subject: [PATCH] Made it easier to use the library with external zstdlib implementations (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). --- CMakeLists.txt | 1 + encoder/basisu_comp.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 78dd1109..b26d1a9a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -133,6 +133,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() diff --git a/encoder/basisu_comp.cpp b/encoder/basisu_comp.cpp index dc4ae115..17943aca 100644 --- a/encoder/basisu_comp.cpp +++ b/encoder/basisu_comp.cpp @@ -26,7 +26,7 @@ #endif #if BASISD_SUPPORT_KTX2_ZSTD -#include "../zstd/zstd.h" +#include #endif // Set to 1 to disable the mipPadding alignment workaround (which only seems to be needed when no key-values are written at all)