108 lines
3.8 KiB
Diff
Executable file
108 lines
3.8 KiB
Diff
Executable file
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|
index 8ca40f8..84fcb18 100644
|
|
--- a/CMakeLists.txt
|
|
+++ b/CMakeLists.txt
|
|
@@ -174,7 +174,6 @@ set(KTX_MAIN_SRC
|
|
lib/basisu/transcoder/basisu_transcoder.cpp
|
|
lib/basisu/transcoder/basisu_transcoder.h
|
|
lib/basisu/transcoder/basisu.h
|
|
- lib/basisu/zstd/zstd.c
|
|
lib/checkheader.c
|
|
lib/dfdutils/createdfd.c
|
|
lib/dfdutils/colourspaces.c
|
|
@@ -284,7 +283,6 @@ macro(commom_lib_settings lib write)
|
|
$<INSTALL_INTERFACE:lib/basisu/transcoder>
|
|
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/lib/basisu/zstd>
|
|
- $<INSTALL_INTERFACE:lib/basisu/zstd>
|
|
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/other_include>
|
|
$<INSTALL_INTERFACE:other_include>
|
|
@@ -361,6 +359,11 @@ macro(commom_lib_settings lib write)
|
|
endif()
|
|
|
|
if(WIN32)
|
|
+ find_package(zstd CONFIG REQUIRED)
|
|
+ target_link_libraries(
|
|
+ ${lib} PRIVATE
|
|
+ $<IF:$<TARGET_EXISTS:zstd::libzstd_shared>,zstd::libzstd_shared,zstd::libzstd_static>
|
|
+ )
|
|
# By wrapping in generator expression we force multi configuration
|
|
# generators (like Visual Studio) to take the exact path and not
|
|
# change it.
|
|
diff --git a/lib/basisu/CMakeLists.txt b/lib/basisu/CMakeLists.txt
|
|
index 492233a..8786d16 100644
|
|
--- a/lib/basisu/CMakeLists.txt
|
|
+++ b/lib/basisu/CMakeLists.txt
|
|
@@ -146,7 +146,7 @@ set(BASISU_SRC_LIST ${COMMON_SRC_LIST}
|
|
)
|
|
|
|
if (ZSTD)
|
|
- set(BASISU_SRC_LIST ${BASISU_SRC_LIST} zstd/zstd.c)
|
|
+ set(ZSTD_LIBRARIES "$<IF:$<TARGET_EXISTS:zstd::libzstd_shared>,zstd::libzstd_shared,zstd::libzstd_static>")
|
|
endif()
|
|
|
|
if (APPLE)
|
|
@@ -165,6 +165,10 @@ else()
|
|
target_compile_definitions(basisu PRIVATE BASISD_SUPPORT_KTX2_ZSTD=0)
|
|
endif()
|
|
|
|
+if(ZSTD_LIBRARIES)
|
|
+ target_link_libraries(basisu ${ZSTD_LIBRARIES})
|
|
+endif()
|
|
+
|
|
if (NOT MSVC)
|
|
# For Non-Windows builds, let cmake try and find the system OpenCL headers/libs for us.
|
|
if (OPENCL_FOUND)
|
|
diff --git a/lib/basisu/webgl/encoder/CMakeLists.txt b/lib/basisu/webgl/encoder/CMakeLists.txt
|
|
index 588d91b..0b38012 100644
|
|
--- a/lib/basisu/webgl/encoder/CMakeLists.txt
|
|
+++ b/lib/basisu/webgl/encoder/CMakeLists.txt
|
|
@@ -34,9 +34,7 @@ if (EMSCRIPTEN)
|
|
)
|
|
|
|
if (KTX2_ZSTANDARD)
|
|
- set(SRC_LIST ${SRC_LIST}
|
|
- ../../zstd/zstd.c
|
|
- )
|
|
+ set(ZSTD_LIBRARIES "$<IF:$<TARGET_EXISTS:zstd::libzstd_shared>,zstd::libzstd_shared,zstd::libzstd_static>")
|
|
set(ZSTD_DEFINITION BASISD_SUPPORT_KTX2_ZSTD=1)
|
|
else()
|
|
set(ZSTD_DEFINITION BASISD_SUPPORT_KTX2_ZSTD=0)
|
|
@@ -56,6 +54,10 @@ if (EMSCRIPTEN)
|
|
|
|
target_include_directories(basis_encoder.js PRIVATE ../../transcoder)
|
|
|
|
+ if(ZSTD_LIBRARIES)
|
|
+ target_link_libraries(basis_encoder.js ${ZSTD_LIBRARIES})
|
|
+ endif()
|
|
+
|
|
set_target_properties(basis_encoder.js PROPERTIES
|
|
OUTPUT_NAME "basis_encoder"
|
|
SUFFIX ".js"
|
|
diff --git a/lib/basisu/webgl/transcoder/CMakeLists.txt b/lib/basisu/webgl/transcoder/CMakeLists.txt
|
|
index 372653d..f75e3a3 100644
|
|
--- a/lib/basisu/webgl/transcoder/CMakeLists.txt
|
|
+++ b/lib/basisu/webgl/transcoder/CMakeLists.txt
|
|
@@ -28,9 +28,7 @@ if (EMSCRIPTEN)
|
|
endif()
|
|
|
|
if (KTX2_ZSTANDARD)
|
|
- set(SRC_LIST ${SRC_LIST}
|
|
- ../../zstd/zstddeclib.c
|
|
- )
|
|
+ set(ZSTD_LIBRARIES "$<IF:$<TARGET_EXISTS:zstd::libzstd_shared>,zstd::libzstd_shared,zstd::libzstd_static>")
|
|
set(ZSTD_DEFINITION BASISD_SUPPORT_KTX2_ZSTD=1)
|
|
else()
|
|
set(ZSTD_DEFINITION BASISD_SUPPORT_KTX2_ZSTD=0)
|
|
@@ -45,6 +43,10 @@ if (EMSCRIPTEN)
|
|
target_compile_options(basis_transcoder.js PRIVATE -O3 -fno-strict-aliasing)
|
|
target_include_directories(basis_transcoder.js PRIVATE ../../transcoder)
|
|
|
|
+ if(ZSTD_LIBRARIES)
|
|
+ target_link_libraries(basis_transcoder.js ${ZSTD_LIBRARIES})
|
|
+ endif()
|
|
+
|
|
set_target_properties(basis_transcoder.js PROPERTIES
|
|
OUTPUT_NAME "basis_transcoder"
|
|
SUFFIX ".js"
|