op-packages/trojan/patches/002-Fix-boost1.89-build.patch
github-actions[bot] 50bf1ec00a 🗽 Sync 2026-06-03 14:05:40
2026-06-03 14:05:40 +08:00

17 lines
630 B
Diff

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -36,7 +36,12 @@ set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
target_link_libraries(trojan ${CMAKE_THREAD_LIBS_INIT})
-find_package(Boost 1.66.0 REQUIRED COMPONENTS system program_options)
+find_package(Boost 1.66.0 REQUIRED)
+if (Boost_MAJOR_VERSION LESS_EQUAL 1 AND Boost_MINOR_VERSION LESS 89)
+ find_package(Boost 1.66.0 REQUIRED COMPONENTS system program_options)
+else()
+ find_package(Boost 1.66.0 REQUIRED COMPONENTS program_options)
+endif()
include_directories(${Boost_INCLUDE_DIR})
target_link_libraries(trojan ${Boost_LIBRARIES})
if(MSVC)