mirror of
https://github.com/Xahau/xahaud.git
synced 2025-11-18 17:45:48 +00:00
Add Conan Building For Development (#432)
This commit is contained in:
48
src/ed25519-donna/CMakeLists.txt
Normal file
48
src/ed25519-donna/CMakeLists.txt
Normal 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}"
|
||||
)
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <ripple/protocol/BuildInfo.h>
|
||||
#include <boost/preprocessor/stringize.hpp>
|
||||
#include <algorithm>
|
||||
#include <optional>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
52
src/secp256k1/CMakeLists.txt
Normal file
52
src/secp256k1/CMakeLists.txt
Normal 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}"
|
||||
)
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user