diff --git a/cmake/external_dependencies.cmake b/cmake/external_dependencies.cmake index 17ddce5405e..80fb8989f90 100644 --- a/cmake/external_dependencies.cmake +++ b/cmake/external_dependencies.cmake @@ -2,8 +2,10 @@ if(PLATFORM_ANDROID AND ANDROID_BUILD_ZLIB) set(BUILD_ZLIB 1) message(STATUS " Building Zlib as part of AWS SDK") -elseif(NOT PLATFORM_WINDOWS AND NOT PLATFORM_CUSTOM) - #If zlib is required either by openssl and curl in their linking chain, we should find it. +# If ENABLE_ZLIB_REQUEST_COMPRESSION is OFF, zlib check is skipped entirely +elseif(NOT PLATFORM_WINDOWS AND NOT PLATFORM_CUSTOM AND + NOT ENABLE_ZLIB_REQUEST_COMPRESSION STREQUAL "OFF") + # If zlib is required either by openssl and curl in their linking chain, we should find it. include(FindZLIB) if(NOT ZLIB_FOUND) message(FATAL_ERROR "Could not find zlib")