换用库。
This commit is contained in:
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
@@ -31,7 +31,7 @@
|
||||
"-Wno-dev"
|
||||
],
|
||||
"cmake.configureSettings": {
|
||||
"CMAKE_PREFIX_PATH": "C:/local/boost_1_90_0"
|
||||
"CMAKE_PREFIX_PATH": "C:/local"
|
||||
},
|
||||
// "cmake.environment": {
|
||||
// "PATH": "${env:PATH};C:/Qt/Qt5.14.2/5.14.2/msvc2017_64/bin;D:/env/ctf-win-bin/ctf/bin/Debug;R:/ctf/bin/Debug;",
|
||||
|
||||
@@ -16,13 +16,8 @@ set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib/${CMAKE_BUILD_TYPE})
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin/${CMAKE_BUILD_TYPE}/)
|
||||
|
||||
add_definitions(-DFMT_HEADER_ONLY)
|
||||
|
||||
set(Boost_NO_WARN_NEW_VERSIONS 1)
|
||||
set(Boost_USE_STATIC_LIBS ON)
|
||||
include_directories(${Boost_INCLUDE_DIR})
|
||||
|
||||
find_package(Boost COMPONENTS filesystem locale process)
|
||||
find_package(cxxLibrary CONFIG REQUIRED)
|
||||
|
||||
include_directories(thirdparty)
|
||||
add_executable(cmake-vsenv main.cpp read_config.h read_config.cpp exec_cmd.h exec_cmd.cpp)
|
||||
target_link_libraries(cmake-vsenv PRIVATE ${Boost_LIBRARIES} ntdll)
|
||||
target_link_libraries(cmake-vsenv PRIVATE cxxLibrary::cxxLibrary ntdll)
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
#include <boost/asio/streambuf.hpp>
|
||||
#include <boost/core/ignore_unused.hpp>
|
||||
#include <boost/filesystem.hpp>
|
||||
#include <boost/locale.hpp>
|
||||
#include <boost/process.hpp>
|
||||
#include <boost/process/start_dir.hpp>
|
||||
#include <boost/system/error_code.hpp>
|
||||
#include <fmt/format.h>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <zoost/zoost.h>
|
||||
|
||||
namespace proc = boost::process;
|
||||
namespace asio = boost::asio;
|
||||
@@ -51,7 +51,7 @@ int ExecCMD::ExecuteCmd(const std::string& exe, std::vector<std::string>& args,
|
||||
break;
|
||||
} else {
|
||||
#if defined(_WIN32)
|
||||
std::cerr << boost::locale::conv::between(ec.message(), "UTF-8", "GBK") << std::endl;
|
||||
std::cerr << zoostCommon::ToU8Copy(ec.message()) << std::endl;
|
||||
#else
|
||||
std::cerr << ec.message() << std::endl;
|
||||
#endif
|
||||
@@ -64,7 +64,7 @@ int ExecCMD::ExecuteCmd(const std::string& exe, std::vector<std::string>& args,
|
||||
|
||||
} catch (const std::exception& e) {
|
||||
#if defined(_WIN32)
|
||||
std::cerr << "异常: " << boost::locale::conv::between(e.what(), "UTF-8", "GBK") << std::endl;
|
||||
std::cerr << "异常: " << zoostCommon::ToU8Copy(e.what()) << std::endl;
|
||||
#else
|
||||
std::cerr << e.what() << std::endl;
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user