diff --git a/CMakeLists.txt b/CMakeLists.txt index 852eb2bf6c8..e8094b72550 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -98,6 +98,9 @@ if("${gRPC_ZLIB_PROVIDER}" STREQUAL "module") endif() set(ZLIB_INCLUDE_DIR "${ZLIB_ROOT_DIR}") if(EXISTS "${ZLIB_ROOT_DIR}/CMakeLists.txt") + # TODO(jtattermusch): workaround for https://github.com/madler/zlib/issues/218 + include_directories(${ZLIB_INCLUDE_DIR}) + add_subdirectory(${ZLIB_ROOT_DIR} third_party/zlib) if(TARGET zlibstatic) set(_gRPC_ZLIB_LIBRARIES zlibstatic) diff --git a/templates/CMakeLists.txt.template b/templates/CMakeLists.txt.template index ef0faccb2e8..91bed9a6db1 100644 --- a/templates/CMakeLists.txt.template +++ b/templates/CMakeLists.txt.template @@ -143,6 +143,9 @@ endif() set(ZLIB_INCLUDE_DIR "<%text>${ZLIB_ROOT_DIR}") if(EXISTS "<%text>${ZLIB_ROOT_DIR}/CMakeLists.txt") + # TODO(jtattermusch): workaround for https://github.com/madler/zlib/issues/218 + include_directories(<%text>${ZLIB_INCLUDE_DIR}) + add_subdirectory(<%text>${ZLIB_ROOT_DIR} third_party/zlib) if(TARGET zlibstatic) set(_gRPC_ZLIB_LIBRARIES zlibstatic)