mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 11:05:54 +00:00
chore: Fix compilation error with clang-20 and cleanup (#5543)
Removes clutter for old compilers, defaults to non-unity builds in cmake to match conanfile.py, and workaround for clang-20 compilation errors.
This commit is contained in:
@@ -18,7 +18,7 @@ if(tests)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
option(unity "Creates a build using UNITY support in cmake. This is the default" ON)
|
||||
option(unity "Creates a build using UNITY support in cmake." OFF)
|
||||
if(unity)
|
||||
if(NOT is_ci)
|
||||
set(CMAKE_UNITY_BUILD_BATCH_SIZE 15 CACHE STRING "")
|
||||
|
||||
@@ -22,8 +22,18 @@
|
||||
|
||||
#include <xrpl/basics/contract.h>
|
||||
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated"
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
|
||||
#include <boost/outcome.hpp>
|
||||
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
|
||||
#include <stdexcept>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
@@ -24,13 +24,38 @@
|
||||
#include <boost/container/flat_set.hpp>
|
||||
#include <boost/endian/conversion.hpp>
|
||||
|
||||
/*
|
||||
|
||||
Workaround for overzealous clang warning, which trips on libstdc++ headers
|
||||
|
||||
In file included from
|
||||
/usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_algo.h:61:
|
||||
/usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_tempbuf.h:263:8:
|
||||
error: 'get_temporary_buffer<std::pair<ripple::Quality, const
|
||||
std::vector<std::unique_ptr<ripple::Step>> *>>' is deprecated
|
||||
[-Werror,-Wdeprecated-declarations] 263 |
|
||||
std::get_temporary_buffer<value_type>(_M_original_len));
|
||||
^
|
||||
*/
|
||||
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated"
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
|
||||
#include <array>
|
||||
#include <chrono>
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <functional>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <system_error>
|
||||
|
||||
@@ -98,8 +98,7 @@ struct Buffer_test : beast::unit_test::suite
|
||||
x = b0;
|
||||
BEAST_EXPECT(x == b0);
|
||||
BEAST_EXPECT(sane(x));
|
||||
#if defined(__clang__) && (!defined(__APPLE__) && (__clang_major__ >= 7)) || \
|
||||
(defined(__APPLE__) && (__apple_build_version__ >= 10010043))
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wself-assign-overloaded"
|
||||
#endif
|
||||
@@ -111,8 +110,7 @@ struct Buffer_test : beast::unit_test::suite
|
||||
BEAST_EXPECT(y == b3);
|
||||
BEAST_EXPECT(sane(y));
|
||||
|
||||
#if defined(__clang__) && (!defined(__APPLE__) && (__clang_major__ >= 7)) || \
|
||||
(defined(__APPLE__) && (__apple_build_version__ >= 10010043))
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user