forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathextra_libs.cmake
More file actions
34 lines (31 loc) · 1.4 KB
/
extra_libs.cmake
File metadata and controls
34 lines (31 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
macro(append_extra_compression_libs NativeLibsExtra)
set(ZLIB_LIBRARIES "")
# TODO: remove the mono-style HOST_ variable checks once Mono is using eng/native/configureplatform.cmake to define the CLR_CMAKE_TARGET_ defines
if (CLR_CMAKE_TARGET_BROWSER OR HOST_BROWSER OR CLR_CMAKE_TARGET_WASI OR HOST_WASI)
# nothing special to link
elseif (CLR_CMAKE_HOST_ARCH_ARMV6)
find_package(ZLIB REQUIRED)
list(APPEND ZLIB_LIBRARIES z)
elseif (CLR_CMAKE_TARGET_APPLE_MOBILE)
find_package(ZLIB REQUIRED)
list(APPEND ZLIB_LIBRARIES m)
else()
# 'z' is used in:
# - Platforms that set CMAKE_USE_SYSTEM_ZLIB to true, like Android.
# - When it is set to true via CLI using --cmakeargs.
# 'zlib' represents our in-tree zlib, and is used in all other platforms
# that don't meet any of the previous special requirements, like most
# regular Unix and Windows builds.
list(APPEND ZLIB_LIBRARIES $<IF:$<BOOL:${CLR_CMAKE_USE_SYSTEM_ZLIB}>,z,zlib>)
endif ()
list(APPEND ${NativeLibsExtra} ${ZLIB_LIBRARIES})
if (CLR_CMAKE_USE_SYSTEM_BROTLI AND NOT CLR_CMAKE_TARGET_ARCH_WASM)
find_library(BROTLIDEC brotlidec REQUIRED)
find_library(BROTLIENC brotlienc REQUIRED)
list(APPEND ${NativeLibsExtra} ${BROTLIDEC} ${BROTLIENC})
endif ()
if (CLR_CMAKE_USE_SYSTEM_ZSTD)
find_library(ZSTD zstd REQUIRED)
list(APPEND ${NativeLibsExtra} ${ZSTD})
endif ()
endmacro()