소스 검색

trojan: update `boost1.89` build patch.

zxl hhyccc 1 개월 전
부모
커밋
334f00f149
1개의 변경된 파일3개의 추가작업 그리고 87개의 파일을 삭제
  1. 3 87
      trojan/patches/002-Fix-boost1.89-build.patch

+ 3 - 87
trojan/patches/002-Fix-boost1.89-build.patch

@@ -1,101 +1,17 @@
 --- a/CMakeLists.txt
 +++ b/CMakeLists.txt
-@@ -36,7 +36,13 @@ set(THREADS_PREFER_PTHREAD_FLAG ON)
+@@ -21,7 +21,13 @@ 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_VERSION LESS 108900)
++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_include_directories(trojan PRIVATE ${Boost_INCLUDE_DIR})
  target_link_libraries(trojan ${Boost_LIBRARIES})
  if(MSVC)
---- a/src/core/service.cpp
-+++ b/src/core/service.cpp
-@@ -36,6 +36,9 @@
- #include "session/natsession.h"
- #include "ssl/ssldefaults.h"
- #include "ssl/sslsession.h"
-+#if BOOST_VERSION >= 108900
-+#include <boost/system.hpp>
-+#endif
- using namespace std;
- using namespace boost::asio::ip;
- using namespace boost::asio::ssl;
---- a/src/main.cpp
-+++ b/src/main.cpp
-@@ -28,6 +28,9 @@
- #endif // ENABLE_MYSQL
- #include "core/service.h"
- #include "core/version.h"
-+#if BOOST_VERSION >= 108900
-+#include <boost/system.hpp>
-+#endif
- using namespace std;
- using namespace boost::asio;
- namespace po = boost::program_options;
---- a/src/session/clientsession.cpp
-+++ b/src/session/clientsession.cpp
-@@ -21,6 +21,9 @@
- #include "proto/trojanrequest.h"
- #include "proto/udppacket.h"
- #include "ssl/sslsession.h"
-+#if BOOST_VERSION >= 108900
-+#include <boost/system.hpp>
-+#endif
- using namespace std;
- using namespace boost::asio::ip;
- using namespace boost::asio::ssl;
---- a/src/session/forwardsession.cpp
-+++ b/src/session/forwardsession.cpp
-@@ -20,6 +20,9 @@
- #include "forwardsession.h"
- #include "proto/trojanrequest.h"
- #include "ssl/sslsession.h"
-+#if BOOST_VERSION >= 108900
-+#include <boost/system.hpp>
-+#endif
- using namespace std;
- using namespace boost::asio::ip;
- using namespace boost::asio::ssl;
---- a/src/session/natsession.cpp
-+++ b/src/session/natsession.cpp
-@@ -20,6 +20,9 @@
- #include "natsession.h"
- #include "proto/trojanrequest.h"
- #include "ssl/sslsession.h"
-+#if BOOST_VERSION >= 108900
-+#include <boost/system.hpp>
-+#endif
- using namespace std;
- using namespace boost::asio::ip;
- using namespace boost::asio::ssl;
---- a/src/session/serversession.cpp
-+++ b/src/session/serversession.cpp
-@@ -20,6 +20,9 @@
- #include "serversession.h"
- #include "proto/trojanrequest.h"
- #include "proto/udppacket.h"
-+#if BOOST_VERSION >= 108900
-+#include <boost/system.hpp>
-+#endif
- using namespace std;
- using namespace boost::asio::ip;
- using namespace boost::asio::ssl;
---- a/src/session/udpforwardsession.cpp
-+++ b/src/session/udpforwardsession.cpp
-@@ -23,6 +23,9 @@
- #include "ssl/sslsession.h"
- #include "proto/trojanrequest.h"
- #include "proto/udppacket.h"
-+#if BOOST_VERSION >= 108900
-+#include <boost/system.hpp>
-+#endif
- using namespace std;
- using namespace boost::asio::ip;
- using namespace boost::asio::ssl;