Skip to content

Commit 8d86eba

Browse files
committed
removed the nested ifs
1 parent e5733f0 commit 8d86eba

1 file changed

Lines changed: 8 additions & 17 deletions

File tree

cmake/external_dependencies.cmake

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,15 @@
22
if(PLATFORM_ANDROID AND ANDROID_BUILD_ZLIB)
33
set(BUILD_ZLIB 1)
44
message(STATUS " Building Zlib as part of AWS SDK")
5-
elseif(NOT PLATFORM_WINDOWS AND NOT PLATFORM_CUSTOM)
6-
# Check if user explicitly disabled compression
7-
if(ENABLE_ZLIB_REQUEST_COMPRESSION STREQUAL "OFF")
8-
# User explicitly disabled, skip zlib check
5+
# If ENABLE_ZLIB_REQUEST_COMPRESSION is OFF, zlib check is skipped entirely
6+
elseif(NOT PLATFORM_WINDOWS AND NOT PLATFORM_CUSTOM AND
7+
NOT ENABLE_ZLIB_REQUEST_COMPRESSION STREQUAL "OFF")
8+
# If zlib is required either by openssl and curl in their linking chain, we should find it.
9+
include(FindZLIB)
10+
if(NOT ZLIB_FOUND)
11+
message(FATAL_ERROR "Could not find zlib")
912
else()
10-
# If zlib is required either by openssl and curl in their linking chain, we should find it.
11-
include(FindZLIB)
12-
if(NOT ZLIB_FOUND)
13-
if(ENABLE_ZLIB_REQUEST_COMPRESSION)
14-
# User explicitly enabled, require zlib
15-
message(FATAL_ERROR "Could not find zlib")
16-
else()
17-
# Default case: zlib not found, disable compression silently
18-
message(STATUS " Zlib not found; request compression will be disabled")
19-
endif()
20-
else()
21-
message(STATUS " Zlib library: ${ZLIB_LIBRARIES}")
22-
endif()
13+
message(STATUS " Zlib library: ${ZLIB_LIBRARIES}")
2314
endif()
2415
endif()
2516

0 commit comments

Comments
 (0)