fs:add boost fs support
This commit is contained in:
		
							parent
							
								
									185508ae05
								
							
						
					
					
						commit
						eed787c1bf
					
				| @ -6,6 +6,11 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_SYSTEM_NAME MATCHES "Windows") | |||||||
| message(FATAL_ERROR "Unsupported MinGW Currently.") | message(FATAL_ERROR "Unsupported MinGW Currently.") | ||||||
| endif() | endif() | ||||||
| 
 | 
 | ||||||
|  | if(DEFINED USE_BOOST) | ||||||
|  | message(STATUS "crashelper use boost lib.") | ||||||
|  | include_directories(${MBOOST_INCLUDE_DIR}) | ||||||
|  | endif() | ||||||
|  | 
 | ||||||
| set(CRASHELPER_SOURCES | set(CRASHELPER_SOURCES | ||||||
| src/crashelper.cxx | src/crashelper.cxx | ||||||
| ) | ) | ||||||
| @ -25,4 +30,8 @@ else() | |||||||
| message(FATAL_ERROR "Unsupported OS: ${CMAKE_SYSTEM_NAME}. This project only supports Linux, macOS, and Windows.") | message(FATAL_ERROR "Unsupported OS: ${CMAKE_SYSTEM_NAME}. This project only supports Linux, macOS, and Windows.") | ||||||
| endif() | 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) | target_include_directories(crashelper PUBLIC include) | ||||||
| @ -18,13 +18,6 @@ | |||||||
| 
 | 
 | ||||||
| #include "backward.hpp" | #include "backward.hpp" | ||||||
| #include <string> | #include <string> | ||||||
| #ifdef USE_BOOST |  | ||||||
| #include <boost/filesystem.hpp> |  | ||||||
| namespace fs = boost::filesystem; |  | ||||||
| #else |  | ||||||
| #include <filesystem> |  | ||||||
| namespace fs = std::filesystem; |  | ||||||
| #endif |  | ||||||
| 
 | 
 | ||||||
| namespace backward { | namespace backward { | ||||||
| ///
 | ///
 | ||||||
|  | |||||||
| @ -2,6 +2,14 @@ | |||||||
| #include <fstream> | #include <fstream> | ||||||
| #include <string> | #include <string> | ||||||
| 
 | 
 | ||||||
|  | #ifdef USE_BOOST | ||||||
|  | #include <boost/filesystem.hpp> | ||||||
|  | namespace fs = boost::filesystem; | ||||||
|  | #else | ||||||
|  | #include <filesystem> | ||||||
|  | namespace fs = std::filesystem; | ||||||
|  | #endif | ||||||
|  | 
 | ||||||
| namespace backward { | namespace backward { | ||||||
| 
 | 
 | ||||||
| class crashHelper | class crashHelper | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user