From 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 20:24:20 +0200 Subject: Adding upstream version 14.2.21. Signed-off-by: Daniel Baumann --- src/compressor/brotli/CMakeLists.txt | 39 ++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/compressor/brotli/CMakeLists.txt (limited to 'src/compressor/brotli/CMakeLists.txt') diff --git a/src/compressor/brotli/CMakeLists.txt b/src/compressor/brotli/CMakeLists.txt new file mode 100644 index 00000000..f1992428 --- /dev/null +++ b/src/compressor/brotli/CMakeLists.txt @@ -0,0 +1,39 @@ +# brotli + +set(brotli_sources + CompressionPluginBrotli.cc + BrotliCompressor.cc +) +include(ExternalProject) +ExternalProject_Add(brotli_ext + DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/src/ + GIT_REPOSITORY "https://github.com/google/brotli.git" + GIT_TAG "v1.0.7" + SOURCE_DIR ${CMAKE_BINARY_DIR}/src/brotli + CONFIGURE_COMMAND ./configure-cmake --disable-debug + INSTALL_COMMAND "" + BUILD_COMMAND $(MAKE) + BUILD_IN_SOURCE 1 + INSTALL_COMMAND "") + +ExternalProject_Add_Step(brotli_ext forcebuild + DEPENDEES configure + DEPENDERS build + COMMAND "true" + ALWAYS 1) + +set(bortli_libs enc dec common) +file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/src/brotli/c/include") +foreach(lib ${bortli_libs}) + add_library(brotli::${lib} STATIC IMPORTED) + add_dependencies(brotli::${lib} brotli_ext) + set_target_properties(brotli::${lib} PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_BINARY_DIR}/src/brotli/c/include" + IMPORTED_LOCATION "${CMAKE_BINARY_DIR}/src/brotli/libbrotli${lib}-static.a") + list(APPEND BROTLI_LIBRARIES brotli::${lib}) +endforeach() + +add_library(ceph_brotli SHARED ${brotli_sources}) +list(REVERSE bortli_libs) +target_link_libraries(ceph_brotli PRIVATE ${BROTLI_LIBRARIES}) +install(TARGETS ceph_brotli DESTINATION ${compressor_plugin_dir}) -- cgit v1.2.3