aboutsummaryrefslogtreecommitdiffstats
path: root/tools/cmake/patches/140-zlib.patch
diff options
context:
space:
mode:
authorRosen Penev <rosenp@gmail.com>2022-09-24 16:57:40 -0700
committerHauke Mehrtens <hauke@hauke-m.de>2023-11-21 00:38:36 +0100
commitd8aa8ae8e98b53b059bf32a6877a5b01ec78a3e0 (patch)
tree58eb4e57c2f75a71e2e9926bb79068a4c3cee1c2 /tools/cmake/patches/140-zlib.patch
parent35fd7762b2771958d3fcf33863c753ee72ff214c (diff)
downloadupstream-d8aa8ae8e98b53b059bf32a6877a5b01ec78a3e0.tar.gz
upstream-d8aa8ae8e98b53b059bf32a6877a5b01ec78a3e0.tar.bz2
upstream-d8aa8ae8e98b53b059bf32a6877a5b01ec78a3e0.zip
tools/cmake: Build without some included libs
Saves a little bit of time when compiling cmake. Added patches to fix searching liblzma and zlib. The issue is that because pkgconfig is not used, the system libraries get used. Signed-off-by: Rosen Penev <rosenp@gmail.com> (cherry picked from commit 3848cf458ef998fc9971edd6a01cc9cdb43fbef9)
Diffstat (limited to 'tools/cmake/patches/140-zlib.patch')
-rw-r--r--tools/cmake/patches/140-zlib.patch20
1 files changed, 20 insertions, 0 deletions
diff --git a/tools/cmake/patches/140-zlib.patch b/tools/cmake/patches/140-zlib.patch
new file mode 100644
index 0000000000..f79801c8a5
--- /dev/null
+++ b/tools/cmake/patches/140-zlib.patch
@@ -0,0 +1,20 @@
+--- a/Modules/FindZLIB.cmake
++++ b/Modules/FindZLIB.cmake
+@@ -85,10 +85,13 @@ else()
+ set(ZLIB_NAMES_DEBUG zd zlibd zdlld zlibd1 zlib1d zlibstaticd zlibwapid zlibvcd zlibstatd)
+ endif()
+
+-# Try each search configuration.
+-foreach(search ${_ZLIB_SEARCHES})
+- find_path(ZLIB_INCLUDE_DIR NAMES zlib.h ${${search}} PATH_SUFFIXES include)
+-endforeach()
++if(UNIX)
++ find_package(PkgConfig QUIET)
++ pkg_search_module(PC_zlib zlib)
++endif()
++
++find_path(ZLIB_INCLUDE_DIR zlib.h HINTS ${PC_zlib_INCLUDEDIR} ${PC_zlib_INCLUDE_DIRS})
++find_library(ZLIB_LIBRARY NAMES z HINTS ${PC_zlib_LIBDIR} ${PC_zlib_LIBRARY_DIRS})
+
+ # Allow ZLIB_LIBRARY to be set manually, as the location of the zlib library
+ if(NOT ZLIB_LIBRARY)