From c4c54aa63e2d1d9d3ce07cda0d8778e495523333 Mon Sep 17 00:00:00 2001 From: orignal Date: Sat, 15 Aug 2026 17:50:53 -0400 Subject: [PATCH] link with boost_json if >= 1.75 --- build/CMakeLists.txt | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/build/CMakeLists.txt b/build/CMakeLists.txt index a8f17b6e..99be98e7 100644 --- a/build/CMakeLists.txt +++ b/build/CMakeLists.txt @@ -275,14 +275,23 @@ else() if(NOT MSVC) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") endif() - add_definitions(-DBOOST_ATOMIC_DYN_LINK -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_PROGRAM_OPTIONS_DYN_LINK) + if(Boost_VERSION VERSION_GREATER_EQUAL "1.75") + add_definitions(-DBOOST_FILESYSTEM_DYN_LINK -DBOOST_PROGRAM_OPTIONS_DYN_LINK -DBOOST_JSON_DYN_LINK) + else() + add_definitions(-DBOOST_FILESYSTEM_DYN_LINK -DBOOST_PROGRAM_OPTIONS_DYN_LINK) + endif() if(WIN32) set(Boost_USE_STATIC_LIBS OFF) set(Boost_USE_STATIC_RUNTIME OFF) endif() endif() -find_package(Boost REQUIRED COMPONENTS filesystem program_options atomic) +if(Boost_VERSION VERSION_GREATER_EQUAL "1.75") + find_package(Boost REQUIRED COMPONENTS filesystem program_options json) +else() + find_package(Boost REQUIRED COMPONENTS filesystem program_options) +endif() + if(NOT DEFINED Boost_FOUND) message(SEND_ERROR "Boost is not found, or your boost version was below 1.46. Please download Boost!") endif()