Use the Conan package manager (#4367)

Introduces a conanfile.py (and a Conan recipe for RocksDB) to enable building the package with Conan, choosing more recent default versions of dependencies. It removes almost all of the CMake build files related to dependencies, and the configurations for Travis CI and GitLab CI. A new set of cross-platform build instructions are written in BUILD.md.

Includes example GitHub Actions workflow for each of Linux, macOS, Windows.

* Test on macos-12

We use the <concepts> library which was not added to Apple Clang until
version 13.1.6. The default Clang on macos-11 (the sometimes current
version of macos-latest) is 13.0.0, and the default Clang on macos-12 is
14.0.0.

Closes #4223.
This commit is contained in:
John Freeman
2022-12-16 12:46:22 -06:00
committed by GitHub
parent df1300fb37
commit c3a9f3dbf3
52 changed files with 1171 additions and 4997 deletions

View File

@@ -0,0 +1,48 @@
cmake_minimum_required(VERSION 3.11)
project(ed25519
LANGUAGES C
)
if(PROJECT_NAME STREQUAL CMAKE_PROJECT_NAME)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/output/$<CONFIG>/lib")
endif()
if(NOT TARGET OpenSSL::SSL)
find_package(OpenSSL)
endif()
add_library(ed25519 STATIC
ed25519.c
)
add_library(ed25519::ed25519 ALIAS ed25519)
target_link_libraries(ed25519 PUBLIC OpenSSL::SSL)
include(GNUInstallDirs)
#[=========================================================[
NOTE for macos:
https://github.com/floodyberry/ed25519-donna/issues/29
our source for ed25519-donna-portable.h has been
patched to workaround this.
#]=========================================================]
target_include_directories(ed25519 PUBLIC
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
)
install(
TARGETS ed25519
EXPORT ${PROJECT_NAME}-exports
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
)
install(
EXPORT ${PROJECT_NAME}-exports
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
FILE ${PROJECT_NAME}-targets.cmake
NAMESPACE ${PROJECT_NAME}::
)
install(
FILES ed25519.h
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
)

View File

@@ -23,7 +23,8 @@
#include <ripple/protocol/digest.h>
#include <ripple/protocol/impl/secp256k1.h>
#include <boost/multiprecision/cpp_int.hpp>
#include <ed25519-donna/ed25519.h>
#include <ed25519.h>
#include <type_traits>
namespace ripple {

View File

@@ -26,7 +26,7 @@
#include <ripple/protocol/digest.h>
#include <ripple/protocol/impl/secp256k1.h>
#include <cstring>
#include <ed25519-donna/ed25519.h>
#include <ed25519.h>
namespace ripple {

View File

@@ -29,7 +29,7 @@
#include <ripple/rpc/handlers/WalletPropose.h>
#include <ripple/rpc/impl/RPCHelpers.h>
#include <cmath>
#include <ed25519-donna/ed25519.h>
#include <ed25519.h>
#include <map>
namespace ripple {

View File

@@ -0,0 +1,52 @@
cmake_minimum_required(VERSION 3.11)
project(secp256k1
LANGUAGES C
)
if(PROJECT_NAME STREQUAL CMAKE_PROJECT_NAME)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/output/$<CONFIG>/lib")
endif()
add_library(secp256k1 STATIC
src/secp256k1.c
)
add_library(secp256k1::secp256k1 ALIAS secp256k1)
include(GNUInstallDirs)
target_compile_definitions(secp256k1 PRIVATE
USE_NUM_NONE
USE_FIELD_10X26
USE_FIELD_INV_BUILTIN
USE_SCALAR_8X32
USE_SCALAR_INV_BUILTIN
)
target_include_directories(secp256k1
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PRIVATE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
)
target_compile_options(secp256k1 PRIVATE
$<$<C_COMPILER_ID:MSVC>:-wd4319>
$<$<NOT:$<C_COMPILER_ID:MSVC>>:
-Wno-deprecated-declarations
-Wno-unused-function
>
$<$<C_COMPILER_ID:GNU>:-Wno-nonnull-compare>
)
install(
TARGETS secp256k1
EXPORT ${PROJECT_NAME}-exports
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
)
install(
EXPORT ${PROJECT_NAME}-exports
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
FILE ${PROJECT_NAME}-targets.cmake
NAMESPACE ${PROJECT_NAME}::
)
install(
FILES include/secp256k1.h
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
)

View File

@@ -226,13 +226,15 @@ public:
// SOCI requires boost::optional (not std::optional) as
// parameters.
boost::optional<std::int32_t> ig;
boost::optional<std::uint32_t> uig;
// Known bug: https://github.com/SOCI/soci/issues/926
// boost::optional<std::uint32_t> uig;
uint32_t uig = 0;
boost::optional<std::int64_t> big;
boost::optional<std::uint64_t> ubig;
s << "SELECT I, UI, BI, UBI from STT;", soci::into(ig),
soci::into(uig), soci::into(big), soci::into(ubig);
BEAST_EXPECT(
*ig == id[0] && *uig == uid[0] && *big == bid[0] &&
*ig == id[0] && uig == uid[0] && *big == bid[0] &&
*ubig == ubid[0]);
}
catch (std::exception&)
@@ -357,18 +359,13 @@ public:
bfs::remove(dbPath);
}
void
testSQLite()
run() override
{
testSQLiteFileNames();
testSQLiteSession();
testSQLiteSelect();
testSQLiteDeleteWithSubselect();
}
void
run() override
{
testSQLite();
}
};
BEAST_DEFINE_TESTSUITE(SociDB, core, ripple);