diff --git a/cmake/lzma_CMakeLists.txt.in b/cmake/lzma_CMakeLists.txt.in index ec16983a52..fb16f89034 100644 --- a/cmake/lzma_CMakeLists.txt.in +++ b/cmake/lzma_CMakeLists.txt.in @@ -1,5 +1,7 @@ # xz + +if (${TD_LINUX}) ExternalProject_Add(lzma2 GIT_REPOSITORY https://github.com/conor42/fast-lzma2.git SOURCE_DIR "${TD_CONTRIB_DIR}/lzma2" @@ -9,4 +11,5 @@ ExternalProject_Add(lzma2 BUILD_COMMAND make INSTALL_COMMAND "" TEST_COMMAND "" -) \ No newline at end of file +) +endif() \ No newline at end of file diff --git a/cmake/xz_CMakeLists.txt.in b/cmake/xz_CMakeLists.txt.in index 6287cad076..dc79974fda 100644 --- a/cmake/xz_CMakeLists.txt.in +++ b/cmake/xz_CMakeLists.txt.in @@ -1,5 +1,7 @@ # xz + +if (${TD_LINUX}) ExternalProject_Add(xz GIT_REPOSITORY https://github.com/xz-mirror/xz.git GIT_TAG v5.4.4 @@ -11,4 +13,5 @@ ExternalProject_Add(xz BUILD_COMMAND "" INSTALL_COMMAND "" TEST_COMMAND "" -) \ No newline at end of file +) +endif() \ No newline at end of file diff --git a/cmake/zlib_CMakeLists.txt.in b/cmake/zlib_CMakeLists.txt.in index 6c162eb5de..8f45ecc497 100644 --- a/cmake/zlib_CMakeLists.txt.in +++ b/cmake/zlib_CMakeLists.txt.in @@ -1,5 +1,8 @@ # zlib + + +if (${TD_LINUX}) ExternalProject_Add(zlib GIT_REPOSITORY https://github.com/taosdata-contrib/zlib.git GIT_TAG v1.2.11 @@ -10,4 +13,5 @@ ExternalProject_Add(zlib BUILD_COMMAND "" INSTALL_COMMAND "" TEST_COMMAND "" -) \ No newline at end of file +) +endif() diff --git a/cmake/zstd_CMakeLists.txt.in b/cmake/zstd_CMakeLists.txt.in index 1a5d6bb13e..f8604f9db6 100644 --- a/cmake/zstd_CMakeLists.txt.in +++ b/cmake/zstd_CMakeLists.txt.in @@ -1,5 +1,6 @@ # zstb + #ExternalProject_Add(zstd #GIT_REPOSITORY https://github.com/facebook/zstd.git #GIT_TAG v1.5.5 diff --git a/source/util/src/tcompression.c b/source/util/src/tcompression.c index fee7d9b127..ad07c61f57 100644 --- a/source/util/src/tcompression.c +++ b/source/util/src/tcompression.c @@ -50,14 +50,16 @@ #define _DEFAULT_SOURCE #include "tcompression.h" #include "lz4.h" -#include "tcompare.h" #include "tlog.h" #include "ttypes.h" // #include "tmsg.h" +#if defined(WINDOWS) || defined(_TD_DARWIN_64) +#else #include "fast-lzma2.h" #include "zlib.h" #include "zstd.h" +#endif #ifdef TD_TSZ #include "td_sz.h" @@ -272,6 +274,15 @@ TCompressL1FnSet compressL1Dict[] = {{"PLAIN", NULL, tsCompressPlain2, tsDecompr {"BIT-PACKING", NULL, tsCompressBoolImp2, tsDecompressBoolImp2}, {"DELTAD", NULL, tsCompressDoubleImp2, tsDecompressDoubleImp2}}; +#if defined(WINDOWS) || defined(_TD_DARWIN_64) +TCompressL2FnSet compressL2Dict[] = { + {"unknown", l2ComressInitImpl_disabled, l2CompressImpl_disabled, l2DecompressImpl_disabled}, + {"lz4", l2ComressInitImpl_lz4, l2CompressImpl_lz4, l2DecompressImpl_lz4}, + {"zlib", l2ComressInitImpl_lz4, l2CompressImpl_lz4, l2DecompressImpl_lz4}, + {"zstd", l2ComressInitImpl_lz4, l2CompressImpl_lz4, l2DecompressImpl_lz4}, + {"tsz", l2ComressInitImpl_lz4, l2CompressImpl_tsz, l2DecompressImpl_tsz}, + {"xz", l2ComressInitImpl_lz4, l2CompressImpl_lz4, l2DecompressImpl_lz4}}; +#else TCompressL2FnSet compressL2Dict[] = { {"unknown", l2ComressInitImpl_disabled, l2CompressImpl_disabled, l2DecompressImpl_disabled}, {"lz4", l2ComressInitImpl_lz4, l2CompressImpl_lz4, l2DecompressImpl_lz4}, @@ -280,6 +291,8 @@ TCompressL2FnSet compressL2Dict[] = { {"tsz", l2ComressInitImpl_tsz, l2CompressImpl_tsz, l2DecompressImpl_tsz}, {"xz", l2ComressInitImpl_xz, l2CompressImpl_xz, l2DecompressImpl_xz}}; +#endif + static const int32_t TEST_NUMBER = 1; #define is_bigendian() ((*(char *)&TEST_NUMBER) == 0) #define SIMPLE8B_MAX_INT64 ((uint64_t)1152921504606846974LL)