Skip to content

Commit

Permalink
CMakeLists.txt - introduce MZ_ICONV to allow user to explicitely disa…
Browse files Browse the repository at this point in the history
…ble iconv
  • Loading branch information
ptc-tgamper authored and nmoinvaz committed Dec 1, 2020
1 parent 9ffb08e commit 628830f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions CMakeLists.txt
Expand Up @@ -20,6 +20,7 @@ option(MZ_LIBCOMP "Enables Apple compression" OFF)
option(MZ_OPENSSL "Enables OpenSSL for encryption" OFF)
option(MZ_LIBBSD "Enable libbsd crypto random" ON)
option(MZ_BRG "Enables Brian Gladman's encryption library" OFF)
option(MZ_ICONV "Enables iconv for string encoding conversion" ON)
option(MZ_SIGNING "Enables zip signing support" ON)
option(MZ_COMPRESS_ONLY "Only support compression" OFF)
option(MZ_DECOMPRESS_ONLY "Only support decompression" OFF)
Expand Down Expand Up @@ -392,7 +393,10 @@ if(UNIX)

# Iconv is only necessary when it is not already built-in
# FindIconv requires cmake 3.11 or higher
find_package(Iconv QUIET)
if (MZ_ICONV)
find_package(Iconv QUIET)
endif()

if(Iconv_FOUND)
message(STATUS "Using Iconv")

Expand All @@ -405,7 +409,7 @@ if(UNIX)

set(PC_PRIVATE_LIBS "${PC_PRIVATE_LIBS} -liconv")
else()
message(WARNING "Limited encoding support due to missing iconv")
message(WARNING "Limited encoding support due to disabled or missing iconv")
endif()
endif()

Expand Down Expand Up @@ -898,6 +902,7 @@ add_feature_info(MZ_LIBCOMP MZ_LIBCOMP "Enables Apple compression")
add_feature_info(MZ_OPENSSL MZ_OPENSSL "Enables OpenSSL for encryption")
add_feature_info(MZ_LIBBSD MZ_LIBBSD "Build with libbsd for crypto random")
add_feature_info(MZ_BRG MZ_BRG "Enables Brian Gladman's encryption library")
add_feature_info(MZ_ICONV MZ_ICONV "Enables iconv string encoding conversion library")
add_feature_info(MZ_SIGNING MZ_SIGNING "Enables zip signing support")
add_feature_info(MZ_COMPRESS_ONLY MZ_COMPRESS_ONLY "Only support compression")
add_feature_info(MZ_DECOMPRESS_ONLY MZ_DECOMPRESS_ONLY "Only support decompression")
Expand Down

0 comments on commit 628830f

Please sign in to comment.