From b382a451a967eb16968b65238547e6ee795d9d91 Mon Sep 17 00:00:00 2001 From: Omair Majid Date: Fri, 20 Dec 2024 13:11:21 -0500 Subject: [PATCH] Fix build with -DCLR_CMAKE_USE_SYSTEM_BROTLI=true (#110816) --- .../libs/System.IO.Compression.Native/CMakeLists.txt | 4 ++++ .../libs/System.IO.Compression.Native/extra_libs.cmake | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/src/native/libs/System.IO.Compression.Native/CMakeLists.txt b/src/native/libs/System.IO.Compression.Native/CMakeLists.txt index 0734e8a3112b6d..2f8b16276783f6 100644 --- a/src/native/libs/System.IO.Compression.Native/CMakeLists.txt +++ b/src/native/libs/System.IO.Compression.Native/CMakeLists.txt @@ -7,6 +7,10 @@ if (NOT CLR_CMAKE_USE_SYSTEM_ZLIB) endif() if (CLR_CMAKE_USE_SYSTEM_BROTLI) + find_library(BROTLIDEC brotlidec REQUIRED) + find_library(BROTLIENC brotlienc REQUIRED) + list(APPEND ${BROTLI_LIBRARIES} ${BROTLIDEC} ${BROTLIENC}) + if (CLR_CMAKE_HOST_FREEBSD) set(CMAKE_REQUIRED_INCLUDES ${CROSS_ROOTFS}/usr/local/include) endif() diff --git a/src/native/libs/System.IO.Compression.Native/extra_libs.cmake b/src/native/libs/System.IO.Compression.Native/extra_libs.cmake index f10684f561bf70..03b40533e2109d 100644 --- a/src/native/libs/System.IO.Compression.Native/extra_libs.cmake +++ b/src/native/libs/System.IO.Compression.Native/extra_libs.cmake @@ -19,4 +19,11 @@ macro(append_extra_compression_libs NativeLibsExtra) list(APPEND ZLIB_LIBRARIES $,z,zlib>) endif () list(APPEND ${NativeLibsExtra} ${ZLIB_LIBRARIES}) + + if (CLR_CMAKE_USE_SYSTEM_BROTLI) + find_library(BROTLIDEC brotlidec REQUIRED) + find_library(BROTLIENC brotlienc REQUIRED) + + list(APPEND ${NativeLibsExtra} ${BROTLIDEC} ${BROTLIENC}) + endif () endmacro()