change to boost::filesystem to support older compilers

This commit is contained in:
Richard Holland
2023-08-01 07:48:11 +00:00
parent 35a0e18973
commit 264f25c2a6
2 changed files with 17 additions and 3 deletions

View File

@@ -13,6 +13,18 @@ if (unity)
set_target_properties(xrpl_core PROPERTIES UNITY_BUILD ON)
endif ()
# Find the ACL library
find_library(ACL_LIBRARY
NAMES acl
)
# Check that the ACL library was found
if(ACL_LIBRARY)
message("ACL library found at ${ACL_LIBRARY}")
else()
message(FATAL_ERROR "ACL library not found")
endif()
#[===============================[
beast/legacy FILES:
@@ -1014,6 +1026,7 @@ target_link_libraries (rippled
Ripple::opts
Ripple::libs
Ripple::xrpl_core
${ACL_LIBRARY}
)
exclude_if_included (rippled)
# define a macro for tests that might need to

View File

@@ -27,6 +27,7 @@
#include <ripple/protocol/Import.h>
#include <ripple/protocol/jss.h>
#include <test/jtx.h>
#include <boost/filesystem.hpp>
#define BEAST_REQUIRE(x) \
{ \
@@ -121,8 +122,8 @@ class Import_test : public beast::unit_test::suite
try
{
// check if file exists and is not empty
if (!std::filesystem::exists(fn) ||
std::filesystem::file_size(fn) == 0)
if (!boost::filesystem::exists(fn) ||
boost::filesystem::file_size(fn) == 0)
{
std::cout << "file was zero size or didn't exist"
<< "\n";
@@ -146,7 +147,7 @@ class Import_test : public beast::unit_test::suite
return {};
}
}
catch (std::filesystem::filesystem_error& e)
catch (boost::filesystem::filesystem_error& e)
{
std::cout << "Failed to load file " + fn + " (" + e.what() + ")";
return {};