diff --git a/extension/parquet/CMakeLists.txt b/extension/parquet/CMakeLists.txt index e6b469dd812d..7ac04d0d52b0 100644 --- a/extension/parquet/CMakeLists.txt +++ b/extension/parquet/CMakeLists.txt @@ -3,14 +3,8 @@ cmake_minimum_required(VERSION 3.5...3.29) project(ParquetExtension) include_directories( - include - ../../third_party/lz4 - ../../third_party/parquet - ../../third_party/thrift - ../../third_party/snappy - ../../third_party/zstd/include - ../../third_party/mbedtls - ../../third_party/mbedtls/include + include ../../third_party/lz4 ../../third_party/parquet + ../../third_party/thrift ../../third_party/snappy ../../third_party/brotli/include) set(PARQUET_EXTENSION_FILES @@ -40,30 +34,6 @@ if(NOT CLANG_TIDY) # lz4 set(PARQUET_EXTENSION_FILES ${PARQUET_EXTENSION_FILES} ../../third_party/lz4/lz4.cpp) - # zstd - set(PARQUET_EXTENSION_FILES - ${PARQUET_EXTENSION_FILES} - ../../third_party/zstd/common/entropy_common.cpp - ../../third_party/zstd/common/fse_decompress.cpp - ../../third_party/zstd/common/zstd_common.cpp - ../../third_party/zstd/common/error_private.cpp - ../../third_party/zstd/common/xxhash.cpp - ../../third_party/zstd/decompress/zstd_ddict.cpp - ../../third_party/zstd/decompress/huf_decompress.cpp - ../../third_party/zstd/decompress/zstd_decompress.cpp - ../../third_party/zstd/decompress/zstd_decompress_block.cpp - ../../third_party/zstd/compress/fse_compress.cpp - ../../third_party/zstd/compress/hist.cpp - ../../third_party/zstd/compress/huf_compress.cpp - ../../third_party/zstd/compress/zstd_compress.cpp - ../../third_party/zstd/compress/zstd_compress_literals.cpp - ../../third_party/zstd/compress/zstd_compress_sequences.cpp - ../../third_party/zstd/compress/zstd_compress_superblock.cpp - ../../third_party/zstd/compress/zstd_double_fast.cpp - ../../third_party/zstd/compress/zstd_fast.cpp - ../../third_party/zstd/compress/zstd_lazy.cpp - ../../third_party/zstd/compress/zstd_ldm.cpp - ../../third_party/zstd/compress/zstd_opt.cpp) # brotli set(PARQUET_EXTENSION_FILES ${PARQUET_EXTENSION_FILES} @@ -103,7 +73,7 @@ endif() build_static_extension(parquet ${PARQUET_EXTENSION_FILES}) set(PARAMETERS "-warnings") build_loadable_extension(parquet ${PARAMETERS} ${PARQUET_EXTENSION_FILES}) -target_link_libraries(parquet_loadable_extension duckdb_mbedtls) +target_link_libraries(parquet_loadable_extension duckdb_mbedtls duckdb_zstd) install( TARGETS parquet_extension diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c9d2bef3c87e..2804bb715df6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -105,7 +105,8 @@ else() duckdb_fastpforlib duckdb_skiplistlib duckdb_mbedtls - duckdb_yyjson) + duckdb_yyjson + duckdb_zstd) add_library(duckdb SHARED ${ALL_OBJECT_FILES}) diff --git a/third_party/zstd/CMakeLists.txt b/third_party/zstd/CMakeLists.txt index d108068cda49..a983c9e6c388 100644 --- a/third_party/zstd/CMakeLists.txt +++ b/third_party/zstd/CMakeLists.txt @@ -40,8 +40,8 @@ set(ZSTD_FILES add_library(duckdb_zstd STATIC ${ZSTD_FILES}) target_include_directories( - duckdb_zstd - PUBLIC $) + duckdb_zstd + PUBLIC $) set_target_properties(duckdb_zstd PROPERTIES EXPORT_NAME duckdb_duckdb_zstd) install(TARGETS duckdb_zstd diff --git a/third_party/zstd/include/zstd.h b/third_party/zstd/include/zstd.h index 9190273e8e4e..8b40c366eb92 100644 --- a/third_party/zstd/include/zstd.h +++ b/third_party/zstd/include/zstd.h @@ -12,7 +12,9 @@ #define ZSTD_H_235446 // DuckDB: just enable everything for amalgamation +#ifdef DUCKDB_AMALGAMATION #define ZSTD_STATIC_LINKING_ONLY +#endif /* ====== Dependencies ======*/ #include /* INT_MAX */ diff --git a/third_party/zstd/include/zstd/common/fse.h b/third_party/zstd/include/zstd/common/fse.h index 3fb46a3ad251..9df59ff14b8b 100644 --- a/third_party/zstd/include/zstd/common/fse.h +++ b/third_party/zstd/include/zstd/common/fse.h @@ -21,9 +21,6 @@ * Dependencies ******************************************/ -// DuckDB: just enable everything for amalgamation -#define FSE_STATIC_LINKING_ONLY - #include "zstd/common/zstd_deps.h" /* size_t, ptrdiff_t */ namespace duckdb_zstd { diff --git a/third_party/zstd/include/zstd/common/zstd_deps.h b/third_party/zstd/include/zstd/common/zstd_deps.h index dd4948222f09..0be68bbb1764 100644 --- a/third_party/zstd/include/zstd/common/zstd_deps.h +++ b/third_party/zstd/include/zstd/common/zstd_deps.h @@ -36,6 +36,7 @@ #define ZSTD_DEPS_NEED_IO #define ZSTD_DEPS_NEED_STDINT #define ZSTD_MULTITHREAD +#define FSE_STATIC_LINKING_ONLY #endif #if defined(__GNUC__) && __GNUC__ >= 4 diff --git a/third_party/zstd/include/zstd/deprecated/zbuff.h b/third_party/zstd/include/zstd/deprecated/zbuff.h index 6a422b91319f..04c75ef1affb 100644 --- a/third_party/zstd/include/zstd/deprecated/zbuff.h +++ b/third_party/zstd/include/zstd/deprecated/zbuff.h @@ -22,7 +22,7 @@ /* ************************************* * Dependencies ***************************************/ -// DuckDB: just enable everything for amalgamation +// DuckDB: just enable everything #define ZSTD_STATIC_LINKING_ONLY #include /* size_t */