cmake: when USE_STATIC_LIBRARIES prefer bundled brotli

even if UNBUNDLED=ON because libbrotli*.a and similar are not
available in most of the systems

Signed-off-by: Konstantin Podshumok <kpp.live+signed@gmail.com>
This commit is contained in:
Konstantin Podshumok 2020-08-22 01:25:38 +03:00
parent e296997b6c
commit 8ce844a40d
No known key found for this signature in database
GPG Key ID: 7EA5D4784D5BB847

View File

@ -7,7 +7,12 @@ if (NOT ENABLE_BROTLI)
return()
endif()
option (USE_INTERNAL_BROTLI_LIBRARY "Set to FALSE to use system libbrotli library instead of bundled" ${NOT_UNBUNDLED})
if (UNBUNDLED)
# Many system ship only dynamic brotly libraries, so we back off to bundled by default
option (USE_INTERNAL_BROTLI_LIBRARY "Set to FALSE to use system libbrotli library instead of bundled" ${USE_STATIC_LIBRARIES})
else()
option (USE_INTERNAL_BROTLI_LIBRARY "Set to FALSE to use system libbrotli library instead of bundled" ON)
endif()
if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/brotli/c/include/brotli/decode.h")
if (USE_INTERNAL_BROTLI_LIBRARY)