summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2017-12-23 10:09:12 +0000
committerGitHub <noreply@github.com>2017-12-23 10:09:12 +0000
commit1ddc57b3d377221345a881642f2726cd718fe8ca (patch)
treeb9f4841fe6214a73a046f42bea182cae59856bac
parent06f3aa5f6be216b8074ca7958067a41c8d538937 (diff)
parentbbb213c1d21c3efda1c2ccfe3a39524cad5370fa (diff)
downloadlibgit2-1ddc57b3d377221345a881642f2726cd718fe8ca.tar.gz
Merge pull request #4402 from libgit2/ethomson/iconv
cmake: let USE_ICONV be optional on macOS
-rw-r--r--CMakeLists.txt8
-rw-r--r--src/CMakeLists.txt2
2 files changed, 7 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 549f34ad8..bedf85819 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -43,7 +43,6 @@ OPTION( ENABLE_TRACE "Enables tracing support" OFF )
OPTION( LIBGIT2_FILENAME "Name of the produced binary" OFF )
OPTION( USE_SHA1DC "Use SHA-1 with collision detection" OFF )
-OPTION( USE_ICONV "Link with and use iconv library" OFF )
OPTION( USE_SSH "Link with libssh to enable SSH support" ON )
OPTION( USE_HTTPS "Enable HTTPS support. Can be set to a specific backend" ON )
OPTION( USE_GSSAPI "Link with libgssapi for SPNEGO auth" OFF )
@@ -52,10 +51,15 @@ OPTION( CURL "Use curl for HTTP if available" ON)
OPTION( USE_EXT_HTTP_PARSER "Use system HTTP_Parser if available" ON)
OPTION( DEBUG_POOL "Enable debug pool allocator" OFF )
OPTION( ENABLE_WERROR "Enable compilation with -Werror" OFF )
+OPTION( USE_BUNDLED_ZLIB "Use the bundled version of zlib" OFF )
+
IF (UNIX AND NOT APPLE)
OPTION( ENABLE_REPRODUCIBLE_BUILDS "Enable reproducible builds" OFF )
ENDIF()
-OPTION( USE_BUNDLED_ZLIB "Use the bundled version of zlib" OFF )
+
+IF (APPLE)
+ OPTION( USE_ICONV "Link with and use iconv library" ON )
+ENDIF()
IF(MSVC)
# This option is only available when building with MSVC. By default, libgit2
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index e456ab725..2c82d1f59 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -310,7 +310,7 @@ ENDIF()
ADD_FEATURE_INFO(SPNEGO GIT_GSSAPI "SPNEGO authentication support")
# Optional external dependency: iconv
-IF (USE_ICONV OR CMAKE_SYSTEM_NAME MATCHES "Darwin")
+IF (USE_ICONV)
FIND_PACKAGE(Iconv)
ENDIF()
IF (ICONV_FOUND)