summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2023-07-11 13:58:37 +0800
committerErik Kundiman <erik@megapahit.org>2023-07-19 10:46:06 +0800
commitf02ec9ba5df6c788399a28d57942485ca21529b7 (patch)
treef16838dc48c3030c6ae2a20a6de93cfd0d44909f
parent9a3c16da3bd845964de4bc9dfe297bb3901ad84f (diff)
Keep using Zlib (no -ng) when using system libs
Calls to zlib-ng in the viewer code aren't prefixed. And in order to build, the zlib-ng package needs to be configured with the ZLIB_COMPAT option on. Some package managers may not have provided the option on, or to turn that on, yet.
-rw-r--r--indra/cmake/ZLIBNG.cmake6
1 files changed, 6 insertions, 0 deletions
diff --git a/indra/cmake/ZLIBNG.cmake b/indra/cmake/ZLIBNG.cmake
index 5d99cd9709..60164116dd 100644
--- a/indra/cmake/ZLIBNG.cmake
+++ b/indra/cmake/ZLIBNG.cmake
@@ -8,6 +8,12 @@ add_library( ll::zlib-ng INTERFACE IMPORTED )
if(USE_CONAN )
target_link_libraries( ll::zlib-ng INTERFACE CONAN_PKG::zlib )
return()
+elseif(NOT USE_AUTOBUILD_3P)
+ pkg_check_modules(Zlib REQUIRED zlib)
+ target_include_directories( ll::zlib-ng SYSTEM INTERFACE ${Zlib_INCLUDE_DIRS})
+ target_link_directories( ll::zlib-ng INTERFACE ${Zlib_LIBRARY_DIRS} )
+ target_link_libraries( ll::zlib-ng INTERFACE ${Zlib_LIBRARIES})
+ return()
endif()
use_prebuilt_binary(zlib-ng)