From 10af948d7ff29bc8601e83127a9d9ab1c441fc58 Mon Sep 17 00:00:00 2001 From: Michael Cho Date: Mon, 11 Aug 2025 23:13:27 -0400 Subject: [PATCH] Fix build with Boost 1.89.0 Signed-off-by: Michael Cho --- CMakeLists.txt | 10 +++++++--- cmake/proxygen-config.cmake.in | 11 +---------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a479ada8d0..c17b3971e7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -80,17 +80,21 @@ find_package(ZLIB REQUIRED) find_package(OpenSSL REQUIRED) find_package(Threads) find_package(Cares) -find_package(Boost 1.58 REQUIRED - COMPONENTS +set(PROXYGEN_BOOST_COMPONENTS iostreams context filesystem program_options regex - system thread chrono ) +find_package(Boost 1.58 REQUIRED COMPONENTS ${PROXYGEN_BOOST_COMPONENTS}) +if (Boost_MAJOR_VERSION EQUAL 1 AND Boost_MINOR_VERSION LESS 69) + list(APPEND PROXYGEN_BOOST_COMPONENTS system) + find_package(Boost 1.58 REQUIRED COMPONENTS ${PROXYGEN_BOOST_COMPONENTS}) +endif() +string(REPLACE ";" " " PROXYGEN_BOOST_COMPONENTS "${PROXYGEN_BOOST_COMPONENTS}") list(APPEND _PROXYGEN_COMMON_COMPILE_OPTIONS diff --git a/cmake/proxygen-config.cmake.in b/cmake/proxygen-config.cmake.in index 6849b0a668..aa90e5d7e0 100644 --- a/cmake/proxygen-config.cmake.in +++ b/cmake/proxygen-config.cmake.in @@ -31,16 +31,7 @@ find_dependency(Fizz) find_dependency(ZLIB) find_dependency(OpenSSL) find_dependency(Threads) -find_dependency(Boost 1.58 REQUIRED - COMPONENTS - iostreams - context - filesystem - program_options - regex - system - thread -) +find_dependency(Boost 1.58 REQUIRED COMPONENTS @PROXYGEN_BOOST_COMPONENTS@) if(NOT TARGET proxygen::proxygen) include("${CMAKE_CURRENT_LIST_DIR}/proxygen-targets.cmake")