From 64d4255ca3d62d2c78a95aea28b6b15ef57b0c5a Mon Sep 17 00:00:00 2001 From: taynpg Date: Tue, 29 Apr 2025 11:40:13 +0800 Subject: [PATCH] =?UTF-8?q?compile=EF=BC=9Atss-http=20win8=E5=8F=8A?= =?UTF-8?q?=E4=BB=A5=E4=B8=8B=E4=B8=8D=E6=94=AF=E6=8C=81=E4=B8=94=E4=B8=8D?= =?UTF-8?q?=E6=94=AF=E6=8C=81mingw=EF=BC=8C=E5=AF=B9=E4=BA=8E=E6=AD=A4?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E4=B8=8D=E7=94=9F=E6=88=90=E7=9B=AE=E6=A0=87?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 10 ++++++++++ README.md | 2 ++ http-server/CMakeLists.txt | 7 +------ http-server/main.cpp | 7 +------ 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6767baa..7dda034 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -63,7 +63,12 @@ add_subdirectory(server) add_subdirectory(client) add_subdirectory(filecomplete) add_subdirectory(tinyaes) + +if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_SYSTEM_NAME MATCHES "Windows") +message(STATUS "tss-http can't support mingw, will not compile.") +else() add_subdirectory(http-server) +endif() if (DEFINED USE_TRANSM_TEST) message(STATUS "USE USE_TRANSM_TEST ${USE_TRANSM_TEST}") @@ -92,7 +97,12 @@ message(STATUS "VERSION_GIT_HASH: ${VERSION_GIT_HASH}") install(TARGETS tsc DESTINATION bin) install(TARGETS tss DESTINATION bin) + +if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_SYSTEM_NAME MATCHES "Windows") +message(STATUS "tss-http can't support mingw, will not pack.") +else() install(TARGETS tss-http DESTINATION bin) +endif() if (DEFINED USE_BOOST) install(FILES ${MINGW32_DLLS} DESTINATION bin) diff --git a/README.md b/README.md index e7f1aaa..3327174 100644 --- a/README.md +++ b/README.md @@ -98,6 +98,8 @@ Data verification: PASSED - `v1.5.2`及其以后的代码版本:新增了`tss-http`服务端,简单用于某些时候,客户机上没有`tsc`和`tss`程序时,通过`http`协议传输文件。 + > 关于`tss-http`编译:不支持`mingw`编译,因此`win8`及以下没有此程序支持。 + > 示例启动:`tss-http 8080 D:/files`(参数为端口、根目录)。 # 三、编译 diff --git a/http-server/CMakeLists.txt b/http-server/CMakeLists.txt index b1b9629..5259ff1 100644 --- a/http-server/CMakeLists.txt +++ b/http-server/CMakeLists.txt @@ -8,9 +8,4 @@ if (MSVC) add_compile_options(/source-charset:utf-8) endif() -add_executable(tss-http main.cpp) - -if(DEFINED USE_BOOST) -target_link_directories(tss-http PRIVATE ${MBOOST_LIB_DIR}) -target_link_libraries(tss-http PRIVATE ${MBOOST_LIBS}) -endif() \ No newline at end of file +add_executable(tss-http main.cpp) \ No newline at end of file diff --git a/http-server/main.cpp b/http-server/main.cpp index c5984d9..e439b6c 100644 --- a/http-server/main.cpp +++ b/http-server/main.cpp @@ -1,3 +1,4 @@ +#include #include #include #include @@ -8,13 +9,7 @@ #include #endif -#ifdef USE_BOOST -#include -namespace fs = boost::filesystem; -#else -#include namespace fs = std::filesystem; -#endif #ifdef _WIN32 std::string u8_to_ansi(const std::string& str)