1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-07-05 12:29:05 +02:00

Remove Boost Filesystem stuff

This commit is contained in:
tsjost 2021-10-12 15:40:34 +02:00
parent e34884598f
commit a5b83e2e09
4 changed files with 2 additions and 38 deletions

View File

@ -29,9 +29,6 @@ if(USE_CONAN)
else()
find_package(Boost REQUIRED)
find_package(Boost COMPONENTS program_options system REQUIRED)
if(FILESYSTEM_LIBRARY STREQUAL "BOOST")
find_package(Boost COMPONENTS filesystem system REQUIRED)
endif()
if(BUILD_TESTS)
find_package(Boost COMPONENTS unit_test_framework REQUIRED)
endif()

View File

@ -126,11 +126,6 @@ elseif(FILESYSTEM_LIBRARY STREQUAL "CXXTS")
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
target_link_libraries(rw_interface INTERFACE "stdc++fs")
endif()
elseif(FILESYSTEM_LIBRARY STREQUAL "BOOST")
target_compile_definitions(rw_interface INTERFACE "RW_FS_LIBRARY=2")
target_link_libraries(rw_interface INTERFACE
Boost::filesystem
)
else()
message(FATAL_ERROR "Illegal FILESYSTEM_LIBRARY option. (was '${FILESYSTEM_LIBRARY}')")
endif()

View File

@ -12,8 +12,8 @@ option(TEST_DATA "Enable tests that require game data")
set(FAILED_CHECK_ACTION "IGNORE" CACHE STRING "What action to perform on a failed RW_CHECK (in debug mode)")
set_property(CACHE FAILED_CHECK_ACTION PROPERTY STRINGS "IGNORE" "ABORT" "BREAKPOINT")
set(FILESYSTEM_LIBRARY "BOOST" CACHE STRING "Which filesystem library to use")
set_property(CACHE FILESYSTEM_LIBRARY PROPERTY STRINGS "CXX17" "CXXTS" "BOOST")
set(FILESYSTEM_LIBRARY "CXX17" CACHE STRING "Which filesystem library to use")
set_property(CACHE FILESYSTEM_LIBRARY PROPERTY STRINGS "CXX17" "CXXTS")
set(CMAKE_CONFIGURATION_TYPES "Release;Debug;RelWithDebInfo;MinSizeRel" CACHE INTERNAL "Build types supported by this project.")
if(NOT CMAKE_BUILD_TYPE)

View File

@ -3,7 +3,6 @@
#define RW_FS_CXX17 0
#define RW_FS_CXXTS 1
#define RW_FS_BOOST 2
#if RW_FS_LIBRARY == RW_FS_CXX17
#include <filesystem>
@ -19,33 +18,6 @@ namespace rwfs {
using namespace std::experimental::filesystem;
using error_code = std::error_code;
}
#elif RW_FS_LIBRARY == RW_FS_BOOST
#include <boost/filesystem.hpp>
#include <boost/functional/hash.hpp>
#include <boost/system/error_code.hpp>
namespace rwfs {
using namespace boost::filesystem;
using error_code = boost::system::error_code;
}
#include <boost/version.hpp>
#if BOOST_VERSION < 105600
namespace boost {
namespace filesystem {
inline const directory_iterator& begin(const directory_iterator& iter) {
return iter;
}
inline directory_iterator end(const directory_iterator&) {
return {};
}
inline const recursive_directory_iterator& begin(const recursive_directory_iterator& iter) {
return iter;
}
inline recursive_directory_iterator end(const recursive_directory_iterator&) {
return {};
}
}
}
#endif
#else
#error Invalid RW_FS_LIBRARY value
#endif