From 2cd68ffe6946a757d56d52a709ae7689b1f93752 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Fri, 25 Sep 2020 15:40:17 +0800 Subject: [PATCH] TD-1574 compile in windows --- deps/zlib-1.2.11/CMakeLists.txt | 13 ++++++++----- src/os/src/detail/osDir.c | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/deps/zlib-1.2.11/CMakeLists.txt b/deps/zlib-1.2.11/CMakeLists.txt index 5502070819..f83aa70085 100644 --- a/deps/zlib-1.2.11/CMakeLists.txt +++ b/deps/zlib-1.2.11/CMakeLists.txt @@ -1,8 +1,11 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8) PROJECT(TDengine) -IF (TD_LINUX) - INCLUDE_DIRECTORIES(inc) - AUX_SOURCE_DIRECTORY(src SRC) - ADD_LIBRARY(z ${SRC}) -ENDIF () \ No newline at end of file +IF (TD_WINDOWS) + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /WX-") + SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /WX-") +ENDIF() + +INCLUDE_DIRECTORIES(inc) +AUX_SOURCE_DIRECTORY(src SRC) +ADD_LIBRARY(z ${SRC}) diff --git a/src/os/src/detail/osDir.c b/src/os/src/detail/osDir.c index bdb840ce01..30fd05ffc7 100644 --- a/src/os/src/detail/osDir.c +++ b/src/os/src/detail/osDir.c @@ -130,7 +130,7 @@ int32_t taosCompressFile(char *srcFileName, char *destFileName) { } while (!feof(srcFp)) { - len = (uLong)fread(data, 1, COMPRESS_STEP_SIZE, srcFp); + len = (int32_t)fread(data, 1, COMPRESS_STEP_SIZE, srcFp); gzwrite(dstFp, data, len); } -- GitLab