-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove indirect dependency on system ZLIB (#26888)
* Remove indirect dependency on system ZLIB - build LLVM without ZLIB support - use the bundled ZLIB for libgit * backport bundled zlib patch Ref #26888 (cherry picked from commit 8770821)
- Loading branch information
Showing
3 changed files
with
64 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
From 637f75b2a341df6e308f8a20827dea938a39bd35 Mon Sep 17 00:00:00 2001 | ||
From: Valentin Churavy <[email protected]> | ||
Date: Mon, 23 Apr 2018 13:27:50 -0400 | ||
Subject: [PATCH] backport bundled zlib patch | ||
|
||
--- | ||
CMakeLists.txt | 23 ++++++++++++++--------- | ||
1 file changed, 14 insertions(+), 9 deletions(-) | ||
|
||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 4783e3ef9..aff84e75c 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -44,6 +44,7 @@ OPTION( USE_GSSAPI "Link with libgssapi for SPNEGO auth" OFF ) | ||
OPTION( VALGRIND "Configure build for valgrind" OFF ) | ||
OPTION( CURL "Use curl for HTTP if available" ON) | ||
OPTION( DEBUG_POOL "Enable debug pool allocator" OFF ) | ||
+OPTION( USE_BUNDLED_ZLIB "Use the bundled version of zlib" OFF ) | ||
|
||
IF(DEBUG_POOL) | ||
ADD_DEFINITIONS(-DGIT_DEBUG_POOL) | ||
@@ -340,17 +341,21 @@ ELSE() | ||
ENDIF() | ||
|
||
# Optional external dependency: zlib | ||
-FIND_PACKAGE(ZLIB) | ||
-IF (ZLIB_FOUND) | ||
- INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIRS}) | ||
- LINK_LIBRARIES(${ZLIB_LIBRARIES}) | ||
- IF(APPLE OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD") | ||
- LIST(APPEND LIBGIT2_PC_LIBS "-lz") | ||
+IF(NOT USE_BUNDLED_ZLIB) | ||
+ FIND_PACKAGE(ZLIB) | ||
+ IF (ZLIB_FOUND) | ||
+ INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIRS}) | ||
+ LINK_LIBRARIES(${ZLIB_LIBRARIES}) | ||
+ IF(APPLE OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD") | ||
+ LIST(APPEND LIBGIT2_PC_LIBS "-lz") | ||
+ ELSE() | ||
+ SET(LIBGIT2_PC_REQUIRES "${LIBGIT2_PC_REQUIRES} zlib") | ||
+ ENDIF() | ||
ELSE() | ||
- SET(LIBGIT2_PC_REQUIRES "${LIBGIT2_PC_REQUIRES} zlib") | ||
+ MESSAGE(STATUS "zlib was not found; using bundled 3rd-party sources." ) | ||
ENDIF() | ||
-ELSE() | ||
- MESSAGE(STATUS "zlib was not found; using bundled 3rd-party sources." ) | ||
+ENDIF() | ||
+IF(USE_BUNDLED_ZLIB OR NOT ZLIB_FOUND) | ||
INCLUDE_DIRECTORIES(deps/zlib) | ||
ADD_DEFINITIONS(-DNO_VIZ -DSTDC -DNO_GZIP) | ||
FILE(GLOB SRC_ZLIB deps/zlib/*.c deps/zlib/*.h) | ||
-- | ||
2.17.0 | ||
|