From 821af78a04d4ce3d993421613b130a3fda41471a Mon Sep 17 00:00:00 2001 From: kelbon <58717435+kelbon@users.noreply.github.com> Date: Tue, 14 Jan 2025 13:29:01 +0400 Subject: [PATCH] option to not download boost (#2) --- CMakeLists.txt | 5 +++++ tests/test_hpack.cpp | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9236ad2..a9cd1ad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,9 +4,12 @@ project(HPACK LANGUAGES CXX) ### options ### option(HPACK_ENABLE_TESTING "enables testing" OFF) +option(HPACK_USE_CPM "turn off to not download boost" ON) ### dependecies ### +if(HPACK_USE_CPM) + include(cmake/get_cpm.cmake) set(BOOST_INCLUDE_LIBRARIES intrusive) @@ -19,6 +22,8 @@ CPMAddPackage( unset(BOOST_INCLUDE_LIBRARIES) find_package(Boost 1.84 COMPONENTS intrusive REQUIRED) +endif() + ### hpacklib ### add_library(hpacklib STATIC diff --git a/tests/test_hpack.cpp b/tests/test_hpack.cpp index 2c7be80..2c2ba81 100644 --- a/tests/test_hpack.cpp +++ b/tests/test_hpack.cpp @@ -334,8 +334,10 @@ TEST(huffman_rand) { } TEST(huffman_table_itself) { -#define HUFFMAN_TABLE(index, bits, bitcount) \ - { error_if(hpack::huffman_decode_table_find(hpack::sym_info_t{0b##bits, bitcount}) != uint16_t(index)); } +#define HUFFMAN_TABLE(index, bits, bitcount) \ + { \ + error_if(hpack::huffman_decode_table_find(hpack::sym_info_t{0b##bits, bitcount}) != uint16_t(index)); \ + } #include "hpack/huffman_table.def" }