From 8e868b3abb3d3561d1f80e8bd75e14823711ed3e Mon Sep 17 00:00:00 2001 From: orignal Date: Sun, 16 Aug 2026 07:44:25 -0400 Subject: [PATCH] fixed cmake build --- build/CMakeLists.txt | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/build/CMakeLists.txt b/build/CMakeLists.txt index f6cbb741..4d3a135b 100644 --- a/build/CMakeLists.txt +++ b/build/CMakeLists.txt @@ -275,27 +275,23 @@ else() if(NOT MSVC) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") endif() - if(Boost_VERSION VERSION_GREATER_EQUAL "1.75") - add_definitions(-DBOOST_ATOMIC_DYN_LINK -DBOOST_PROGRAM_OPTIONS_DYN_LINK -DBOOST_JSON_DYN_LINK) - else() - add_definitions(-DBOOST_ATOMIC_DYN_LINK -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_PROGRAM_OPTIONS_DYN_LINK) - endif() + add_definitions(-DBOOST_ATOMIC_DYN_LINK -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_PROGRAM_OPTIONS_DYN_LINK) if(WIN32) set(Boost_USE_STATIC_LIBS OFF) set(Boost_USE_STATIC_RUNTIME OFF) endif() endif() -if(Boost_VERSION VERSION_GREATER_EQUAL "1.75") - find_package(Boost REQUIRED COMPONENTS atomic filesystem program_options json) -else() - find_package(Boost REQUIRED COMPONENTS atomic filesystem program_options) -endif() +find_package(Boost REQUIRED COMPONENTS atomic filesystem program_options OPTIONAL_COMPONENTS json) if(NOT DEFINED Boost_FOUND) message(SEND_ERROR "Boost is not found, or your boost version was below 1.46. Please download Boost!") endif() +if(Boost_json_FOUND AND NOT WITH_STATIC) + add_definitions(-DBOOST_JSON_DYN_LINK) +endif() + find_package(OpenSSL REQUIRED) if(NOT DEFINED OPENSSL_FOUND) message(SEND_ERROR "Could not find OpenSSL. Please download and install it first!")