From 9688c8cb5e52113d93c0f2eccafb728ce3086aef Mon Sep 17 00:00:00 2001 From: zhengyuanhua Date: Thu, 8 Dec 2022 11:21:26 +0800 Subject: [PATCH] [bugfix] fix cloud compile --- cmake/external_libs/zlib.cmake | 10 ++++++++-- mindspore/lite/minddata/CMakeLists.txt | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/cmake/external_libs/zlib.cmake b/cmake/external_libs/zlib.cmake index 1235d4b1e43..575147cf98d 100644 --- a/cmake/external_libs/zlib.cmake +++ b/cmake/external_libs/zlib.cmake @@ -6,14 +6,20 @@ else() set(SHA256 "629380c90a77b964d896ed37163f5c3a34f6e6d897311f1df2a7016355c45eff") endif() +if(BUILD_LITE) + set(ZLIB_PATCH_ROOT ${TOP_DIR}/third_party/patch/zlib) +else() + set(ZLIB_PATCH_ROOT ${CMAKE_SOURCE_DIR}/third_party/patch/zlib) +endif() + mindspore_add_pkg(zlib VER 1.2.11 LIBS z URL ${REQ_URL} SHA256 ${SHA256} CMAKE_OPTION -DCMAKE_BUILD_TYPE:STRING=Release - PATCHES ${CMAKE_SOURCE_DIR}/third_party/patch/zlib/CVE-2018-25032.patch - PATCHES ${CMAKE_SOURCE_DIR}/third_party/patch/zlib/CVE-2022-37434.patch) + PATCHES ${ZLIB_PATCH_ROOT}/CVE-2018-25032.patch + PATCHES ${ZLIB_PATCH_ROOT}/CVE-2022-37434.patch) include_directories(${zlib_INC}) add_library(mindspore::z ALIAS zlib::z) diff --git a/mindspore/lite/minddata/CMakeLists.txt b/mindspore/lite/minddata/CMakeLists.txt index b76b6a9f53d..96521df1358 100644 --- a/mindspore/lite/minddata/CMakeLists.txt +++ b/mindspore/lite/minddata/CMakeLists.txt @@ -5,6 +5,7 @@ if(NOT Patch_FOUND) endif() include(${TOP_DIR}/cmake/external_libs/jpeg_turbo.cmake) +include(${TOP_DIR}/cmake/external_libs/zlib.cmake) set(MINDDATA_DIR ${CCSRC_DIR}/minddata/dataset) set(CMAKE_CXX_STANDARD 17)