From a7f05c42145333a71caf68b62c4f78be139f990a Mon Sep 17 00:00:00 2001 From: Neil Cook Date: Fri, 8 Oct 2021 01:42:34 +0100 Subject: [PATCH] Add option to disable brotli if desired by the builder (#1050) --- CMakeLists.txt | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3ae9e781..3df63b05 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,6 +18,7 @@ option(BUILD_ORM "Build orm" ON) option(COZ_PROFILING "Use coz for profiling" OFF) option(BUILD_DROGON_SHARED "Build drogon as a shared lib" OFF) option(BUILD_DOC "Build Doxygen documentation" OFF) +option(BUILD_BROTLI "Build Brotli" ON) include(CMakeDependentOption) CMAKE_DEPENDENT_OPTION(BUILD_POSTGRESQL "Build with postgresql support" ON "BUILD_ORM" OFF) @@ -221,12 +222,14 @@ endif (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD" AND NOT WIN32) -find_package(Brotli) -if (Brotli_FOUND) - message(STATUS "Brotli found") - add_definitions(-DUSE_BROTLI) - target_link_libraries(${PROJECT_NAME} PRIVATE Brotli_lib) -endif (Brotli_FOUND) +if (BUILD_BROTLI) + find_package(Brotli) + if (Brotli_FOUND) + message(STATUS "Brotli found") + add_definitions(-DUSE_BROTLI) + target_link_libraries(${PROJECT_NAME} PRIVATE Brotli_lib) + endif (Brotli_FOUND) +endif (BUILD_BROTLI) set(DROGON_SOURCES lib/src/AOPAdvice.cc