diff --git a/crashelper/CMakeLists.txt b/crashelper/CMakeLists.txt index 2ca4783..a9d3456 100644 --- a/crashelper/CMakeLists.txt +++ b/crashelper/CMakeLists.txt @@ -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) \ No newline at end of file diff --git a/crashelper/include/crashelper.h b/crashelper/include/crashelper.h index 3f22b9d..9720dc2 100644 --- a/crashelper/include/crashelper.h +++ b/crashelper/include/crashelper.h @@ -18,13 +18,6 @@ #include "backward.hpp" #include -#ifdef USE_BOOST -#include -namespace fs = boost::filesystem; -#else -#include -namespace fs = std::filesystem; -#endif namespace backward { /// diff --git a/crashelper/src/crashelper.cxx b/crashelper/src/crashelper.cxx index c227d00..918f0b1 100644 --- a/crashelper/src/crashelper.cxx +++ b/crashelper/src/crashelper.cxx @@ -2,6 +2,14 @@ #include #include +#ifdef USE_BOOST +#include +namespace fs = boost::filesystem; +#else +#include +namespace fs = std::filesystem; +#endif + namespace backward { class crashHelper