fs:add boost fs support

This commit is contained in:
taynpg 2025-04-16 22:18:58 +08:00
parent 185508ae05
commit eed787c1bf
3 changed files with 17 additions and 7 deletions

View File

@ -6,6 +6,11 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_SYSTEM_NAME MATCHES "Windows")
message(FATAL_ERROR "Unsupported MinGW Currently.")
endif()
if(DEFINED USE_BOOST)
message(STATUS "crashelper use boost lib.")
include_directories(${MBOOST_INCLUDE_DIR})
endif()
set(CRASHELPER_SOURCES
src/crashelper.cxx
)
@ -25,4 +30,8 @@ else()
message(FATAL_ERROR "Unsupported OS: ${CMAKE_SYSTEM_NAME}. This project only supports Linux, macOS, and Windows.")
endif()
if(DEFINED USE_BOOST)
target_link_directories(crashelper PRIVATE ${MBOOST_LIB_DIR})
target_link_libraries(crashelper PRIVATE ${MBOOST_LIBS})
endif()
target_include_directories(crashelper PUBLIC include)

View File

@ -18,13 +18,6 @@
#include "backward.hpp"
#include <string>
#ifdef USE_BOOST
#include <boost/filesystem.hpp>
namespace fs = boost::filesystem;
#else
#include <filesystem>
namespace fs = std::filesystem;
#endif
namespace backward {
///

View File

@ -2,6 +2,14 @@
#include <fstream>
#include <string>
#ifdef USE_BOOST
#include <boost/filesystem.hpp>
namespace fs = boost::filesystem;
#else
#include <filesystem>
namespace fs = std::filesystem;
#endif
namespace backward {
class crashHelper