mirror of
https://codeberg.org/nahuhh/wownero
synced 2026-03-05 06:07:35 -05:00
Compare commits
10 Commits
v0.11.1.0
...
cmake-rewr
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c2d1ac9f25 | ||
|
|
e3d8ab8281 | ||
|
|
66c2b5d8ad | ||
|
|
b2c9c6b2ae | ||
|
|
dd1c07a58b | ||
|
|
b1d3a27af9 | ||
|
|
276fd65f2a | ||
|
|
1e38c3c508 | ||
|
|
1cb536ff45 | ||
|
|
7737171b6c |
15
.gitmodules
vendored
15
.gitmodules
vendored
@@ -1,19 +1,12 @@
|
||||
[submodule "external/miniupnp"]
|
||||
path = external/miniupnp
|
||||
url = https://github.com/miniupnp/miniupnp
|
||||
[submodule "external/rapidjson"]
|
||||
path = external/rapidjson
|
||||
url = https://github.com/Tencent/rapidjson
|
||||
[submodule "external/trezor-common"]
|
||||
active = false
|
||||
path = external/trezor-common
|
||||
url = https://github.com/trezor/trezor-common.git
|
||||
[submodule "external/supercop"]
|
||||
path = external/supercop
|
||||
url = https://github.com/monero-project/supercop
|
||||
branch = monero
|
||||
url = https://git.wownero.com/dsc/supercop.git
|
||||
branch = cmake-rewrite
|
||||
[submodule "external/randomwow"]
|
||||
path = external/randomwow
|
||||
url = https://git.wownero.com/wownero/RandomWOW
|
||||
branch = 1.1.10-wow
|
||||
|
||||
url = https://git.wownero.com/dsc/randomwow.git
|
||||
branch = cmake-rewrite
|
||||
|
||||
1276
CMakeLists.txt
1276
CMakeLists.txt
File diff suppressed because it is too large
Load Diff
@@ -1,14 +0,0 @@
|
||||
#ifdef __CLASSIC_C__
|
||||
int main()
|
||||
{
|
||||
int ac;
|
||||
char* av[];
|
||||
#else
|
||||
int main(int ac, char* av[])
|
||||
{
|
||||
#endif
|
||||
if (ac > 1000) {
|
||||
return *av[0];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
include(CheckCCompilerFlag)
|
||||
|
||||
macro(CHECK_LINKER_FLAG flag VARIABLE)
|
||||
if(NOT DEFINED "${VARIABLE}")
|
||||
if(NOT CMAKE_REQUIRED_QUIET)
|
||||
message(STATUS "Looking for ${flag} linker flag")
|
||||
endif()
|
||||
|
||||
set(_cle_source ${CMAKE_SOURCE_DIR}/cmake/CheckLinkerFlag.c)
|
||||
|
||||
set(saved_CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
|
||||
set(CMAKE_C_FLAGS "${flag}")
|
||||
try_compile(${VARIABLE}
|
||||
${CMAKE_BINARY_DIR}
|
||||
${_cle_source}
|
||||
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} ${flag}
|
||||
CMAKE_FLAGS
|
||||
"-DCMAKE_EXE_LINKER_FLAGS=${flag}"
|
||||
OUTPUT_VARIABLE OUTPUT)
|
||||
unset(_cle_source)
|
||||
set(CMAKE_C_FLAGS ${saved_CMAKE_C_FLAGS})
|
||||
unset(saved_CMAKE_C_FLAGS)
|
||||
|
||||
if ("${OUTPUT}" MATCHES "warning.*ignored")
|
||||
set(${VARIABLE} 0)
|
||||
endif()
|
||||
|
||||
if(${VARIABLE})
|
||||
if(NOT CMAKE_REQUIRED_QUIET)
|
||||
message(STATUS "Looking for ${flag} linker flag - found")
|
||||
endif()
|
||||
set(${VARIABLE} 1 CACHE INTERNAL "Have linker flag ${flag}")
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||
"Determining if the ${flag} linker flag is supported "
|
||||
"passed with the following output:\n"
|
||||
"${OUTPUT}\n\n")
|
||||
else()
|
||||
if(NOT CMAKE_REQUIRED_QUIET)
|
||||
message(STATUS "Looking for ${flag} linker flag - not found")
|
||||
endif()
|
||||
set(${VARIABLE} "" CACHE INTERNAL "Have linker flag ${flag}")
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||
"Determining if the ${flag} linker flag is supported "
|
||||
"failed with the following output:\n"
|
||||
"${OUTPUT}\n\n")
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
@@ -1,181 +0,0 @@
|
||||
OPTION(USE_DEVICE_TREZOR "Trezor support compilation" ON)
|
||||
OPTION(USE_DEVICE_TREZOR_LIBUSB "Trezor LibUSB compilation" ON)
|
||||
OPTION(USE_DEVICE_TREZOR_UDP_RELEASE "Trezor UdpTransport in release mode" OFF)
|
||||
OPTION(USE_DEVICE_TREZOR_DEBUG "Trezor Debugging enabled" OFF)
|
||||
OPTION(TREZOR_DEBUG "Main trezor debugging switch" OFF)
|
||||
|
||||
# Helper function to fix cmake < 3.6.0 FindProtobuf variables
|
||||
function(_trezor_protobuf_fix_vars)
|
||||
if(${CMAKE_VERSION} VERSION_LESS "3.6.0")
|
||||
foreach(UPPER
|
||||
PROTOBUF_SRC_ROOT_FOLDER
|
||||
PROTOBUF_IMPORT_DIRS
|
||||
PROTOBUF_DEBUG
|
||||
PROTOBUF_LIBRARY
|
||||
PROTOBUF_PROTOC_LIBRARY
|
||||
PROTOBUF_INCLUDE_DIR
|
||||
PROTOBUF_PROTOC_EXECUTABLE
|
||||
PROTOBUF_LIBRARY_DEBUG
|
||||
PROTOBUF_PROTOC_LIBRARY_DEBUG
|
||||
PROTOBUF_LITE_LIBRARY
|
||||
PROTOBUF_LITE_LIBRARY_DEBUG
|
||||
)
|
||||
if (DEFINED ${UPPER})
|
||||
string(REPLACE "PROTOBUF_" "Protobuf_" Camel ${UPPER})
|
||||
if (NOT DEFINED ${Camel})
|
||||
set(${Camel} ${${UPPER}} PARENT_SCOPE)
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Use Trezor master switch
|
||||
if (USE_DEVICE_TREZOR)
|
||||
# Protobuf is required to build protobuf messages for Trezor
|
||||
include(FindProtobuf OPTIONAL)
|
||||
find_package(Protobuf)
|
||||
_trezor_protobuf_fix_vars()
|
||||
|
||||
# Protobuf handling the cache variables set in docker.
|
||||
if(NOT Protobuf_FOUND AND NOT Protobuf_LIBRARY AND NOT Protobuf_PROTOC_EXECUTABLE AND NOT Protobuf_INCLUDE_DIR)
|
||||
message(STATUS "Could not find Protobuf")
|
||||
elseif(NOT Protobuf_LIBRARY OR NOT EXISTS "${Protobuf_LIBRARY}")
|
||||
message(STATUS "Protobuf library not found: ${Protobuf_LIBRARY}")
|
||||
unset(Protobuf_FOUND)
|
||||
elseif(NOT Protobuf_PROTOC_EXECUTABLE OR NOT EXISTS "${Protobuf_PROTOC_EXECUTABLE}")
|
||||
message(STATUS "Protobuf executable not found: ${Protobuf_PROTOC_EXECUTABLE}")
|
||||
unset(Protobuf_FOUND)
|
||||
elseif(NOT Protobuf_INCLUDE_DIR OR NOT EXISTS "${Protobuf_INCLUDE_DIR}")
|
||||
message(STATUS "Protobuf include dir not found: ${Protobuf_INCLUDE_DIR}")
|
||||
unset(Protobuf_FOUND)
|
||||
else()
|
||||
message(STATUS "Protobuf lib: ${Protobuf_LIBRARY}, inc: ${Protobuf_INCLUDE_DIR}, protoc: ${Protobuf_PROTOC_EXECUTABLE}")
|
||||
set(Protobuf_INCLUDE_DIRS ${Protobuf_INCLUDE_DIR})
|
||||
set(Protobuf_FOUND 1) # override found if all rquired info was provided by variables
|
||||
endif()
|
||||
|
||||
if(TREZOR_DEBUG)
|
||||
set(USE_DEVICE_TREZOR_DEBUG 1)
|
||||
endif()
|
||||
|
||||
# Compile debugging support (for tests)
|
||||
if (USE_DEVICE_TREZOR_DEBUG)
|
||||
add_definitions(-DWITH_TREZOR_DEBUGGING=1)
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "Trezor support disabled by USE_DEVICE_TREZOR")
|
||||
endif()
|
||||
|
||||
if(Protobuf_FOUND AND USE_DEVICE_TREZOR)
|
||||
if (NOT "$ENV{TREZOR_PYTHON}" STREQUAL "")
|
||||
set(TREZOR_PYTHON "$ENV{TREZOR_PYTHON}" CACHE INTERNAL "Copied from environment variable TREZOR_PYTHON")
|
||||
else()
|
||||
find_package(Python QUIET COMPONENTS Interpreter) # cmake 3.12+
|
||||
if(Python_Interpreter_FOUND)
|
||||
set(TREZOR_PYTHON "${Python_EXECUTABLE}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT TREZOR_PYTHON)
|
||||
find_package(PythonInterp)
|
||||
if(PYTHONINTERP_FOUND AND PYTHON_EXECUTABLE)
|
||||
set(TREZOR_PYTHON "${PYTHON_EXECUTABLE}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT TREZOR_PYTHON)
|
||||
message(STATUS "Trezor: Python not found")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Protobuf compilation test
|
||||
if(Protobuf_FOUND AND USE_DEVICE_TREZOR AND TREZOR_PYTHON)
|
||||
execute_process(COMMAND ${Protobuf_PROTOC_EXECUTABLE} -I "${CMAKE_CURRENT_LIST_DIR}" -I "${Protobuf_INCLUDE_DIR}" "${CMAKE_CURRENT_LIST_DIR}/test-protobuf.proto" --cpp_out ${CMAKE_BINARY_DIR} RESULT_VARIABLE RET OUTPUT_VARIABLE OUT ERROR_VARIABLE ERR)
|
||||
if(RET)
|
||||
message(STATUS "Protobuf test generation failed: ${OUT} ${ERR}")
|
||||
endif()
|
||||
|
||||
try_compile(Protobuf_COMPILE_TEST_PASSED
|
||||
"${CMAKE_BINARY_DIR}"
|
||||
SOURCES
|
||||
"${CMAKE_BINARY_DIR}/test-protobuf.pb.cc"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/test-protobuf.cpp"
|
||||
CMAKE_FLAGS
|
||||
"-DINCLUDE_DIRECTORIES=${Protobuf_INCLUDE_DIR};${CMAKE_BINARY_DIR}"
|
||||
"-DCMAKE_CXX_STANDARD=11"
|
||||
LINK_LIBRARIES ${Protobuf_LIBRARY}
|
||||
OUTPUT_VARIABLE OUTPUT
|
||||
)
|
||||
if(NOT Protobuf_COMPILE_TEST_PASSED)
|
||||
message(STATUS "Protobuf Compilation test failed: ${OUTPUT}.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Try to build protobuf messages
|
||||
if(Protobuf_FOUND AND USE_DEVICE_TREZOR AND TREZOR_PYTHON AND Protobuf_COMPILE_TEST_PASSED)
|
||||
set(ENV{PROTOBUF_INCLUDE_DIRS} "${Protobuf_INCLUDE_DIR}")
|
||||
set(ENV{PROTOBUF_PROTOC_EXECUTABLE} "${Protobuf_PROTOC_EXECUTABLE}")
|
||||
set(TREZOR_PROTOBUF_PARAMS "")
|
||||
if (USE_DEVICE_TREZOR_DEBUG)
|
||||
set(TREZOR_PROTOBUF_PARAMS "--debug")
|
||||
endif()
|
||||
|
||||
execute_process(COMMAND ${TREZOR_PYTHON} tools/build_protob.py ${TREZOR_PROTOBUF_PARAMS} WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/../src/device_trezor/trezor RESULT_VARIABLE RET OUTPUT_VARIABLE OUT ERROR_VARIABLE ERR)
|
||||
if(RET)
|
||||
message(WARNING "Trezor protobuf messages could not be regenerated (err=${RET}, python ${PYTHON})."
|
||||
"OUT: ${OUT}, ERR: ${ERR}."
|
||||
"Please read src/device_trezor/trezor/tools/README.md")
|
||||
else()
|
||||
message(STATUS "Trezor protobuf messages regenerated out: \"${OUT}.\"")
|
||||
set(DEVICE_TREZOR_READY 1)
|
||||
add_definitions(-DDEVICE_TREZOR_READY=1)
|
||||
add_definitions(-DPROTOBUF_INLINE_NOT_IN_HEADERS=0)
|
||||
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
add_definitions(-DTREZOR_DEBUG=1)
|
||||
endif()
|
||||
|
||||
if(USE_DEVICE_TREZOR_UDP_RELEASE)
|
||||
add_definitions(-DUSE_DEVICE_TREZOR_UDP_RELEASE=1)
|
||||
endif()
|
||||
|
||||
if (Protobuf_INCLUDE_DIR)
|
||||
include_directories(${Protobuf_INCLUDE_DIR})
|
||||
endif()
|
||||
|
||||
# LibUSB support, check for particular version
|
||||
# Include support only if compilation test passes
|
||||
if (USE_DEVICE_TREZOR_LIBUSB)
|
||||
find_package(LibUSB)
|
||||
endif()
|
||||
|
||||
if (LibUSB_COMPILE_TEST_PASSED)
|
||||
add_definitions(-DHAVE_TREZOR_LIBUSB=1)
|
||||
if(LibUSB_INCLUDE_DIRS)
|
||||
include_directories(${LibUSB_INCLUDE_DIRS})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(TREZOR_LIBUSB_LIBRARIES "")
|
||||
if(LibUSB_COMPILE_TEST_PASSED)
|
||||
list(APPEND TREZOR_LIBUSB_LIBRARIES ${LibUSB_LIBRARIES} ${LIBUSB_DEP_LINKER})
|
||||
message(STATUS "Trezor compatible LibUSB found at: ${LibUSB_INCLUDE_DIRS}")
|
||||
endif()
|
||||
|
||||
if (BUILD_GUI_DEPS)
|
||||
set(TREZOR_DEP_LIBS "")
|
||||
set(TREZOR_DEP_LINKER "")
|
||||
|
||||
if (Protobuf_LIBRARY)
|
||||
list(APPEND TREZOR_DEP_LIBS ${Protobuf_LIBRARY})
|
||||
string(APPEND TREZOR_DEP_LINKER " -lprotobuf")
|
||||
endif()
|
||||
|
||||
if (TREZOR_LIBUSB_LIBRARIES)
|
||||
list(APPEND TREZOR_DEP_LIBS ${TREZOR_LIBUSB_LIBRARIES})
|
||||
string(APPEND TREZOR_DEP_LINKER " -lusb-1.0 ${LIBUSB_DEP_LINKER}")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
1803
cmake/Doxyfile.in
1803
cmake/Doxyfile.in
File diff suppressed because it is too large
Load Diff
@@ -1,14 +0,0 @@
|
||||
/* increase vertical space */
|
||||
#titlearea, #nav-path {
|
||||
display: none;
|
||||
height: 0px;
|
||||
}
|
||||
|
||||
|
||||
/* uncomment these lines for some extra vertical space */
|
||||
|
||||
/*
|
||||
.tablist li {
|
||||
line-height: 26px;
|
||||
}
|
||||
*/
|
||||
104
cmake/FindLibunbound.cmake
Normal file
104
cmake/FindLibunbound.cmake
Normal file
@@ -0,0 +1,104 @@
|
||||
#[=======================================================================[.rst:
|
||||
FindLibunbound
|
||||
--------------
|
||||
|
||||
Find the Libunbound library
|
||||
|
||||
Imported targets
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
This module defines the following :prop_tgt:`IMPORTED` targets:
|
||||
|
||||
``Libunbound::Libunbound``
|
||||
The Libunbound library, if found.
|
||||
|
||||
Result variables
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
This module will set the following variables in your project:
|
||||
|
||||
``Libunbound_FOUND``
|
||||
If false, do not try to use Libunbound.
|
||||
``LIBUNBOUND_INCLUDE_DIR``
|
||||
where to find libunbound headers.
|
||||
``LIBUNBOUND_LIBRARIES``
|
||||
the libraries needed to use Libunbound.
|
||||
``LIBUNBOUND_VERSION``
|
||||
the version of the Libunbound library found
|
||||
|
||||
#]=======================================================================]
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(PkgLibunbound IMPORTED_TARGET GLOBAL QUIET libunbound)
|
||||
endif ()
|
||||
|
||||
if (PkgLibunbound_FOUND)
|
||||
set(LIBUNBOUND_INCLUDE_DIR ${PkgLibunbound_INCLUDE_DIRS} CACHE FILEPATH "libunbound include path")
|
||||
set(LIBUNBOUND_LIBRARIES ${PkgLibunbound_LIBRARIES} CACHE STRING "libunbound libraries")
|
||||
set(LIBUNBOUND_VERSION ${PkgLibunbound_VERSION})
|
||||
add_library(Libunbound::Libunbound ALIAS PkgConfig::PkgLibunbound)
|
||||
set(Libunbound_FOUND ON)
|
||||
else ()
|
||||
find_path(LIBUNBOUND_INCLUDE_DIR unbound.h
|
||||
HINTS
|
||||
"${LIBUNBOUND_DIR}"
|
||||
"${LIBUNBOUND_DIR}/include"
|
||||
)
|
||||
|
||||
find_library(LIBUNBOUND_LIBRARY NAMES unbound
|
||||
HINTS
|
||||
"${LIBUNBOUND_DIR}"
|
||||
"${LIBUNBOUND_DIR}/lib"
|
||||
)
|
||||
|
||||
set(_LIBUNBOUND_LIBRARIES "")
|
||||
|
||||
if (UNIX)
|
||||
find_package(Threads REQUIRED)
|
||||
find_package(OpenSSL REQUIRED)
|
||||
|
||||
list(APPEND _LIBUNBOUND_LIBRARIES "${CMAKE_THREAD_LIBS_INIT}")
|
||||
list(APPEND _LIBUNBOUND_LIBRARIES "${OPENSSL_LIBRARIES}")
|
||||
endif()
|
||||
|
||||
if (LIBUNBOUND_INCLUDE_DIR AND LIBUNBOUND_LIBRARY)
|
||||
if (NOT TARGET Libunbound::Libunbound)
|
||||
add_library(Libunbound::Libunbound UNKNOWN IMPORTED)
|
||||
set_target_properties(Libunbound::Libunbound PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${LIBUNBOUND_INCLUDE_DIR}"
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
|
||||
IMPORTED_LOCATION "${LIBUNBOUND_LIBRARY}"
|
||||
)
|
||||
|
||||
if(UNIX AND TARGET Threads::Threads)
|
||||
set_property(TARGET Libunbound::Libunbound APPEND PROPERTY
|
||||
INTERFACE_LINK_LIBRARIES Threads::Threads)
|
||||
endif ()
|
||||
if(UNIX AND TARGET OpenSSL::SSL)
|
||||
set_property(TARGET Libunbound::Libunbound APPEND PROPERTY
|
||||
INTERFACE_LINK_LIBRARIES OpenSSL::SSL)
|
||||
endif ()
|
||||
if(UNIX AND TARGET OpenSSL::Crypto)
|
||||
set_property(TARGET Libunbound::Libunbound APPEND PROPERTY
|
||||
INTERFACE_LINK_LIBRARIES OpenSSL::Crypto)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
if (NOT LIBUNBOUND_VERSION AND LIBUNBOUND_INCLUDE_DIR AND EXISTS "${LIBUNBOUND_INCLUDE_DIR}/unbound.h")
|
||||
file(STRINGS "${LIBUNBOUND_INCLUDE_DIR}/unbound.h" LIBUNBOUND_H REGEX "^#define UNBOUND_VERSION_M[A-Z]+")
|
||||
string(REGEX REPLACE "^.*MAJOR ([0-9]+).*MINOR ([0-9]+).*MICRO ([0-9]+).*$" "\\1.\\2.\\3" LIBUNBOUND_VERSION "${LIBUNBOUND_H}")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
list(APPEND _LIBUNBOUND_LIBRARIES "${LIBUNBOUND_LIBRARY}")
|
||||
set(LIBUNBOUND_LIBRARIES ${_LIBUNBOUND_LIBRARIES} CACHE STRING "libunbound libraries")
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Libunbound
|
||||
REQUIRED_VARS LIBUNBOUND_LIBRARIES LIBUNBOUND_INCLUDE_DIR
|
||||
VERSION_VAR LIBUNBOUND_VERSION
|
||||
)
|
||||
endif ()
|
||||
|
||||
mark_as_advanced(LIBUNBOUND_INCLUDE_DIR LIBUNBOUND_LIBRARIES LIBUNBOUND_LIBRARY)
|
||||
@@ -1,40 +0,0 @@
|
||||
# Copyright (c) 2014-2022, The Monero Project
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification, are
|
||||
# permitted provided that the following conditions are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
# conditions and the following disclaimer.
|
||||
#
|
||||
# 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
# of conditions and the following disclaimer in the documentation and/or other
|
||||
# materials provided with the distribution.
|
||||
#
|
||||
# 3. Neither the name of the copyright holder nor the names of its contributors may be
|
||||
# used to endorse or promote products derived from this software without specific
|
||||
# prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
# THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
||||
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
MESSAGE(STATUS "Looking for libunbound")
|
||||
|
||||
FIND_PATH(UNBOUND_INCLUDE_DIR
|
||||
NAMES unbound.h
|
||||
PATH_SUFFIXES include/ include/unbound/
|
||||
PATHS "${PROJECT_SOURCE_DIR}"
|
||||
${UNBOUND_ROOT}
|
||||
$ENV{UNBOUND_ROOT}
|
||||
/usr/local/
|
||||
/usr/
|
||||
)
|
||||
|
||||
find_library(UNBOUND_LIBRARIES unbound)
|
||||
17
cmake/FindZMQ.cmake
Normal file
17
cmake/FindZMQ.cmake
Normal file
@@ -0,0 +1,17 @@
|
||||
# - Try to find ZMQ
|
||||
# Once done this will define
|
||||
# ZMQ_FOUND - System has ZMQ
|
||||
# ZMQ_INCLUDE_DIRS - The ZMQ include directories
|
||||
# ZMQ_LIBRARIES - The libraries needed to use ZMQ
|
||||
# ZMQ_DEFINITIONS - Compiler switches required for using ZMQ
|
||||
|
||||
find_path ( ZMQ_INCLUDE_DIR zmq.h )
|
||||
find_library ( ZMQ_LIBRARY NAMES zmq )
|
||||
|
||||
set ( ZMQ_LIBRARIES ${ZMQ_LIBRARY} )
|
||||
set ( ZMQ_INCLUDE_DIRS ${ZMQ_INCLUDE_DIR} )
|
||||
|
||||
include ( FindPackageHandleStandardArgs )
|
||||
# handle the QUIETLY and REQUIRED arguments and set ZMQ_FOUND to TRUE
|
||||
# if all listed variables are TRUE
|
||||
find_package_handle_standard_args ( ZMQ DEFAULT_MSG ZMQ_LIBRARY ZMQ_INCLUDE_DIR )
|
||||
291
cmake/Findsodium.cmake
Normal file
291
cmake/Findsodium.cmake
Normal file
@@ -0,0 +1,291 @@
|
||||
# Written in 2016 by Henrik Steffen Gaßmann <henrik@gassmann.onl>
|
||||
#
|
||||
# To the extent possible under law, the author(s) have dedicated all copyright
|
||||
# and related and neighboring rights to this software to the public domain
|
||||
# worldwide. This software is distributed without any warranty.
|
||||
#
|
||||
# You should have received a copy of the CC0 Public Domain Dedication along with
|
||||
# this software. If not, see
|
||||
#
|
||||
# http://creativecommons.org/publicdomain/zero/1.0/
|
||||
#
|
||||
# ##############################################################################
|
||||
# Tries to find the local libsodium installation.
|
||||
#
|
||||
# On Windows the sodium_DIR environment variable is used as a default hint which
|
||||
# can be overridden by setting the corresponding cmake variable.
|
||||
#
|
||||
# Once done the following variables will be defined:
|
||||
#
|
||||
# sodium_FOUND sodium_INCLUDE_DIR sodium_LIBRARY_DEBUG sodium_LIBRARY_RELEASE
|
||||
# sodium_VERSION_STRING
|
||||
#
|
||||
# Furthermore an imported "sodium" target is created.
|
||||
#
|
||||
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
||||
set(_GCC_COMPATIBLE 1)
|
||||
endif()
|
||||
|
||||
# static library option
|
||||
if(NOT DEFINED sodium_USE_STATIC_LIBS)
|
||||
option(sodium_USE_STATIC_LIBS "enable to statically link against sodium" OFF)
|
||||
endif()
|
||||
if(NOT (sodium_USE_STATIC_LIBS EQUAL sodium_USE_STATIC_LIBS_LAST))
|
||||
unset(sodium_LIBRARY CACHE)
|
||||
unset(sodium_LIBRARY_DEBUG CACHE)
|
||||
unset(sodium_LIBRARY_RELEASE CACHE)
|
||||
unset(sodium_DLL_DEBUG CACHE)
|
||||
unset(sodium_DLL_RELEASE CACHE)
|
||||
set(sodium_USE_STATIC_LIBS_LAST
|
||||
${sodium_USE_STATIC_LIBS}
|
||||
CACHE INTERNAL "internal change tracking variable")
|
||||
endif()
|
||||
|
||||
# ##############################################################################
|
||||
# UNIX
|
||||
if(UNIX)
|
||||
# import pkg-config
|
||||
find_package(PkgConfig QUIET)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(sodium_PKG QUIET libsodium)
|
||||
endif()
|
||||
|
||||
if(sodium_USE_STATIC_LIBS)
|
||||
if(sodium_PKG_STATIC_LIBRARIES)
|
||||
foreach(_libname ${sodium_PKG_STATIC_LIBRARIES})
|
||||
if(NOT _libname MATCHES "^lib.*\\.a$") # ignore strings already ending
|
||||
# with .a
|
||||
list(INSERT sodium_PKG_STATIC_LIBRARIES 0 "lib${_libname}.a")
|
||||
endif()
|
||||
endforeach()
|
||||
list(REMOVE_DUPLICATES sodium_PKG_STATIC_LIBRARIES)
|
||||
else()
|
||||
# if pkgconfig for libsodium doesn't provide static lib info, then
|
||||
# override PKG_STATIC here..
|
||||
set(sodium_PKG_STATIC_LIBRARIES libsodium.a)
|
||||
endif()
|
||||
|
||||
set(XPREFIX sodium_PKG_STATIC)
|
||||
else()
|
||||
if(sodium_PKG_LIBRARIES STREQUAL "")
|
||||
set(sodium_PKG_LIBRARIES sodium)
|
||||
endif()
|
||||
|
||||
set(XPREFIX sodium_PKG)
|
||||
endif()
|
||||
|
||||
find_path(sodium_INCLUDE_DIR sodium.h HINTS ${${XPREFIX}_INCLUDE_DIRS})
|
||||
find_library(sodium_LIBRARY_DEBUG
|
||||
NAMES ${${XPREFIX}_LIBRARIES}
|
||||
HINTS ${${XPREFIX}_LIBRARY_DIRS})
|
||||
find_library(sodium_LIBRARY_RELEASE
|
||||
NAMES ${${XPREFIX}_LIBRARIES}
|
||||
HINTS ${${XPREFIX}_LIBRARY_DIRS})
|
||||
|
||||
# ############################################################################
|
||||
# Windows
|
||||
elseif(WIN32)
|
||||
set(sodium_DIR "$ENV{sodium_DIR}" CACHE FILEPATH "sodium install directory")
|
||||
mark_as_advanced(sodium_DIR)
|
||||
|
||||
find_path(sodium_INCLUDE_DIR sodium.h
|
||||
HINTS ${sodium_DIR}
|
||||
PATH_SUFFIXES include)
|
||||
|
||||
if(MSVC)
|
||||
# detect target architecture
|
||||
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/arch.c" [=[
|
||||
#if defined _M_IX86
|
||||
#error ARCH_VALUE x86_32
|
||||
#elif defined _M_X64
|
||||
#error ARCH_VALUE x86_64
|
||||
#endif
|
||||
#error ARCH_VALUE unknown
|
||||
]=])
|
||||
try_compile(_UNUSED_VAR "${CMAKE_CURRENT_BINARY_DIR}"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/arch.c"
|
||||
OUTPUT_VARIABLE _COMPILATION_LOG)
|
||||
string(REGEX
|
||||
REPLACE ".*ARCH_VALUE ([a-zA-Z0-9_]+).*"
|
||||
"\\1"
|
||||
_TARGET_ARCH
|
||||
"${_COMPILATION_LOG}")
|
||||
|
||||
# construct library path
|
||||
if(_TARGET_ARCH STREQUAL "x86_32")
|
||||
string(APPEND _PLATFORM_PATH "Win32")
|
||||
elseif(_TARGET_ARCH STREQUAL "x86_64")
|
||||
string(APPEND _PLATFORM_PATH "x64")
|
||||
else()
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"the ${_TARGET_ARCH} architecture is not supported by Findsodium.cmake."
|
||||
)
|
||||
endif()
|
||||
string(APPEND _PLATFORM_PATH "/$$CONFIG$$")
|
||||
|
||||
if(MSVC_VERSION LESS 1900)
|
||||
math(EXPR _VS_VERSION "${MSVC_VERSION} / 10 - 60")
|
||||
else()
|
||||
math(EXPR _VS_VERSION "${MSVC_VERSION} / 10 - 50")
|
||||
endif()
|
||||
string(APPEND _PLATFORM_PATH "/v${_VS_VERSION}")
|
||||
|
||||
if(sodium_USE_STATIC_LIBS)
|
||||
string(APPEND _PLATFORM_PATH "/static")
|
||||
else()
|
||||
string(APPEND _PLATFORM_PATH "/dynamic")
|
||||
endif()
|
||||
|
||||
string(REPLACE "$$CONFIG$$"
|
||||
"Debug"
|
||||
_DEBUG_PATH_SUFFIX
|
||||
"${_PLATFORM_PATH}")
|
||||
string(REPLACE "$$CONFIG$$"
|
||||
"Release"
|
||||
_RELEASE_PATH_SUFFIX
|
||||
"${_PLATFORM_PATH}")
|
||||
|
||||
find_library(sodium_LIBRARY_DEBUG libsodium.lib
|
||||
HINTS ${sodium_DIR}
|
||||
PATH_SUFFIXES ${_DEBUG_PATH_SUFFIX})
|
||||
find_library(sodium_LIBRARY_RELEASE libsodium.lib
|
||||
HINTS ${sodium_DIR}
|
||||
PATH_SUFFIXES ${_RELEASE_PATH_SUFFIX})
|
||||
if(NOT sodium_USE_STATIC_LIBS)
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES_BCK ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll")
|
||||
find_library(sodium_DLL_DEBUG libsodium
|
||||
HINTS ${sodium_DIR}
|
||||
PATH_SUFFIXES ${_DEBUG_PATH_SUFFIX})
|
||||
find_library(sodium_DLL_RELEASE libsodium
|
||||
HINTS ${sodium_DIR}
|
||||
PATH_SUFFIXES ${_RELEASE_PATH_SUFFIX})
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_BCK})
|
||||
endif()
|
||||
|
||||
elseif(_GCC_COMPATIBLE)
|
||||
if(sodium_USE_STATIC_LIBS)
|
||||
find_library(sodium_LIBRARY_DEBUG libsodium.a
|
||||
HINTS ${sodium_DIR}
|
||||
PATH_SUFFIXES lib)
|
||||
find_library(sodium_LIBRARY_RELEASE libsodium.a
|
||||
HINTS ${sodium_DIR}
|
||||
PATH_SUFFIXES lib)
|
||||
else()
|
||||
find_library(sodium_LIBRARY_DEBUG libsodium.dll.a
|
||||
HINTS ${sodium_DIR}
|
||||
PATH_SUFFIXES lib)
|
||||
find_library(sodium_LIBRARY_RELEASE libsodium.dll.a
|
||||
HINTS ${sodium_DIR}
|
||||
PATH_SUFFIXES lib)
|
||||
|
||||
file(GLOB _DLL
|
||||
LIST_DIRECTORIES false
|
||||
RELATIVE "${sodium_DIR}/bin"
|
||||
"${sodium_DIR}/bin/libsodium*.dll")
|
||||
find_library(sodium_DLL_DEBUG ${_DLL} libsodium
|
||||
HINTS ${sodium_DIR}
|
||||
PATH_SUFFIXES bin)
|
||||
find_library(sodium_DLL_RELEASE ${_DLL} libsodium
|
||||
HINTS ${sodium_DIR}
|
||||
PATH_SUFFIXES bin)
|
||||
endif()
|
||||
else()
|
||||
message(FATAL_ERROR "this platform is not supported by FindSodium.cmake")
|
||||
endif()
|
||||
|
||||
# ############################################################################
|
||||
# unsupported
|
||||
else()
|
||||
message(FATAL_ERROR "this platform is not supported by FindSodium.cmake")
|
||||
endif()
|
||||
|
||||
# ##############################################################################
|
||||
# common stuff
|
||||
|
||||
# extract sodium version
|
||||
if(sodium_INCLUDE_DIR)
|
||||
set(_VERSION_HEADER "${sodium_INCLUDE_DIR}/sodium/version.h")
|
||||
if(EXISTS "${_VERSION_HEADER}")
|
||||
file(READ "${_VERSION_HEADER}" _VERSION_HEADER_CONTENT)
|
||||
string(REGEX
|
||||
REPLACE ".*define[ \t]+SODIUM_VERSION_STRING[^\"]+\"([^\"]+)\".*"
|
||||
"\\1"
|
||||
sodium_VERSION_STRING
|
||||
"${_VERSION_HEADER_CONTENT}")
|
||||
set(sodium_VERSION_STRING "${sodium_VERSION_STRING}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# communicate results
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(sodium
|
||||
REQUIRED_VARS
|
||||
sodium_LIBRARY_RELEASE
|
||||
sodium_LIBRARY_DEBUG
|
||||
sodium_INCLUDE_DIR
|
||||
VERSION_VAR
|
||||
sodium_VERSION_STRING)
|
||||
|
||||
# mark file paths as advanced
|
||||
mark_as_advanced(sodium_INCLUDE_DIR)
|
||||
mark_as_advanced(sodium_LIBRARY_DEBUG)
|
||||
mark_as_advanced(sodium_LIBRARY_RELEASE)
|
||||
if(WIN32)
|
||||
mark_as_advanced(sodium_DLL_DEBUG)
|
||||
mark_as_advanced(sodium_DLL_RELEASE)
|
||||
endif()
|
||||
|
||||
# create imported target
|
||||
if(sodium_USE_STATIC_LIBS)
|
||||
set(_LIB_TYPE STATIC)
|
||||
else()
|
||||
set(_LIB_TYPE SHARED)
|
||||
endif()
|
||||
add_library(sodium ${_LIB_TYPE} IMPORTED)
|
||||
|
||||
set_target_properties(sodium
|
||||
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${sodium_INCLUDE_DIR}"
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES
|
||||
"C")
|
||||
|
||||
if(sodium_USE_STATIC_LIBS)
|
||||
set_target_properties(sodium
|
||||
PROPERTIES INTERFACE_COMPILE_DEFINITIONS
|
||||
"SODIUM_STATIC"
|
||||
IMPORTED_LOCATION
|
||||
"${sodium_LIBRARY_RELEASE}"
|
||||
IMPORTED_LOCATION_DEBUG
|
||||
"${sodium_LIBRARY_DEBUG}")
|
||||
else()
|
||||
if(UNIX)
|
||||
set_target_properties(sodium
|
||||
PROPERTIES IMPORTED_LOCATION
|
||||
"${sodium_LIBRARY_RELEASE}"
|
||||
IMPORTED_LOCATION_DEBUG
|
||||
"${sodium_LIBRARY_DEBUG}")
|
||||
elseif(WIN32)
|
||||
set_target_properties(sodium
|
||||
PROPERTIES IMPORTED_IMPLIB
|
||||
"${sodium_LIBRARY_RELEASE}"
|
||||
IMPORTED_IMPLIB_DEBUG
|
||||
"${sodium_LIBRARY_DEBUG}")
|
||||
if(NOT (sodium_DLL_DEBUG MATCHES ".*-NOTFOUND"))
|
||||
set_target_properties(sodium
|
||||
PROPERTIES IMPORTED_LOCATION_DEBUG
|
||||
"${sodium_DLL_DEBUG}")
|
||||
endif()
|
||||
if(NOT (sodium_DLL_RELEASE MATCHES ".*-NOTFOUND"))
|
||||
set_target_properties(sodium
|
||||
PROPERTIES IMPORTED_LOCATION_RELWITHDEBINFO
|
||||
"${sodium_DLL_RELEASE}"
|
||||
IMPORTED_LOCATION_MINSIZEREL
|
||||
"${sodium_DLL_RELEASE}"
|
||||
IMPORTED_LOCATION_RELEASE
|
||||
"${sodium_DLL_RELEASE}")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
51
cmake/MoneroConfig.cmake.in
Normal file
51
cmake/MoneroConfig.cmake.in
Normal file
@@ -0,0 +1,51 @@
|
||||
@PACKAGE_INIT@
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/modules/")
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/MoneroTargets.cmake")
|
||||
|
||||
find_package(Threads)
|
||||
find_package(Backtrace)
|
||||
find_package(PythonInterp)
|
||||
find_package(miniupnpc REQUIRED)
|
||||
find_package(ZMQ REQUIRED)
|
||||
|
||||
find_package(OpenSSL REQUIRED)
|
||||
find_package(Boost 1.58 REQUIRED COMPONENTS system filesystem thread date_time chrono regex serialization program_options locale)
|
||||
find_package(Libunbound 1.16 REQUIRED)
|
||||
find_package(sodium REQUIRED)
|
||||
|
||||
check_required_components(epee)
|
||||
check_required_components(easylogging)
|
||||
check_required_components(qrcodegen)
|
||||
check_required_components(lmdb)
|
||||
check_required_components(cncrypto)
|
||||
check_required_components(version)
|
||||
check_required_components(common)
|
||||
check_required_components(lmdb_lib)
|
||||
check_required_components(randomx)
|
||||
check_required_components(cryptonote_format_utils_basic)
|
||||
check_required_components(monero-crypto-amd64-64-24k)
|
||||
check_required_components(wallet-crypto)
|
||||
check_required_components(ringct)
|
||||
check_required_components(cryptonote_basic)
|
||||
check_required_components(ringct_basic)
|
||||
check_required_components(checkpoints)
|
||||
check_required_components(blockchain_db)
|
||||
check_required_components(cryptonote_core)
|
||||
check_required_components(cryptonote_protocol)
|
||||
check_required_components(mnemonics)
|
||||
check_required_components(device)
|
||||
check_required_components(blocks)
|
||||
check_required_components(wallet)
|
||||
check_required_components(wallet_api)
|
||||
check_required_components(rpc_base)
|
||||
check_required_components(rpc)
|
||||
check_required_components(rpc_pub)
|
||||
check_required_components(daemon_messages)
|
||||
check_required_components(daemon_rpc_server)
|
||||
check_required_components(net)
|
||||
check_required_components(p2p)
|
||||
check_required_components(multisig)
|
||||
check_required_components(hardforks)
|
||||
check_required_components(daemonizer)
|
||||
check_required_components(serialization)
|
||||
@@ -1,72 +0,0 @@
|
||||
# Copyright (c) 2014-2022, The Monero Project
|
||||
#
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification, are
|
||||
# permitted provided that the following conditions are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
# conditions and the following disclaimer.
|
||||
#
|
||||
# 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
# of conditions and the following disclaimer in the documentation and/or other
|
||||
# materials provided with the distribution.
|
||||
#
|
||||
# 3. Neither the name of the copyright holder nor the names of its contributors may be
|
||||
# used to endorse or promote products derived from this software without specific
|
||||
# prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
# THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
||||
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_CLANG_TIDY.html
|
||||
# This module sets the following variables:
|
||||
# CMAKE_C_CLANG_TIDY
|
||||
# CMAKE_CXX_CLANG_TIDY
|
||||
# when clang-tidy is found in PATH. Afterwards, the code is being linted by the tool.
|
||||
# The checks to be enabled can be manipulated with the variable MONERO_CLANG_TIDY_CHECKS
|
||||
|
||||
macro (monero_clang_tidy LANGUAGE)
|
||||
set(TOOL_NAME "clang-tidy")
|
||||
set(MONERO_CLANG_TIDY_MIN_VERSION "3.6")
|
||||
if(${CMAKE_VERSION} VERSION_LESS "${MONERO_CLANG_TIDY_MIN_VERSION}")
|
||||
message(FATAL_ERROR "Sorry, ${TOOL_NAME} is available for CMake from version ${MONERO_CLANG_TIDY_MIN_VERSION}")
|
||||
else()
|
||||
message(STATUS "Trying to enable ${TOOL_NAME}")
|
||||
find_program(MONERO_CLANG_BIN ${TOOL_NAME})
|
||||
if(NOT MONERO_CLANG_BIN)
|
||||
message(FATAL_ERROR "${TOOL_NAME} not found! Try running: sudo apt install ${TOOL_NAME}")
|
||||
else()
|
||||
message(STATUS "Found ${MONERO_CLANG_BIN}")
|
||||
set(MONERO_CLANG_TIDY_CHECKS
|
||||
-header-filter=.; # By default the headers are excluded. This line enables them.
|
||||
-checks=*; # Currently enabling all checks
|
||||
# An example of selectively enabling checks:
|
||||
#-checks=bugprone-*,cppcoreguidelines-avoid-goto # Have to be in one line :(
|
||||
)
|
||||
# Current list of checks is avaibale under:
|
||||
# https://clang.llvm.org/extra/clang-tidy/
|
||||
if (${LANGUAGE} STREQUAL "C")
|
||||
set(CMAKE_C_CLANG_TIDY
|
||||
${MONERO_CLANG_BIN}; # Mind the semicolon
|
||||
${MONERO_CLANG_TIDY_CHECKS}
|
||||
)
|
||||
elseif (${LANGUAGE} STREQUAL "CXX")
|
||||
set(CMAKE_CXX_CLANG_TIDY
|
||||
${MONERO_CLANG_BIN}; # Mind the semicolon
|
||||
${MONERO_CLANG_TIDY_CHECKS}
|
||||
)
|
||||
else()
|
||||
message(FATAL_ERROR "${TOOL_NAME}: Unsupported language: ${LANGUAGE}")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
95
cmake/functions.cmake
Normal file
95
cmake/functions.cmake
Normal file
@@ -0,0 +1,95 @@
|
||||
include(GNUInstallDirs)
|
||||
include(CMakePackageConfigHelpers)
|
||||
|
||||
function(monero_install_library targetName)
|
||||
set(flags)
|
||||
set(args)
|
||||
set(listArgs INCLUDE_DIR HEADERS)
|
||||
cmake_parse_arguments(arg "${flags}" "${args}" "${listArgs}" ${ARGN})
|
||||
|
||||
set(include_dir "${arg_INCLUDE_DIR}")
|
||||
set(headers "${arg_HEADERS}")
|
||||
|
||||
if(NOT include_dir)
|
||||
set(include_dir "${CMAKE_INSTALL_INCLUDEDIR}/monero/")
|
||||
endif()
|
||||
|
||||
if(${targetName} STREQUAL "device")
|
||||
message(STATUS "lol")
|
||||
endif()
|
||||
|
||||
if(headers AND include_dir)
|
||||
install_with_directory(DESTINATION ${include_dir} FILES ${headers})
|
||||
endif()
|
||||
|
||||
install(TARGETS ${targetName} EXPORT MoneroTargets
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}/monero/
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/monero/
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/monero/
|
||||
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/monero/)
|
||||
endfunction()
|
||||
|
||||
function(print_cmake_summary)
|
||||
message(STATUS "\n====================================== SUMMARY")
|
||||
message(STATUS "Using C security hardening flags: ${C_SECURITY_FLAGS}")
|
||||
message(STATUS "Using C++ security hardening flags: ${CXX_SECURITY_FLAGS}")
|
||||
message(STATUS "Using linker security hardening flags: ${LD_SECURITY_FLAGS}")
|
||||
|
||||
if(GIT_FOUND)
|
||||
execute_process(COMMAND git rev-parse "HEAD" WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/wownero OUTPUT_VARIABLE _WOWNERO_HEAD OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if(NOT _WOWNERO_HEAD STREQUAL WOWNERO_HEAD)
|
||||
message(STATUS "[+] WOWNERO HEAD: ${_WOWNERO_HEAD} ... while CMake requested ${WOWNERO_HEAD}")
|
||||
else()
|
||||
message(STATUS "[+] WOWNERO HEAD: ${WOWNERO_HEAD}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
message(STATUS "[+] VERSION: ${VERSION}")
|
||||
message(STATUS "[+] STATIC: ${STATIC}")
|
||||
message(STATUS "[+] ARM: ${ARM}")
|
||||
message(STATUS "[+] Android: ${ANDROID}")
|
||||
message(STATUS "[+] iOS: ${IOS}")
|
||||
|
||||
message(STATUS "[+] OpenSSL")
|
||||
message(STATUS " - version: ${OPENSSL_VERSION}")
|
||||
message(STATUS " - dirs: ${OPENSSL_INCLUDE_DIR}")
|
||||
message(STATUS " - libs: ${OPENSSL_LIBRARIES}")
|
||||
|
||||
if(CAIRO_FOUND)
|
||||
message(STATUS "[+] Cairo")
|
||||
message(STATUS " - version: ${CAIRO_VERSION}")
|
||||
message(STATUS " - dirs: ${CAIRO_INCLUDE_DIRS}")
|
||||
message(STATUS " - libs: ${CAIRO_LIBRARIES}")
|
||||
endif()
|
||||
|
||||
if(XFIXES_FOUND)
|
||||
message(STATUS "[+] Xfixes")
|
||||
message(STATUS " - dirs: ${XFIXES_INCLUDE_DIR}")
|
||||
message(STATUS " - libs: ${XFIXES_LIBRARY}")
|
||||
endif()
|
||||
|
||||
message(STATUS "[+] Boost")
|
||||
message(STATUS " - version: ${Boost_VERSION}")
|
||||
message(STATUS " - dirs: ${Boost_INCLUDE_DIRS}")
|
||||
message(STATUS " - libs: ${Boost_LIBRARIES}")
|
||||
|
||||
if(Iconv_FOUND)
|
||||
message(STATUS "[+] Iconv")
|
||||
message(STATUS " - version: ${Iconv_VERSION}")
|
||||
message(STATUS " - libs: ${Iconv_LIBRARIES}")
|
||||
message(STATUS " - dirs: ${Iconv_INCLUDE_DIRS}")
|
||||
endif()
|
||||
|
||||
endfunction()
|
||||
|
||||
macro(install_with_directory)
|
||||
set(optionsArgs "")
|
||||
set(oneValueArgs "DESTINATION")
|
||||
set(multiValueArgs "FILES")
|
||||
cmake_parse_arguments(CAS "${optionsArgs}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
|
||||
|
||||
foreach(FILE ${CAS_FILES})
|
||||
get_filename_component(DIR ${FILE} DIRECTORY)
|
||||
INSTALL(FILES ${FILE} DESTINATION ${CAS_DESTINATION}/${DIR})
|
||||
endforeach()
|
||||
endmacro(install_with_directory)
|
||||
@@ -1,52 +0,0 @@
|
||||
// Copyright (c) 2014-2022, The Monero Project
|
||||
//
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification, are
|
||||
// permitted provided that the following conditions are met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
// conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
// of conditions and the following disclaimer in the documentation and/or other
|
||||
// materials provided with the distribution.
|
||||
//
|
||||
// 3. Neither the name of the copyright holder nor the names of its contributors may be
|
||||
// used to endorse or promote products derived from this software without specific
|
||||
// prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
||||
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include <libusb.h>
|
||||
|
||||
#define UNUSED(expr) (void)(expr)
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
libusb_device **devs;
|
||||
libusb_context *ctx = NULL;
|
||||
|
||||
int r = libusb_init(&ctx); UNUSED(r);
|
||||
ssize_t cnt = libusb_get_device_list(ctx, &devs); UNUSED(cnt);
|
||||
|
||||
struct libusb_device_descriptor desc;
|
||||
r = libusb_get_device_descriptor(devs[0], &desc); UNUSED(r);
|
||||
uint8_t bus_id = libusb_get_bus_number(devs[0]); UNUSED(bus_id);
|
||||
uint8_t addr = libusb_get_device_address(devs[0]); UNUSED(addr);
|
||||
|
||||
uint8_t tmp_path[16];
|
||||
r = libusb_get_port_numbers(devs[0], tmp_path, sizeof(tmp_path));
|
||||
UNUSED(r);
|
||||
UNUSED(tmp_path);
|
||||
|
||||
libusb_free_device_list(devs, 1);
|
||||
libusb_exit(ctx);
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
// Copyright (c) 2014-2022, The Monero Project
|
||||
//
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification, are
|
||||
// permitted provided that the following conditions are met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
// conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
// of conditions and the following disclaimer in the documentation and/or other
|
||||
// materials provided with the distribution.
|
||||
//
|
||||
// 3. Neither the name of the copyright holder nor the names of its contributors may be
|
||||
// used to endorse or promote products derived from this software without specific
|
||||
// prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
||||
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <google/protobuf/message.h>
|
||||
#include <google/protobuf/unknown_field_set.h>
|
||||
#include "test-protobuf.pb.h"
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
google::protobuf::UnknownFieldSet ufs;
|
||||
ufs.ClearAndFreeMemory();
|
||||
|
||||
Success sc;
|
||||
sc.set_message("test");
|
||||
sc.SerializeToOstream(&std::cerr);
|
||||
return 0;
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
syntax = "proto2";
|
||||
|
||||
import "google/protobuf/descriptor.proto";
|
||||
|
||||
message Success {
|
||||
optional string message = 1;
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
// Copyright (c) 2014-2022, The Monero Project
|
||||
//
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification, are
|
||||
// permitted provided that the following conditions are met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
// conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
// of conditions and the following disclaimer in the documentation and/or other
|
||||
// materials provided with the distribution.
|
||||
//
|
||||
// 3. Neither the name of the copyright holder nor the names of its contributors may be
|
||||
// used to endorse or promote products derived from this software without specific
|
||||
// prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
||||
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
static_assert(1, "FAIL");
|
||||
int main(int argc, char *argv[]) {
|
||||
return 0;
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
// Copyright (c) 2014-2022, The Monero Project
|
||||
//
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification, are
|
||||
// permitted provided that the following conditions are met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
// conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
// of conditions and the following disclaimer in the documentation and/or other
|
||||
// materials provided with the distribution.
|
||||
//
|
||||
// 3. Neither the name of the copyright holder nor the names of its contributors may be
|
||||
// used to endorse or promote products derived from this software without specific
|
||||
// prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
||||
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
static_assert(1, "FAIL");
|
||||
int main(int argc, char *argv[]) {
|
||||
return 0;
|
||||
}
|
||||
@@ -26,6 +26,5 @@
|
||||
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
||||
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
monero_enable_coverage()
|
||||
add_subdirectory(epee)
|
||||
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
package=openssl
|
||||
$(package)_version=1.1.1u
|
||||
$(package)_version=3.0.11
|
||||
$(package)_download_path=https://www.openssl.org/source
|
||||
$(package)_file_name=$(package)-$($(package)_version).tar.gz
|
||||
$(package)_sha256_hash=e2f8d84b523eecd06c7be7626830370300fbcc15386bf5142d72758f6963ebc6
|
||||
$(package)_sha256_hash=b3425d3bb4a2218d0697eb41f7fc0cdede016ed19ca49d168b78e8d947887f55
|
||||
|
||||
define $(package)_set_vars
|
||||
$(package)_config_env=AR="$($(package)_ar)" ARFLAGS=$($(package)_arflags) RANLIB="$($(package)_ranlib)" CC="$($(package)_cc)"
|
||||
$(package)_config_env_android=ANDROID_NDK_HOME="$(host_prefix)/native" PATH="$(host_prefix)/native/bin" CC=clang AR=ar RANLIB=ranlib
|
||||
$(package)_build_env_android=ANDROID_NDK_HOME="$(host_prefix)/native"
|
||||
$(package)_config_opts=--prefix=$(host_prefix) --openssldir=$(host_prefix)/etc/openssl
|
||||
$(package)_config_env_android=ANDROID_NDK_ROOT="$(host_prefix)/native" PATH="$(host_prefix)/native/bin" CC=clang AR=ar RANLIB=ranlib
|
||||
$(package)_build_env_android=ANDROID_NDK_ROOT="$(host_prefix)/native"
|
||||
$(package)_config_opts=--prefix=$(host_prefix) --openssldir=$(host_prefix)/etc/openssl --libdir=$(host_prefix)/lib
|
||||
$(package)_config_opts+=no-capieng
|
||||
$(package)_config_opts+=no-dso
|
||||
$(package)_config_opts+=no-dtls1
|
||||
$(package)_config_opts+=no-ec_nistp_64_gcc_128
|
||||
$(package)_config_opts+=no-gost
|
||||
$(package)_config_opts+=no-heartbeats
|
||||
$(package)_config_opts+=no-md2
|
||||
$(package)_config_opts+=no-rc5
|
||||
$(package)_config_opts+=no-rdrand
|
||||
@@ -22,8 +21,8 @@ $(package)_config_opts+=no-rfc3779
|
||||
$(package)_config_opts+=no-sctp
|
||||
$(package)_config_opts+=no-shared
|
||||
$(package)_config_opts+=no-ssl-trace
|
||||
$(package)_config_opts+=no-ssl2
|
||||
$(package)_config_opts+=no-ssl3
|
||||
$(package)_config_opts+=no-tests
|
||||
$(package)_config_opts+=no-unit-test
|
||||
$(package)_config_opts+=no-weak-ssl-ciphers
|
||||
$(package)_config_opts+=no-zlib
|
||||
@@ -49,7 +48,7 @@ $(package)_config_opts_x86_64_freebsd=BSD-x86_64
|
||||
endef
|
||||
|
||||
define $(package)_preprocess_cmds
|
||||
sed -i.old 's|"engines", "apps", "test", "util", "tools", "fuzz"|"engines", "tools"|' Configure
|
||||
sed -i.old 's|crypto ssl apps util tools fuzz providers doc|crypto ssl util tools providers|' build.info
|
||||
endef
|
||||
|
||||
define $(package)_config_cmds
|
||||
|
||||
@@ -11,6 +11,7 @@ define $(package)_set_vars
|
||||
$(package)_config_opts=--disable-shared --enable-static --without-pyunbound --prefix=$(host_prefix) --with-libexpat=$(host_prefix) --with-ssl=$(host_prefix) --with-libevent=no --without-pythonmodule --disable-flto --with-pthreads --with-libunbound-only
|
||||
$(package)_config_opts_linux=--with-pic
|
||||
$(package)_config_opts_w64=--enable-static-exe --sysconfdir=/etc --prefix=$(host_prefix) --target=$(host_prefix)
|
||||
$(package)_config_opts_x86_64_darwin=ac_cv_func_SHA384_Init=yes
|
||||
$(package)_build_opts_mingw32=LDFLAGS="$($(package)_ldflags) -lpthread"
|
||||
endef
|
||||
|
||||
|
||||
@@ -144,8 +144,8 @@ elseif(ARCHITECTURE STREQUAL "aarch64")
|
||||
endif()
|
||||
|
||||
if(ARCHITECTURE STREQUAL "riscv64")
|
||||
set(NO_AES ON)
|
||||
set(ARCH "rv64imafdc")
|
||||
set(ARCH_ID "riscv64")
|
||||
set(ARCH "rv64gc")
|
||||
endif()
|
||||
|
||||
if(ARCHITECTURE STREQUAL "i686")
|
||||
|
||||
@@ -245,8 +245,18 @@ namespace net_utils
|
||||
}
|
||||
}
|
||||
|
||||
// This magic var determines the maximum length for when copying the body message in
|
||||
// memory is faster/more preferable than the round-trip time for one packet
|
||||
constexpr size_t BODY_NO_COPY_CUTOFF = 128 * 1024; // ~262 KB or ~175 packets
|
||||
|
||||
// Maximum expected total headers bytes
|
||||
constexpr size_t HEADER_RESERVE_SIZE = 2048;
|
||||
|
||||
const bool do_copy_body = body.size() <= BODY_NO_COPY_CUTOFF;
|
||||
const size_t req_buff_cap = HEADER_RESERVE_SIZE + (do_copy_body ? body.size() : 0);
|
||||
|
||||
std::string req_buff{};
|
||||
req_buff.reserve(2048);
|
||||
req_buff.reserve(req_buff_cap);
|
||||
req_buff.append(method.data(), method.size()).append(" ").append(uri.data(), uri.size()).append(" HTTP/1.1\r\n");
|
||||
add_field(req_buff, "Host", m_host_buff);
|
||||
add_field(req_buff, "Content-Length", std::to_string(body.size()));
|
||||
@@ -255,9 +265,7 @@ namespace net_utils
|
||||
for(const auto& field : additional_params)
|
||||
add_field(req_buff, field);
|
||||
|
||||
for (unsigned sends = 0; sends < 2; ++sends)
|
||||
{
|
||||
const std::size_t initial_size = req_buff.size();
|
||||
const auto auth = m_auth.get_auth_field(method, uri);
|
||||
if (auth)
|
||||
add_field(req_buff, *auth);
|
||||
@@ -265,11 +273,21 @@ namespace net_utils
|
||||
req_buff += "\r\n";
|
||||
//--
|
||||
|
||||
bool res = m_net_client.send(req_buff, timeout);
|
||||
CHECK_AND_ASSERT_MES(res, false, "HTTP_CLIENT: Failed to SEND");
|
||||
if(body.size())
|
||||
if (do_copy_body) // small body
|
||||
{
|
||||
// Copy headers + body together and potentially send one fewer packet
|
||||
req_buff.append(body.data(), body.size());
|
||||
const bool res = m_net_client.send(req_buff, timeout);
|
||||
CHECK_AND_ASSERT_MES(res, false, "HTTP_CLIENT: Failed to SEND");
|
||||
}
|
||||
else // large body
|
||||
{
|
||||
// Send headers and body seperately to avoid copying heavy body message
|
||||
bool res = m_net_client.send(req_buff, timeout);
|
||||
CHECK_AND_ASSERT_MES(res, false, "HTTP_CLIENT: Failed to SEND");
|
||||
res = m_net_client.send(body, timeout);
|
||||
CHECK_AND_ASSERT_MES(res, false, "HTTP_CLIENT: Failed to SEND");
|
||||
CHECK_AND_ASSERT_MES(res, false, "HTTP_CLIENT: Failed to SEND");
|
||||
}
|
||||
|
||||
m_response_info.clear();
|
||||
m_state = reciev_machine_state_header;
|
||||
@@ -282,19 +300,11 @@ namespace net_utils
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (m_auth.handle_401(m_response_info))
|
||||
if (m_auth.handle_401(m_response_info) == http_client_auth::kParseFailure)
|
||||
{
|
||||
case http_client_auth::kSuccess:
|
||||
break;
|
||||
case http_client_auth::kBadPassword:
|
||||
sends = 2;
|
||||
break;
|
||||
default:
|
||||
case http_client_auth::kParseFailure:
|
||||
LOG_ERROR("Bad server response for authentication");
|
||||
return false;
|
||||
}
|
||||
req_buff.resize(initial_size); // rollback for new auth generation
|
||||
}
|
||||
LOG_ERROR("Client has incorrect username/password for server requiring authentication");
|
||||
return false;
|
||||
|
||||
@@ -27,64 +27,37 @@
|
||||
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
set(EPEE_INCLUDE_DIR_BASE "${CMAKE_CURRENT_SOURCE_DIR}/../include")
|
||||
file(GLOB EPEE_HEADERS_PUBLIC "${EPEE_INCLUDE_DIR_BASE}/*.h")
|
||||
|
||||
# Add headers to the file list, to be able to search for them and autosave in IDEs.
|
||||
monero_find_all_headers(EPEE_HEADERS_PUBLIC "${EPEE_INCLUDE_DIR_BASE}")
|
||||
|
||||
monero_add_library(epee byte_slice.cpp byte_stream.cpp hex.cpp abstract_http_client.cpp http_auth.cpp mlog.cpp net_helper.cpp net_utils_base.cpp string_tools.cpp parserse_base_utils.cpp
|
||||
wipeable_string.cpp levin_base.cpp memwipe.c connection_basic.cpp network_throttle.cpp network_throttle-detail.cpp mlocker.cpp buffer.cpp net_ssl.cpp
|
||||
int-util.cpp portable_storage.cpp
|
||||
misc_language.cpp
|
||||
file_io_utils.cpp
|
||||
net_parse_helpers.cpp
|
||||
http_base.cpp
|
||||
${EPEE_HEADERS_PUBLIC}
|
||||
file(GLOB EPEE_SOURCES
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/*.c"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/*.cpp"
|
||||
)
|
||||
|
||||
if (USE_READLINE AND (GNU_READLINE_FOUND OR (DEPENDS AND NOT MINGW)))
|
||||
monero_add_library(epee_readline readline_buffer.cpp)
|
||||
endif()
|
||||
add_library(epee)
|
||||
target_sources(epee
|
||||
PRIVATE
|
||||
${EPEE_SOURCES}
|
||||
)
|
||||
|
||||
set_property(SOURCE memwipe.c PROPERTY C_STANDARD 11)
|
||||
|
||||
# Build and install libepee if we're building for GUI
|
||||
if (BUILD_GUI_DEPS)
|
||||
if(IOS)
|
||||
set(lib_folder lib-${ARCH})
|
||||
else()
|
||||
set(lib_folder lib)
|
||||
endif()
|
||||
install(TARGETS epee
|
||||
ARCHIVE DESTINATION ${lib_folder})
|
||||
if (USE_READLINE AND GNU_READLINE_FOUND)
|
||||
install(TARGETS epee_readline
|
||||
ARCHIVE DESTINATION ${lib_folder})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
target_link_libraries(epee
|
||||
PUBLIC
|
||||
easylogging
|
||||
${Boost_CHRONO_LIBRARY}
|
||||
${Boost_FILESYSTEM_LIBRARY}
|
||||
${Boost_THREAD_LIBRARY}
|
||||
${Boost_REGEX_LIBRARY}
|
||||
${Boost_SYSTEM_LIBRARY}
|
||||
${OPENSSL_LIBRARIES}
|
||||
PRIVATE
|
||||
${EXTRA_LIBRARIES})
|
||||
|
||||
if (USE_READLINE AND (GNU_READLINE_FOUND OR (DEPENDS AND NOT MINGW)))
|
||||
target_link_libraries(epee_readline
|
||||
PUBLIC
|
||||
easylogging
|
||||
${Boost_SYSTEM_LIBRARY}
|
||||
PRIVATE
|
||||
${GNU_READLINE_LIBRARY})
|
||||
endif()
|
||||
Boost::chrono
|
||||
Boost::filesystem
|
||||
Boost::thread
|
||||
Boost::regex
|
||||
Boost::system
|
||||
OpenSSL::SSL)
|
||||
|
||||
target_include_directories(epee
|
||||
PUBLIC
|
||||
"${EPEE_INCLUDE_DIR_BASE}"
|
||||
"${OPENSSL_INCLUDE_DIR}")
|
||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/epee/>)
|
||||
|
||||
install(DIRECTORY ${EPEE_INCLUDE_DIR_BASE}/
|
||||
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/monero/epee/")
|
||||
|
||||
monero_install_library(epee)
|
||||
44
external/CMakeLists.txt
vendored
44
external/CMakeLists.txt
vendored
@@ -28,45 +28,11 @@
|
||||
#
|
||||
# Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers
|
||||
|
||||
|
||||
# This is broken up into two parts: first we check for miniupnp, compile it if we can't
|
||||
# find it, and thereafter we check for libunbound, and compile it if we can't find it.
|
||||
# We always compile if we are building statically to reduce static dependency issues...
|
||||
# ...except for FreeBSD, because FreeBSD is a special case that doesn't play well with
|
||||
# others.
|
||||
|
||||
find_package(Miniupnpc REQUIRED)
|
||||
|
||||
message(STATUS "Using in-tree miniupnpc")
|
||||
set(UPNPC_NO_INSTALL TRUE CACHE BOOL "Disable miniupnp installation" FORCE)
|
||||
add_subdirectory(miniupnp/miniupnpc)
|
||||
set_property(TARGET libminiupnpc-static PROPERTY FOLDER "external")
|
||||
set_property(TARGET libminiupnpc-static PROPERTY POSITION_INDEPENDENT_CODE ON)
|
||||
if(MSVC)
|
||||
set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -wd4244 -wd4267")
|
||||
elseif(NOT MSVC)
|
||||
set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-undef -Wno-unused-result -Wno-unused-value")
|
||||
endif()
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "NetBSD")
|
||||
set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -D_NETBSD_SOURCE")
|
||||
endif()
|
||||
|
||||
set(UPNP_LIBRARIES "libminiupnpc-static" PARENT_SCOPE)
|
||||
|
||||
find_package(Unbound)
|
||||
|
||||
if(NOT UNBOUND_INCLUDE_DIR)
|
||||
die("Could not find libunbound")
|
||||
else()
|
||||
message(STATUS "Found libunbound include (unbound.h) in ${UNBOUND_INCLUDE_DIR}")
|
||||
if(UNBOUND_LIBRARIES)
|
||||
message(STATUS "Found libunbound library")
|
||||
else()
|
||||
die("Found libunbound includes, but could not find libunbound library. Please make sure you have installed libunbound or libunbound-dev or the equivalent")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_subdirectory(db_drivers)
|
||||
add_subdirectory(easylogging++)
|
||||
add_subdirectory(qrcodegen)
|
||||
add_subdirectory(randomwow EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(randomwow)
|
||||
add_subdirectory(supercop)
|
||||
|
||||
install(DIRECTORY boost
|
||||
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/monero/")
|
||||
56
external/db_drivers/liblmdb/CMakeLists.txt
vendored
56
external/db_drivers/liblmdb/CMakeLists.txt
vendored
@@ -26,40 +26,40 @@
|
||||
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
||||
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
set(lmdb_sources
|
||||
mdb.c
|
||||
midl.c)
|
||||
|
||||
add_library(lmdb)
|
||||
target_sources(lmdb PRIVATE ${lmdb_sources})
|
||||
|
||||
target_include_directories(lmdb
|
||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/>
|
||||
)
|
||||
|
||||
target_link_libraries(lmdb PRIVATE Threads::Threads)
|
||||
|
||||
if(FREEBSD)
|
||||
add_definitions(-DMDB_DSYNC=O_SYNC)
|
||||
target_compile_definitions(lmdb PUBLIC MDB_DSYNC=O_SYNC)
|
||||
endif()
|
||||
|
||||
if(ANDROID)
|
||||
add_definitions("-DANDROID=1")
|
||||
target_compile_definitions(lmdb PUBLIC ANDROID=1)
|
||||
endif()
|
||||
|
||||
|
||||
set (lmdb_sources
|
||||
mdb.c
|
||||
midl.c)
|
||||
|
||||
include_directories("${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
|
||||
add_library(lmdb
|
||||
${lmdb_sources})
|
||||
target_link_libraries(lmdb
|
||||
PRIVATE
|
||||
${CMAKE_THREAD_LIBS_INIT})
|
||||
if(${ARCH_WIDTH} EQUAL 32)
|
||||
target_compile_definitions(lmdb
|
||||
PUBLIC -DMDB_VL32)
|
||||
target_compile_definitions(lmdb PUBLIC MDB_VL32=1)
|
||||
endif()
|
||||
|
||||
# GUI/libwallet install target
|
||||
if (BUILD_GUI_DEPS)
|
||||
if(IOS)
|
||||
set(lib_folder lib-${ARCH})
|
||||
else()
|
||||
set(lib_folder lib)
|
||||
endif()
|
||||
install(TARGETS lmdb
|
||||
ARCHIVE DESTINATION ${lib_folder}
|
||||
LIBRARY DESTINATION ${lib_folder})
|
||||
endif()
|
||||
set_property(TARGET lmdb APPEND PROPERTY COMPILE_FLAGS "-fPIC")
|
||||
set_target_properties(lmdb PROPERTIES
|
||||
POSITION_INDEPENDENT_CODE ON
|
||||
CXX_STANDARD 11
|
||||
CXX_STANDARD_REQUIRED ON
|
||||
)
|
||||
|
||||
monero_install_library(lmdb
|
||||
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/monero/lmdb/"
|
||||
HEADERS "midl.h;lmdb.h")
|
||||
56
external/easylogging++/CMakeLists.txt
vendored
56
external/easylogging++/CMakeLists.txt
vendored
@@ -26,43 +26,31 @@
|
||||
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
||||
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
set(EL_HEADERS
|
||||
easylogging++.h
|
||||
ea_config.h)
|
||||
|
||||
project(easylogging CXX)
|
||||
add_library(easylogging)
|
||||
target_sources(easylogging
|
||||
PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/easylogging++.cc
|
||||
)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
target_compile_definitions(easylogging PUBLIC
|
||||
AUTO_INITIALIZE_EASYLOGGINGPP
|
||||
)
|
||||
|
||||
monero_enable_coverage()
|
||||
target_include_directories(easylogging
|
||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/easylogging++/>
|
||||
)
|
||||
|
||||
find_package(Threads)
|
||||
find_package(Backtrace)
|
||||
|
||||
monero_find_all_headers(EASYLOGGING_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
|
||||
add_library(easylogging
|
||||
easylogging++.cc
|
||||
${EASYLOGGING_HEADERS}
|
||||
)
|
||||
|
||||
include_directories("${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
include_directories("${CMAKE_CURRENT_BINARY_DIR}")
|
||||
target_link_libraries(easylogging
|
||||
PRIVATE
|
||||
${CMAKE_THREAD_LIBS_INIT}
|
||||
${Backtrace_LIBRARIES})
|
||||
|
||||
# GUI/libwallet install target
|
||||
if (BUILD_GUI_DEPS)
|
||||
if(IOS)
|
||||
set(lib_folder lib-${ARCH})
|
||||
else()
|
||||
set(lib_folder lib)
|
||||
endif()
|
||||
install(TARGETS easylogging
|
||||
ARCHIVE DESTINATION ${lib_folder}
|
||||
LIBRARY DESTINATION ${lib_folder})
|
||||
endif()
|
||||
set_property(TARGET easylogging APPEND PROPERTY COMPILE_FLAGS "-fPIC")
|
||||
PRIVATE
|
||||
Threads::Threads
|
||||
${Backtrace_LIBRARIES})
|
||||
|
||||
monero_install_library(easylogging
|
||||
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/monero/easylogging++/"
|
||||
HEADERS ${EL_HEADERS})
|
||||
|
||||
1
external/miniupnp
vendored
1
external/miniupnp
vendored
Submodule external/miniupnp deleted from 544e6fcc73
20
external/qrcodegen/CMakeLists.txt
vendored
20
external/qrcodegen/CMakeLists.txt
vendored
@@ -1,8 +1,16 @@
|
||||
project(libqrcodegen)
|
||||
add_library(qrcodegen)
|
||||
|
||||
add_library(qrcodegen STATIC QrCode.cpp)
|
||||
set_target_properties(qrcodegen PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
||||
set_target_properties(qrcodegen PROPERTIES CXX_STANDARD 11)
|
||||
target_sources(qrcodegen
|
||||
PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/QrCode.cpp
|
||||
)
|
||||
|
||||
target_include_directories(qrcodegen PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_include_directories(qrcodegen
|
||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/>
|
||||
)
|
||||
|
||||
monero_install_library(qrcodegen
|
||||
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/monero/qrcodegen/"
|
||||
HEADERS QrCode.hpp)
|
||||
|
||||
2
external/randomwow
vendored
2
external/randomwow
vendored
Submodule external/randomwow updated: 607bad48f3...bb4ed329c7
1
external/rapidjson
vendored
1
external/rapidjson
vendored
Submodule external/rapidjson deleted from 129d19ba7f
2
external/supercop
vendored
2
external/supercop
vendored
Submodule external/supercop updated: 633500ad8c...036511a8bd
@@ -28,60 +28,23 @@
|
||||
#
|
||||
# Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers
|
||||
|
||||
if (WIN32 OR STATIC)
|
||||
add_definitions(-DSTATICLIB)
|
||||
# miniupnp changed their static define
|
||||
add_definitions(-DMINIUPNP_STATICLIB)
|
||||
endif ()
|
||||
|
||||
function (monero_private_headers group)
|
||||
source_group("${group}\\Private"
|
||||
FILES
|
||||
${ARGN})
|
||||
endfunction ()
|
||||
|
||||
function (monero_install_headers subdir)
|
||||
install(
|
||||
FILES ${ARGN}
|
||||
DESTINATION "include/${subdir}"
|
||||
COMPONENT development)
|
||||
endfunction ()
|
||||
|
||||
function (enable_stack_trace target)
|
||||
if(STACK_TRACE)
|
||||
set_property(TARGET ${target}
|
||||
APPEND PROPERTY COMPILE_DEFINITIONS "STACK_TRACE")
|
||||
if (STATIC)
|
||||
set_property(TARGET "${target}"
|
||||
APPEND PROPERTY LINK_FLAGS "-Wl,--wrap=__cxa_throw")
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function (monero_add_executable name)
|
||||
source_group("${name}"
|
||||
FILES
|
||||
${ARGN})
|
||||
|
||||
add_executable("${name}"
|
||||
${ARGN})
|
||||
target_link_libraries("${name}"
|
||||
PRIVATE
|
||||
${EXTRA_LIBRARIES})
|
||||
set_property(TARGET "${name}"
|
||||
PROPERTY
|
||||
FOLDER "prog")
|
||||
set_property(TARGET "${name}"
|
||||
PROPERTY
|
||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
|
||||
enable_stack_trace("${name}")
|
||||
|
||||
monero_set_target_no_relink("${name}")
|
||||
monero_set_target_strip ("${name}")
|
||||
endfunction ()
|
||||
|
||||
include(Version)
|
||||
monero_add_library(version SOURCES ${CMAKE_BINARY_DIR}/version.cpp DEPENDS genversion)
|
||||
add_library(version)
|
||||
target_sources(version
|
||||
PRIVATE
|
||||
${CMAKE_BINARY_DIR}/version.cpp
|
||||
)
|
||||
|
||||
target_include_directories(version
|
||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/external>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/>
|
||||
)
|
||||
|
||||
monero_install_library(version
|
||||
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/monero/"
|
||||
HEADERS version.h)
|
||||
|
||||
add_subdirectory(common)
|
||||
add_subdirectory(crypto)
|
||||
@@ -96,6 +59,7 @@ add_subdirectory(hardforks)
|
||||
add_subdirectory(blockchain_db)
|
||||
add_subdirectory(mnemonics)
|
||||
add_subdirectory(rpc)
|
||||
#add_subdirectory(test)
|
||||
if(NOT IOS)
|
||||
add_subdirectory(serialization)
|
||||
endif()
|
||||
@@ -110,16 +74,11 @@ if(NOT IOS)
|
||||
add_subdirectory(daemon)
|
||||
endif()
|
||||
|
||||
if(BUILD_DEBUG_UTILITIES)
|
||||
add_subdirectory(debug_utilities)
|
||||
add_subdirectory(blockchain_utilities)
|
||||
add_subdirectory(gen_multisig)
|
||||
add_subdirectory(gen_ssl_cert)
|
||||
endif()
|
||||
|
||||
if(PER_BLOCK_CHECKPOINT)
|
||||
add_subdirectory(blocks)
|
||||
endif()
|
||||
|
||||
add_subdirectory(device)
|
||||
add_subdirectory(device_trezor)
|
||||
|
||||
install(FILES cryptonote_config.h
|
||||
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/monero/")
|
||||
@@ -26,28 +26,38 @@
|
||||
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
||||
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
set(blockchain_db_sources
|
||||
blockchain_db.cpp
|
||||
lmdb/db_lmdb.cpp
|
||||
)
|
||||
file(GLOB BCDB_SOURCES *.cpp *.c *.cc)
|
||||
list(APPEND BCDB_SOURCES lmdb/db_lmdb.cpp)
|
||||
|
||||
set(blockchain_db_headers)
|
||||
set(BCDB_HEADERS
|
||||
blockchain_db.h
|
||||
locked_txn.h
|
||||
testdb.h
|
||||
lmdb/db_lmdb.h)
|
||||
|
||||
monero_find_all_headers(blockchain_db_private_headers "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
message(STATUS "${BCDB_HEADERS}")
|
||||
|
||||
monero_private_headers(blockchain_db
|
||||
${crypto_private_headers})
|
||||
monero_add_library(blockchain_db
|
||||
${blockchain_db_sources}
|
||||
${blockchain_db_headers}
|
||||
${blockchain_db_private_headers})
|
||||
add_library(blockchain_db)
|
||||
target_sources(blockchain_db
|
||||
PRIVATE
|
||||
${BCDB_SOURCES}
|
||||
)
|
||||
target_link_libraries(blockchain_db
|
||||
PUBLIC
|
||||
common
|
||||
cncrypto
|
||||
ringct
|
||||
${LMDB_LIBRARY}
|
||||
${Boost_FILESYSTEM_LIBRARY}
|
||||
${Boost_THREAD_LIBRARY}
|
||||
PRIVATE
|
||||
${EXTRA_LIBRARIES})
|
||||
lmdb
|
||||
Boost::filesystem
|
||||
Boost::thread)
|
||||
|
||||
target_include_directories(blockchain_db
|
||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../>
|
||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/external>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/>
|
||||
)
|
||||
|
||||
monero_install_library(blockchain_db
|
||||
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/blockchain_db/"
|
||||
HEADERS ${BCDB_HEADERS})
|
||||
@@ -158,7 +158,7 @@ endif()
|
||||
set_property(TARGET blockchain_import
|
||||
PROPERTY
|
||||
OUTPUT_NAME "wownero-blockchain-import")
|
||||
install(TARGETS blockchain_import DESTINATION bin)
|
||||
install(TARGETS blockchain_import DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
|
||||
monero_add_executable(blockchain_export
|
||||
${blockchain_export_sources}
|
||||
@@ -179,7 +179,7 @@ target_link_libraries(blockchain_export
|
||||
set_property(TARGET blockchain_export
|
||||
PROPERTY
|
||||
OUTPUT_NAME "wownero-blockchain-export")
|
||||
install(TARGETS blockchain_export DESTINATION bin)
|
||||
install(TARGETS blockchain_export DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
|
||||
monero_add_executable(blockchain_blackball
|
||||
${blockchain_blackball_sources}
|
||||
@@ -201,7 +201,7 @@ target_link_libraries(blockchain_blackball
|
||||
set_property(TARGET blockchain_blackball
|
||||
PROPERTY
|
||||
OUTPUT_NAME "wownero-blockchain-mark-spent-outputs")
|
||||
install(TARGETS blockchain_blackball DESTINATION bin)
|
||||
install(TARGETS blockchain_blackball DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
|
||||
|
||||
monero_add_executable(blockchain_usage
|
||||
@@ -223,7 +223,7 @@ target_link_libraries(blockchain_usage
|
||||
set_property(TARGET blockchain_usage
|
||||
PROPERTY
|
||||
OUTPUT_NAME "wownero-blockchain-usage")
|
||||
install(TARGETS blockchain_usage DESTINATION bin)
|
||||
install(TARGETS blockchain_usage DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
|
||||
monero_add_executable(blockchain_ancestry
|
||||
${blockchain_ancestry_sources}
|
||||
@@ -244,7 +244,7 @@ target_link_libraries(blockchain_ancestry
|
||||
set_property(TARGET blockchain_ancestry
|
||||
PROPERTY
|
||||
OUTPUT_NAME "wownero-blockchain-ancestry")
|
||||
install(TARGETS blockchain_ancestry DESTINATION bin)
|
||||
install(TARGETS blockchain_ancestry DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
|
||||
monero_add_executable(blockchain_depth
|
||||
${blockchain_depth_sources}
|
||||
@@ -265,7 +265,7 @@ target_link_libraries(blockchain_depth
|
||||
set_property(TARGET blockchain_depth
|
||||
PROPERTY
|
||||
OUTPUT_NAME "wownero-blockchain-depth")
|
||||
install(TARGETS blockchain_depth DESTINATION bin)
|
||||
install(TARGETS blockchain_depth DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
|
||||
monero_add_executable(blockchain_stats
|
||||
${blockchain_stats_sources}
|
||||
@@ -286,7 +286,7 @@ target_link_libraries(blockchain_stats
|
||||
set_property(TARGET blockchain_stats
|
||||
PROPERTY
|
||||
OUTPUT_NAME "wownero-blockchain-stats")
|
||||
install(TARGETS blockchain_stats DESTINATION bin)
|
||||
install(TARGETS blockchain_stats DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
|
||||
monero_add_executable(blockchain_prune_known_spent_data
|
||||
${blockchain_prune_known_spent_data_sources}
|
||||
@@ -308,7 +308,7 @@ target_link_libraries(blockchain_prune_known_spent_data
|
||||
set_property(TARGET blockchain_prune_known_spent_data
|
||||
PROPERTY
|
||||
OUTPUT_NAME "wownero-blockchain-prune-known-spent-data")
|
||||
install(TARGETS blockchain_prune_known_spent_data DESTINATION bin)
|
||||
install(TARGETS blockchain_prune_known_spent_data DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
|
||||
monero_add_executable(blockchain_prune
|
||||
${blockchain_prune_sources}
|
||||
@@ -317,7 +317,7 @@ monero_add_executable(blockchain_prune
|
||||
set_property(TARGET blockchain_prune
|
||||
PROPERTY
|
||||
OUTPUT_NAME "wownero-blockchain-prune")
|
||||
install(TARGETS blockchain_prune DESTINATION bin)
|
||||
install(TARGETS blockchain_prune DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
|
||||
target_link_libraries(blockchain_prune
|
||||
PRIVATE
|
||||
|
||||
@@ -57,4 +57,20 @@ foreach(BLOB_NAME checkpoints)
|
||||
)
|
||||
endforeach()
|
||||
|
||||
monero_add_library(blocks blocks.cpp ${GENERATED_SOURCES})
|
||||
add_library(blocks)
|
||||
target_sources(blocks
|
||||
PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/blocks.cpp
|
||||
${GENERATED_SOURCES}
|
||||
)
|
||||
|
||||
target_include_directories(blocks
|
||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
|
||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/contrib/epee/include>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/>
|
||||
)
|
||||
|
||||
monero_install_library(blocks
|
||||
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/blocks/"
|
||||
HEADERS blocks.h)
|
||||
@@ -26,38 +26,28 @@
|
||||
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
||||
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
if(APPLE)
|
||||
if(DEPENDS)
|
||||
list(APPEND EXTRA_LIBRARIES "-framework Foundation -framework ApplicationServices -framework AppKit -framework IOKit")
|
||||
else()
|
||||
find_library(IOKIT_LIBRARY IOKit)
|
||||
mark_as_advanced(IOKIT_LIBRARY)
|
||||
list(APPEND EXTRA_LIBRARIES ${IOKIT_LIBRARY})
|
||||
endif()
|
||||
endif()
|
||||
add_library(checkpoints)
|
||||
target_sources(checkpoints
|
||||
PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/checkpoints.cpp
|
||||
)
|
||||
|
||||
set(checkpoints_sources
|
||||
checkpoints.cpp)
|
||||
|
||||
set(checkpoints_headers)
|
||||
|
||||
monero_find_all_headers(checkpoints_private_headers "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
|
||||
monero_private_headers(checkpoints
|
||||
${checkpoints_private_headers})
|
||||
monero_add_library(checkpoints
|
||||
${checkpoints_sources}
|
||||
${checkpoints_headers}
|
||||
${checkpoints_private_headers})
|
||||
target_link_libraries(checkpoints
|
||||
PUBLIC
|
||||
target_link_libraries(checkpoints PUBLIC
|
||||
common
|
||||
cncrypto
|
||||
${Boost_DATE_TIME_LIBRARY}
|
||||
${Boost_PROGRAM_OPTIONS_LIBRARY}
|
||||
${Boost_SERIALIZATION_LIBRARY}
|
||||
${Boost_FILESYSTEM_LIBRARY}
|
||||
${Boost_SYSTEM_LIBRARY}
|
||||
${Boost_THREAD_LIBRARY}
|
||||
PRIVATE
|
||||
${EXTRA_LIBRARIES})
|
||||
Boost::date_time
|
||||
Boost::program_options
|
||||
Boost::serialization
|
||||
Boost::filesystem
|
||||
Boost::system
|
||||
Boost::thread)
|
||||
|
||||
target_include_directories(checkpoints
|
||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/>
|
||||
)
|
||||
|
||||
monero_install_library(checkpoints
|
||||
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/checkpoints/"
|
||||
HEADERS checkpoints.h)
|
||||
@@ -26,61 +26,77 @@
|
||||
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
||||
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
include_directories(SYSTEM ${OPENSSL_INCLUDE_DIR})
|
||||
file(GLOB COMMON_SOURCES "*.cpp" "*.c")
|
||||
set(COMMON_HEADERS
|
||||
aligned.h
|
||||
apply_permutation.h
|
||||
base58.h
|
||||
boost_serialization_helper.h
|
||||
combinator.h
|
||||
command_line.h
|
||||
common_fwd.h
|
||||
data_cache.h
|
||||
dns_utils.h
|
||||
download.h
|
||||
error.h
|
||||
expect.h
|
||||
http_connection.h
|
||||
i18n.h
|
||||
json_util.h
|
||||
notify.h
|
||||
password.h
|
||||
perf_timer.h
|
||||
pod-class.h
|
||||
powerof.h
|
||||
pruning.h
|
||||
rpc_client.h
|
||||
scoped_message_writer.h
|
||||
sfinae_helpers.h
|
||||
spawn.h
|
||||
stack_trace.h
|
||||
threadpool.h
|
||||
timings.h
|
||||
unordered_containers_boost_serialization.h
|
||||
updates.h
|
||||
utf8.h
|
||||
util.h
|
||||
varint.h)
|
||||
|
||||
set(common_sources
|
||||
base58.cpp
|
||||
command_line.cpp
|
||||
dns_utils.cpp
|
||||
download.cpp
|
||||
error.cpp
|
||||
expect.cpp
|
||||
util.cpp
|
||||
i18n.cpp
|
||||
notify.cpp
|
||||
password.cpp
|
||||
perf_timer.cpp
|
||||
pruning.cpp
|
||||
spawn.cpp
|
||||
threadpool.cpp
|
||||
updates.cpp
|
||||
aligned.c
|
||||
timings.cc
|
||||
combinator.cpp)
|
||||
add_library(common)
|
||||
target_sources(common
|
||||
PRIVATE
|
||||
${COMMON_SOURCES}
|
||||
)
|
||||
|
||||
if (STACK_TRACE)
|
||||
list(APPEND common_sources stack_trace.cpp)
|
||||
endif()
|
||||
|
||||
if (BACKCOMPAT)
|
||||
list(APPEND common_sources compat/glibc_compat.cpp)
|
||||
endif()
|
||||
|
||||
set(common_headers)
|
||||
|
||||
monero_find_all_headers(common_private_headers "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
|
||||
monero_private_headers(common
|
||||
${common_private_headers})
|
||||
monero_add_library(common
|
||||
${common_sources}
|
||||
${common_headers}
|
||||
${common_private_headers}
|
||||
DEPENDS generate_translations_header)
|
||||
target_link_libraries(common
|
||||
PUBLIC
|
||||
cncrypto
|
||||
${UNBOUND_LIBRARIES}
|
||||
${LIBUNWIND_LIBRARIES}
|
||||
${Boost_DATE_TIME_LIBRARY}
|
||||
${Boost_FILESYSTEM_LIBRARY}
|
||||
${Boost_SYSTEM_LIBRARY}
|
||||
${Boost_THREAD_LIBRARY}
|
||||
${Boost_REGEX_LIBRARY}
|
||||
${Boost_CHRONO_LIBRARY}
|
||||
easylogging
|
||||
Libunbound::Libunbound
|
||||
Boost::chrono
|
||||
Boost::date_time
|
||||
Boost::filesystem
|
||||
Boost::thread
|
||||
Boost::regex
|
||||
Boost::system
|
||||
PRIVATE
|
||||
${OPENSSL_LIBRARIES}
|
||||
${EXTRA_LIBRARIES})
|
||||
OpenSSL::SSL
|
||||
OpenSSL::Crypto)
|
||||
|
||||
#monero_install_headers(common
|
||||
# ${common_headers})
|
||||
target_include_directories(common
|
||||
PRIVATE ${LIBUNBOUND_INCLUDE_DIR}
|
||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../>
|
||||
PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/translations>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/>
|
||||
)
|
||||
|
||||
if(STATIC)
|
||||
target_compile_definitions(common PUBLIC STATICLIB=1)
|
||||
endif()
|
||||
|
||||
add_dependencies(common generate_translations_header)
|
||||
|
||||
monero_install_library(common
|
||||
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/monero/common/"
|
||||
HEADERS ${COMMON_HEADERS})
|
||||
@@ -1,98 +0,0 @@
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <strings.h>
|
||||
#include <string.h>
|
||||
#include <glob.h>
|
||||
#include <unistd.h>
|
||||
#include <fnmatch.h>
|
||||
|
||||
#if defined(HAVE_SYS_SELECT_H)
|
||||
#include <sys/select.h>
|
||||
#endif
|
||||
|
||||
// Prior to GLIBC_2.14, memcpy was aliased to memmove.
|
||||
extern "C" void* memmove(void* a, const void* b, size_t c);
|
||||
//extern "C" void* memset(void* a, int b, long unsigned int c);
|
||||
extern "C" void* memcpy(void* a, const void* b, size_t c)
|
||||
{
|
||||
return memmove(a, b, c);
|
||||
}
|
||||
|
||||
extern "C" void __chk_fail(void) __attribute__((__noreturn__));
|
||||
|
||||
#if defined(__i386__) || defined(__arm__)
|
||||
|
||||
extern "C" int64_t __udivmoddi4(uint64_t u, uint64_t v, uint64_t* rp);
|
||||
|
||||
extern "C" int64_t __wrap___divmoddi4(int64_t u, int64_t v, int64_t* rp)
|
||||
{
|
||||
int32_t c1 = 0, c2 = 0;
|
||||
int64_t uu = u, vv = v;
|
||||
int64_t w;
|
||||
int64_t r;
|
||||
|
||||
if (uu < 0) {
|
||||
c1 = ~c1, c2 = ~c2, uu = -uu;
|
||||
}
|
||||
if (vv < 0) {
|
||||
c1 = ~c1, vv = -vv;
|
||||
}
|
||||
|
||||
w = __udivmoddi4(uu, vv, (uint64_t*)&r);
|
||||
if (c1)
|
||||
w = -w;
|
||||
if (c2)
|
||||
r = -r;
|
||||
|
||||
*rp = r;
|
||||
return w;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* glibc-internal users use __explicit_bzero_chk, and explicit_bzero
|
||||
redirects to that. */
|
||||
#undef explicit_bzero
|
||||
/* Set LEN bytes of S to 0. The compiler will not delete a call to
|
||||
this function, even if S is dead after the call. */
|
||||
void
|
||||
explicit_bzero (void *s, size_t len)
|
||||
{
|
||||
memset (s, '\0', len);
|
||||
/* Compiler barrier. */
|
||||
asm volatile ("" ::: "memory");
|
||||
}
|
||||
|
||||
// Redefine explicit_bzero_chk
|
||||
void
|
||||
__explicit_bzero_chk (void *dst, size_t len, size_t dstlen)
|
||||
{
|
||||
/* Inline __memset_chk to avoid a PLT reference to __memset_chk. */
|
||||
if (__glibc_unlikely (dstlen < len))
|
||||
__chk_fail ();
|
||||
memset (dst, '\0', len);
|
||||
/* Compiler barrier. */
|
||||
asm volatile ("" ::: "memory");
|
||||
}
|
||||
/* libc-internal references use the hidden
|
||||
__explicit_bzero_chk_internal symbol. This is necessary if
|
||||
__explicit_bzero_chk is implemented as an IFUNC because some
|
||||
targets do not support hidden references to IFUNC symbols. */
|
||||
#define strong_alias (__explicit_bzero_chk, __explicit_bzero_chk_internal)
|
||||
|
||||
#undef glob
|
||||
extern "C" int glob_old(const char * pattern, int flags, int (*errfunc) (const char *epath, int eerrno), glob_t *pglob);
|
||||
#ifdef __i386__
|
||||
__asm__(".symver glob_old,glob@GLIBC_2.0");
|
||||
#elif defined(__amd64__)
|
||||
__asm__(".symver glob_old,glob@GLIBC_2.2.5");
|
||||
#elif defined(__arm__)
|
||||
__asm(".symver glob_old,glob@GLIBC_2.4");
|
||||
#elif defined(__aarch64__)
|
||||
__asm__(".symver glob_old,glob@GLIBC_2.17");
|
||||
#endif
|
||||
|
||||
extern "C" int __wrap_glob(const char * pattern, int flags, int (*errfunc) (const char *epath, int eerrno), glob_t *pglob)
|
||||
{
|
||||
return glob_old(pattern, flags, errfunc, pglob);
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#else
|
||||
#define ELPP_FEATURE_CRASH_LOG 1
|
||||
#endif
|
||||
#include "easylogging++/easylogging++.h"
|
||||
#include "easylogging++.h"
|
||||
|
||||
#include <stdexcept>
|
||||
#ifdef USE_UNWIND
|
||||
|
||||
@@ -27,76 +27,104 @@
|
||||
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
set(crypto_sources
|
||||
aesb.c
|
||||
blake256.c
|
||||
chacha.c
|
||||
crypto-ops-data.c
|
||||
crypto-ops.c
|
||||
crypto.cpp
|
||||
groestl.c
|
||||
hash-extra-blake.c
|
||||
hash-extra-groestl.c
|
||||
hash-extra-jh.c
|
||||
hash-extra-skein.c
|
||||
hash.c
|
||||
hmac-keccak.c
|
||||
jh.c
|
||||
keccak.c
|
||||
oaes_lib.c
|
||||
random.c
|
||||
skein.c
|
||||
slow-hash.c
|
||||
rx-slow-hash.c
|
||||
CryptonightR_JIT.c
|
||||
tree-hash.c)
|
||||
aesb.c
|
||||
blake256.c
|
||||
chacha.c
|
||||
crypto-ops-data.c
|
||||
crypto-ops.c
|
||||
crypto.cpp
|
||||
groestl.c
|
||||
hash-extra-blake.c
|
||||
hash-extra-groestl.c
|
||||
hash-extra-jh.c
|
||||
hash-extra-skein.c
|
||||
hash.c
|
||||
hmac-keccak.c
|
||||
jh.c
|
||||
keccak.c
|
||||
oaes_lib.c
|
||||
random.c
|
||||
skein.c
|
||||
slow-hash.c
|
||||
rx-slow-hash.c
|
||||
CryptonightR_JIT.c
|
||||
tree-hash.c)
|
||||
|
||||
if(ARCH_ID STREQUAL "i386" OR ARCH_ID STREQUAL "x86_64" OR ARCH_ID STREQUAL "x86-64" OR ARCH_ID STREQUAL "amd64")
|
||||
list(APPEND crypto_sources CryptonightR_template.S)
|
||||
set(crypto_headers
|
||||
CryptonightR_JIT.h
|
||||
CryptonightR_template.h
|
||||
blake256.h
|
||||
c_threads.h
|
||||
chacha.h
|
||||
crypto-ops.h
|
||||
crypto.h
|
||||
duration.h
|
||||
generic-ops.h
|
||||
groestl.h
|
||||
groestl_tables.h
|
||||
hash-ops.h
|
||||
hash.h
|
||||
hmac-keccak.h
|
||||
initializer.h
|
||||
jh.h
|
||||
keccak.h
|
||||
oaes_config.h
|
||||
oaes_lib.h
|
||||
random.h
|
||||
skein.h
|
||||
skein_port.h
|
||||
variant2_int_sqrt.h
|
||||
variant4_random_math.h)
|
||||
|
||||
message(STATUS "${crypto_headers}")
|
||||
|
||||
if(NOT ARM)
|
||||
list(APPEND crypto_sources CryptonightR_template.S)
|
||||
endif()
|
||||
|
||||
include_directories(${RANDOMX_INCLUDE})
|
||||
add_library(cncrypto)
|
||||
target_sources(cncrypto
|
||||
PRIVATE
|
||||
${crypto_sources}
|
||||
)
|
||||
|
||||
set(crypto_headers)
|
||||
|
||||
monero_find_all_headers(crypto_private_headers "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
|
||||
monero_private_headers(cncrypto
|
||||
${crypto_private_headers})
|
||||
monero_add_library(cncrypto
|
||||
${crypto_sources}
|
||||
${crypto_headers}
|
||||
${crypto_private_headers})
|
||||
target_link_libraries(cncrypto
|
||||
PUBLIC
|
||||
epee
|
||||
randomx
|
||||
${Boost_SYSTEM_LIBRARY}
|
||||
${SODIUM_LIBRARY}
|
||||
Boost::system
|
||||
${sodium_LIBRARY_RELEASE}
|
||||
PRIVATE
|
||||
${EXTRA_LIBRARIES})
|
||||
OpenSSL::SSL
|
||||
OpenSSL::Crypto)
|
||||
|
||||
if (ARM)
|
||||
option(NO_OPTIMIZED_MULTIPLY_ON_ARM
|
||||
"Compute multiply using generic C implementation instead of ARM ASM" OFF)
|
||||
if(NO_OPTIMIZED_MULTIPLY_ON_ARM)
|
||||
message(STATUS "Using generic C implementation for multiply")
|
||||
set_property(SOURCE slow-hash.c
|
||||
PROPERTY COMPILE_DEFINITIONS "NO_OPTIMIZED_MULTIPLY_ON_ARM")
|
||||
endif()
|
||||
target_include_directories(cncrypto
|
||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/>
|
||||
PUBLIC ${sodium_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
if (ARM AND NO_OPTIMIZED_MULTIPLY_ON_ARM)
|
||||
message(STATUS "Using generic C implementation for multiply")
|
||||
set_property(SOURCE slow-hash.c
|
||||
PROPERTY COMPILE_DEFINITIONS "NO_OPTIMIZED_MULTIPLY_ON_ARM")
|
||||
endif()
|
||||
|
||||
# Because of the way Qt works on android with JNI, the code does not live in the main android thread
|
||||
# So this code runs with a 1 MB default stack size.
|
||||
# This will force the use of the heap for the allocation of the scratchpad
|
||||
if (ANDROID OR IOS)
|
||||
if( BUILD_GUI_DEPS )
|
||||
add_definitions(-DFORCE_USE_HEAP=1)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# cheat because cmake and ccache hate each other
|
||||
set_property(SOURCE CryptonightR_template.S PROPERTY LANGUAGE C)
|
||||
set_property(SOURCE CryptonightR_template.S PROPERTY LANGUAGE ASM)
|
||||
set_property(SOURCE CryptonightR_template.S PROPERTY XCODE_EXPLICIT_FILE_TYPE sourcecode.asm)
|
||||
|
||||
# Must be done last, because it references libraries in this directory
|
||||
add_subdirectory(wallet)
|
||||
|
||||
monero_install_library(cncrypto
|
||||
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/monero/crypto/"
|
||||
HEADERS ${crypto_headers})
|
||||
@@ -61,11 +61,11 @@ static void generate_system_random_bytes(size_t n, void *result) {
|
||||
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
static void generate_system_random_bytes(size_t n, void *result) {
|
||||
int fd;
|
||||
|
||||
@@ -27,37 +27,19 @@
|
||||
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
||||
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#
|
||||
# Possibly user defined values.
|
||||
#
|
||||
set(MONERO_WALLET_CRYPTO_LIBRARY "auto" CACHE STRING "Select a wallet crypto library")
|
||||
include(CheckLanguage)
|
||||
check_language(ASM-ATT)
|
||||
|
||||
#
|
||||
# If the user specified "auto", detect best library defaulting to internal.
|
||||
#
|
||||
if (${MONERO_WALLET_CRYPTO_LIBRARY} STREQUAL "auto")
|
||||
monero_crypto_autodetect(AVAILABLE BEST)
|
||||
if (DEFINED BEST)
|
||||
message("Wallet crypto is using ${BEST} backend")
|
||||
set(MONERO_WALLET_CRYPTO_LIBRARY ${BEST})
|
||||
else ()
|
||||
message("Defaulting to internal crypto library for wallet")
|
||||
set(MONERO_WALLET_CRYPTO_LIBRARY "cn")
|
||||
endif ()
|
||||
endif ()
|
||||
add_library(wallet-crypto crypto.h)
|
||||
|
||||
#
|
||||
# Configure library target "wallet-crypto" - clients will use this as a
|
||||
# library dependency which in turn will depend on the crypto library selected.
|
||||
#
|
||||
if (${MONERO_WALLET_CRYPTO_LIBRARY} STREQUAL "cn")
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/empty.h.in ${MONERO_GENERATED_HEADERS_DIR}/crypto/wallet/ops.h)
|
||||
add_library(wallet-crypto ALIAS cncrypto)
|
||||
else ()
|
||||
monero_crypto_generate_header(${MONERO_WALLET_CRYPTO_LIBRARY} "${MONERO_GENERATED_HEADERS_DIR}/crypto/wallet/ops.h")
|
||||
monero_crypto_get_target(${MONERO_WALLET_CRYPTO_LIBRARY} CRYPTO_TARGET)
|
||||
add_library(wallet-crypto $<TARGET_OBJECTS:${CRYPTO_TARGET}>)
|
||||
target_link_libraries(wallet-crypto cncrypto)
|
||||
endif ()
|
||||
target_include_directories(wallet-crypto
|
||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
|
||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/generated_include>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/>
|
||||
)
|
||||
|
||||
target_link_libraries(wallet-crypto PUBLIC cncrypto)
|
||||
|
||||
monero_install_library(wallet-crypto
|
||||
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/monero/wallet-crypto/"
|
||||
HEADERS crypto.h)
|
||||
@@ -26,56 +26,68 @@
|
||||
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
||||
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
if(APPLE)
|
||||
if(DEPENDS)
|
||||
list(APPEND EXTRA_LIBRARIES "-framework Foundation -framework ApplicationServices -framework AppKit -framework IOKit")
|
||||
else()
|
||||
find_library(IOKIT_LIBRARY IOKit)
|
||||
mark_as_advanced(IOKIT_LIBRARY)
|
||||
list(APPEND EXTRA_LIBRARIES ${IOKIT_LIBRARY})
|
||||
endif()
|
||||
endif()
|
||||
file(GLOB CN_BASIC_SOURCES *.cpp *.c *.cc)
|
||||
set(CN_BASIC_HEADERS
|
||||
account.h
|
||||
account_boost_serialization.h
|
||||
blobdatatype.h
|
||||
connection_context.h
|
||||
cryptonote_basic.h
|
||||
cryptonote_basic_impl.h
|
||||
cryptonote_boost_serialization.h
|
||||
cryptonote_format_utils.h
|
||||
difficulty.h
|
||||
events.h
|
||||
fwd.h
|
||||
hardfork.h
|
||||
merge_mining.h
|
||||
miner.h
|
||||
subaddress_index.h
|
||||
tx_extra.h
|
||||
verification_context.h)
|
||||
|
||||
monero_add_library(cryptonote_format_utils_basic
|
||||
cryptonote_format_utils_basic.cpp
|
||||
)
|
||||
target_link_libraries(cryptonote_format_utils_basic
|
||||
PUBLIC
|
||||
cncrypto
|
||||
)
|
||||
# cryptonote_format_utils_basic
|
||||
add_library(cryptonote_format_utils_basic)
|
||||
target_sources(cryptonote_format_utils_basic
|
||||
PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cryptonote_format_utils_basic.cpp
|
||||
)
|
||||
|
||||
set(cryptonote_basic_sources
|
||||
account.cpp
|
||||
connection_context.cpp
|
||||
cryptonote_basic_impl.cpp
|
||||
cryptonote_format_utils.cpp
|
||||
difficulty.cpp
|
||||
hardfork.cpp
|
||||
merge_mining.cpp
|
||||
miner.cpp)
|
||||
target_link_libraries(cryptonote_format_utils_basic PUBLIC cncrypto)
|
||||
target_include_directories(cryptonote_format_utils_basic
|
||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/>
|
||||
)
|
||||
|
||||
set(cryptonote_basic_headers)
|
||||
# cryptonote_basic
|
||||
add_library(cryptonote_basic)
|
||||
target_sources(cryptonote_basic
|
||||
PRIVATE
|
||||
${CN_BASIC_SOURCES}
|
||||
)
|
||||
|
||||
monero_find_all_headers(cryptonote_basic_private_headers "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
|
||||
monero_private_headers(cryptonote_basic
|
||||
${cryptonote_basic_private_headers})
|
||||
monero_add_library(cryptonote_basic
|
||||
${cryptonote_basic_sources}
|
||||
${cryptonote_basic_headers}
|
||||
${cryptonote_basic_private_headers})
|
||||
target_link_libraries(cryptonote_basic
|
||||
PUBLIC
|
||||
common
|
||||
cncrypto
|
||||
checkpoints
|
||||
cryptonote_format_utils_basic
|
||||
device
|
||||
${Boost_DATE_TIME_LIBRARY}
|
||||
${Boost_PROGRAM_OPTIONS_LIBRARY}
|
||||
${Boost_SERIALIZATION_LIBRARY}
|
||||
${Boost_FILESYSTEM_LIBRARY}
|
||||
${Boost_SYSTEM_LIBRARY}
|
||||
${Boost_THREAD_LIBRARY}
|
||||
PRIVATE
|
||||
${EXTRA_LIBRARIES})
|
||||
Boost::date_time
|
||||
Boost::program_options
|
||||
Boost::serialization
|
||||
Boost::filesystem
|
||||
Boost::system
|
||||
Boost::thread)
|
||||
|
||||
target_include_directories(cryptonote_basic
|
||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/cryptonote_basic>
|
||||
)
|
||||
|
||||
monero_install_library(cryptonote_format_utils_basic)
|
||||
monero_install_library(cryptonote_basic
|
||||
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/monero/cryptonote_basic/"
|
||||
HEADERS ${CN_BASIC_HEADERS})
|
||||
@@ -26,25 +26,18 @@
|
||||
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
||||
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
set(cryptonote_core_sources
|
||||
blockchain.cpp
|
||||
cryptonote_core.cpp
|
||||
tx_pool.cpp
|
||||
tx_sanity_check.cpp
|
||||
cryptonote_tx_utils.cpp
|
||||
tx_verification_utils.cpp
|
||||
)
|
||||
file(GLOB CN_CORE_SOURCES *.cpp *.c *.cc)
|
||||
set(CN_CORE_HEADERS
|
||||
blockchain.h
|
||||
blockchain_storage_boost_serialization.h
|
||||
cryptonote_core.h
|
||||
cryptonote_tx_utils.h
|
||||
i_core_events.h
|
||||
tx_pool.h
|
||||
tx_sanity_check.h
|
||||
tx_verification_utils.h)
|
||||
|
||||
set(cryptonote_core_headers)
|
||||
|
||||
monero_find_all_headers(cryptonote_core_private_headers "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
|
||||
monero_private_headers(cryptonote_core
|
||||
${cryptonote_core_private_headers})
|
||||
monero_add_library(cryptonote_core
|
||||
${cryptonote_core_sources}
|
||||
${cryptonote_core_headers}
|
||||
${cryptonote_core_private_headers})
|
||||
add_library(cryptonote_core)
|
||||
target_link_libraries(cryptonote_core
|
||||
PUBLIC
|
||||
version
|
||||
@@ -54,11 +47,34 @@ target_link_libraries(cryptonote_core
|
||||
ringct
|
||||
device
|
||||
hardforks
|
||||
${Boost_DATE_TIME_LIBRARY}
|
||||
${Boost_PROGRAM_OPTIONS_LIBRARY}
|
||||
${Boost_SERIALIZATION_LIBRARY}
|
||||
${Boost_FILESYSTEM_LIBRARY}
|
||||
${Boost_SYSTEM_LIBRARY}
|
||||
${Boost_THREAD_LIBRARY}
|
||||
PRIVATE
|
||||
${EXTRA_LIBRARIES})
|
||||
Boost::date_time
|
||||
Boost::program_options
|
||||
Boost::serialization
|
||||
Boost::filesystem
|
||||
Boost::system
|
||||
Boost::thread)
|
||||
|
||||
target_include_directories(cryptonote_core PRIVATE
|
||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/external>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/>
|
||||
)
|
||||
|
||||
if(PER_BLOCK_CHECKPOINT)
|
||||
target_compile_definitions(cryptonote_core PUBLIC PER_BLOCK_CHECKPOINT=1)
|
||||
endif()
|
||||
|
||||
target_sources(cryptonote_core
|
||||
PRIVATE
|
||||
${CN_CORE_SOURCES}
|
||||
)
|
||||
|
||||
target_include_directories(cryptonote_core
|
||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/>
|
||||
)
|
||||
|
||||
monero_install_library(cryptonote_core
|
||||
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/monero/cryptonote_core/"
|
||||
HEADERS ${CN_CORE_HEADERS})
|
||||
@@ -26,16 +26,31 @@
|
||||
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
||||
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
cmake_minimum_required (VERSION 3.5)
|
||||
project (monero CXX)
|
||||
file(GLOB CN_PROT_SOURCES *.cpp *.c *.cc)
|
||||
set(CN_PROT_HEADERS
|
||||
block_queue.h
|
||||
cryptonote_protocol_defs.h
|
||||
cryptonote_protocol_handler.h
|
||||
cryptonote_protocol_handler_common.h
|
||||
enums.h
|
||||
fwd.h
|
||||
levin_notify.h)
|
||||
|
||||
file(GLOB CRYPTONOTE_PROTOCOL *)
|
||||
source_group(cryptonote_protocol FILES ${CRYPTONOTE_PROTOCOL})
|
||||
add_library(cryptonote_protocol)
|
||||
target_sources(cryptonote_protocol
|
||||
PRIVATE
|
||||
${CN_PROT_SOURCES}
|
||||
)
|
||||
|
||||
#monero_private_headers(cryptonote_protocol ${CRYPTONOTE_PROTOCOL})
|
||||
monero_add_library(cryptonote_protocol ${CRYPTONOTE_PROTOCOL})
|
||||
target_link_libraries(cryptonote_protocol
|
||||
PUBLIC
|
||||
p2p
|
||||
PRIVATE
|
||||
${EXTRA_LIBRARIES})
|
||||
target_link_libraries(cryptonote_protocol PUBLIC p2p)
|
||||
|
||||
target_include_directories(cryptonote_protocol
|
||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/>
|
||||
PRIVATE ${OPENSSL_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
monero_install_library(cryptonote_protocol
|
||||
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/monero/cryptonote_protocol/"
|
||||
HEADERS ${CN_PROT_HEADERS})
|
||||
@@ -26,25 +26,14 @@
|
||||
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
||||
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
set(daemon_sources
|
||||
command_parser_executor.cpp
|
||||
command_server.cpp
|
||||
daemon.cpp
|
||||
executor.cpp
|
||||
main.cpp
|
||||
rpc_command_executor.cpp
|
||||
)
|
||||
file(GLOB DAEMON_SOURCES
|
||||
*.cpp
|
||||
*.c
|
||||
*.cc
|
||||
*.h)
|
||||
|
||||
set(daemon_headers)
|
||||
add_executable(daemon ${DAEMON_SOURCES})
|
||||
|
||||
monero_find_all_headers(daemon_private_headers "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
|
||||
monero_private_headers(daemon
|
||||
${daemon_private_headers})
|
||||
monero_add_executable(daemon
|
||||
${daemon_sources}
|
||||
${daemon_headers}
|
||||
${daemon_private_headers})
|
||||
target_link_libraries(daemon
|
||||
PRIVATE
|
||||
rpc
|
||||
@@ -57,19 +46,27 @@ target_link_libraries(daemon
|
||||
daemonizer
|
||||
serialization
|
||||
daemon_rpc_server
|
||||
${EPEE_READLINE}
|
||||
version
|
||||
${Boost_CHRONO_LIBRARY}
|
||||
${Boost_FILESYSTEM_LIBRARY}
|
||||
${Boost_PROGRAM_OPTIONS_LIBRARY}
|
||||
${Boost_REGEX_LIBRARY}
|
||||
${Boost_SYSTEM_LIBRARY}
|
||||
${CMAKE_THREAD_LIBS_INIT}
|
||||
${ZMQ_LIB}
|
||||
${GNU_READLINE_LIBRARY}
|
||||
${EXTRA_LIBRARIES}
|
||||
${Blocks})
|
||||
Boost::chrono
|
||||
Boost::program_options
|
||||
Boost::filesystem
|
||||
Boost::system
|
||||
Boost::thread
|
||||
Boost::regex
|
||||
Threads::Threads
|
||||
${ZMQ_LIBRARIES}
|
||||
blocks)
|
||||
|
||||
target_include_directories(daemon
|
||||
PRIVATE ${ZMQ_INCLUDE_DIRS}
|
||||
PRIVATE ${OPENSSL_INCLUDE_DIR})
|
||||
|
||||
if(PER_BLOCK_CHECKPOINT)
|
||||
target_compile_definitions(daemon PUBLIC PER_BLOCK_CHECKPOINT=1)
|
||||
endif()
|
||||
|
||||
set_property(TARGET daemon
|
||||
PROPERTY
|
||||
OUTPUT_NAME "wownerod")
|
||||
install(TARGETS daemon DESTINATION bin)
|
||||
|
||||
install(TARGETS daemon DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
|
||||
@@ -58,17 +58,16 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
add_definitions(-DDEBUG_TMPDIR_LOG=1)
|
||||
endif()
|
||||
|
||||
monero_private_headers(daemonizer
|
||||
${daemonizer_private_headers})
|
||||
monero_add_library(daemonizer
|
||||
add_library(daemonizer
|
||||
${daemonizer_sources}
|
||||
${daemonizer_headers}
|
||||
${daemonizer_private_headers})
|
||||
|
||||
target_link_libraries(daemonizer
|
||||
PUBLIC
|
||||
common
|
||||
${Boost_CHRONO_LIBRARY}
|
||||
${Boost_FILESYSTEM_LIBRARY}
|
||||
${Boost_PROGRAM_OPTIONS_LIBRARY}
|
||||
PRIVATE
|
||||
${EXTRA_LIBRARIES})
|
||||
Boost::chrono
|
||||
Boost::filesystem
|
||||
Boost::program_options)
|
||||
|
||||
target_include_directories(daemonizer PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../)
|
||||
@@ -26,57 +26,41 @@
|
||||
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
||||
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
set(device_sources
|
||||
device.cpp
|
||||
device_default.cpp
|
||||
log.cpp
|
||||
)
|
||||
set(HEADERS
|
||||
device.hpp
|
||||
device_io.hpp
|
||||
device_default.hpp
|
||||
device_cold.hpp
|
||||
log.hpp)
|
||||
|
||||
if(HIDAPI_FOUND)
|
||||
set(device_sources
|
||||
${device_sources}
|
||||
device_ledger.cpp
|
||||
device_io_hid.cpp
|
||||
add_library(device)
|
||||
target_sources(device
|
||||
PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/device.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/device_default.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/log.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
set(device_headers
|
||||
device.hpp
|
||||
device_io.hpp
|
||||
device_default.hpp
|
||||
device_cold.hpp
|
||||
log.hpp
|
||||
)
|
||||
|
||||
if(HIDAPI_FOUND)
|
||||
set(device_headers
|
||||
${device_headers}
|
||||
device_ledger.hpp
|
||||
device_io_hid.hpp
|
||||
)
|
||||
endif()
|
||||
|
||||
set(device_private_headers)
|
||||
|
||||
|
||||
monero_private_headers(device
|
||||
${device_private_headers})
|
||||
|
||||
monero_add_library(device
|
||||
${device_sources}
|
||||
${device_headers}
|
||||
${device_private_headers})
|
||||
|
||||
target_link_libraries(device
|
||||
PUBLIC
|
||||
${HIDAPI_LIBRARIES}
|
||||
cncrypto
|
||||
cryptonote_format_utils_basic
|
||||
ringct_basic
|
||||
wallet-crypto
|
||||
${OPENSSL_CRYPTO_LIBRARIES}
|
||||
${Boost_SERIALIZATION_LIBRARY}
|
||||
monero-crypto-amd64-64-24k
|
||||
OpenSSL::Crypto
|
||||
Boost::serialization
|
||||
PRIVATE
|
||||
version
|
||||
${Blocks}
|
||||
${EXTRA_LIBRARIES})
|
||||
blocks)
|
||||
|
||||
target_include_directories(device
|
||||
PUBLIC $<TARGET_PROPERTY:monero-crypto-amd64-64-24k,INTERFACE_INCLUDE_DIRECTORIES>
|
||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/>
|
||||
)
|
||||
|
||||
monero_install_library(device
|
||||
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/monero/device/"
|
||||
HEADERS "${HEADERS}")
|
||||
|
||||
@@ -51,4 +51,4 @@ add_dependencies(gen_multisig
|
||||
set_property(TARGET gen_multisig
|
||||
PROPERTY
|
||||
OUTPUT_NAME "wownero-gen-trusted-multisig")
|
||||
install(TARGETS gen_multisig DESTINATION bin)
|
||||
install(TARGETS gen_multisig DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
|
||||
@@ -46,4 +46,4 @@ add_dependencies(gen_ssl_cert
|
||||
set_property(TARGET gen_ssl_cert
|
||||
PROPERTY
|
||||
OUTPUT_NAME "wownero-gen-ssl-cert")
|
||||
install(TARGETS gen_ssl_cert DESTINATION bin)
|
||||
install(TARGETS gen_ssl_cert DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
|
||||
@@ -26,21 +26,14 @@
|
||||
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
||||
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
set(hardforks_sources
|
||||
hardforks.cpp)
|
||||
add_library(hardforks)
|
||||
target_sources(hardforks
|
||||
PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hardforks.cpp
|
||||
)
|
||||
|
||||
monero_find_all_headers(hardforks_headers "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
target_link_libraries(hardforks PUBLIC version)
|
||||
|
||||
set(hardforks_private_headers)
|
||||
|
||||
monero_private_headers(hardforks
|
||||
${hardforks_private_headers})
|
||||
monero_add_library(hardforks
|
||||
${hardforks_sources}
|
||||
${hardforks_headers}
|
||||
${hardforks_private_headers})
|
||||
target_link_libraries(hardforks
|
||||
PUBLIC
|
||||
version
|
||||
PRIVATE
|
||||
${EXTRA_LIBRARIES})
|
||||
monero_install_library(hardforks
|
||||
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/monero/hardforks/"
|
||||
HEADERS hardforks.h)
|
||||
@@ -26,8 +26,26 @@
|
||||
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
||||
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
set(lmdb_sources database.cpp error.cpp table.cpp value_stream.cpp)
|
||||
monero_find_all_headers(lmdb_headers "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
file(GLOB LMDB_SOURCES *.cpp *.c *.cc)
|
||||
set(LMDB_HEADERS
|
||||
database.h
|
||||
error.h
|
||||
key_stream.h
|
||||
table.h
|
||||
transaction.h
|
||||
util.h
|
||||
value_stream.h)
|
||||
|
||||
monero_add_library(lmdb_lib ${lmdb_sources} ${lmdb_headers})
|
||||
target_link_libraries(lmdb_lib common ${LMDB_LIBRARY})
|
||||
add_library(lmdb_lib)
|
||||
target_sources(lmdb_lib
|
||||
PRIVATE
|
||||
${LMDB_SOURCES}
|
||||
)
|
||||
|
||||
target_link_libraries(lmdb_lib PRIVATE
|
||||
common
|
||||
lmdb)
|
||||
|
||||
monero_install_library(lmdb_lib
|
||||
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/monero/lmdb_lib/"
|
||||
HEADERS ${LMDB_HEADERS})
|
||||
@@ -26,23 +26,43 @@
|
||||
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
||||
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
set(mnemonics_sources
|
||||
electrum-words.cpp)
|
||||
file(GLOB MN_SOURCES *.cpp *.c *.cc)
|
||||
set(MN_HEADERS
|
||||
chinese_simplified.h
|
||||
dutch.h
|
||||
electrum-words.h
|
||||
english.h
|
||||
english_old.h
|
||||
esperanto.h
|
||||
french.h
|
||||
german.h
|
||||
italian.h
|
||||
japanese.h
|
||||
language_base.h
|
||||
lojban.h
|
||||
portuguese.h
|
||||
russian.h
|
||||
singleton.h
|
||||
spanish.h)
|
||||
|
||||
set(mnemonics_headers)
|
||||
add_library(mnemonics)
|
||||
target_sources(mnemonics
|
||||
PRIVATE
|
||||
${MN_SOURCES}
|
||||
)
|
||||
|
||||
monero_find_all_headers(mnemonics_private_headers "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
|
||||
monero_private_headers(mnemonics
|
||||
${mnemonics_private_headers})
|
||||
monero_add_library(mnemonics
|
||||
${mnemonics_sources}
|
||||
${mnemonics_headers}
|
||||
${mnemonics_private_headers})
|
||||
target_link_libraries(mnemonics
|
||||
PUBLIC
|
||||
epee
|
||||
easylogging
|
||||
${Boost_SYSTEM_LIBRARY}
|
||||
PRIVATE
|
||||
${EXTRA_LIBRARIES})
|
||||
Boost::system)
|
||||
|
||||
target_include_directories(mnemonics
|
||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/>
|
||||
)
|
||||
|
||||
monero_install_library(mnemonics
|
||||
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/monero/mnemonics/"
|
||||
HEADERS ${MN_HEADERS})
|
||||
@@ -25,26 +25,20 @@
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
||||
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
file(GLOB MULTISIG_SOURCES *.cpp *.c *.cc)
|
||||
set(MULTISIG_HEADERS
|
||||
multisig_account.h
|
||||
multisig_clsag_context.h
|
||||
multisig.h
|
||||
multisig_kex_msg.h
|
||||
multisig_kex_msg_serialization.h
|
||||
multisig_tx_builder_ringct.h)
|
||||
|
||||
set(multisig_sources
|
||||
multisig.cpp
|
||||
multisig_account.cpp
|
||||
multisig_account_kex_impl.cpp
|
||||
multisig_clsag_context.cpp
|
||||
multisig_kex_msg.cpp
|
||||
multisig_tx_builder_ringct.cpp)
|
||||
|
||||
set(multisig_headers)
|
||||
|
||||
monero_find_all_headers(multisig_private_headers "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
|
||||
monero_private_headers(multisig
|
||||
${multisig_private_headers})
|
||||
|
||||
monero_add_library(multisig
|
||||
${multisig_sources}
|
||||
${multisig_headers}
|
||||
${multisig_private_headers})
|
||||
add_library(multisig)
|
||||
target_sources(multisig
|
||||
PRIVATE
|
||||
${MULTISIG_SOURCES}
|
||||
)
|
||||
|
||||
target_link_libraries(multisig
|
||||
PUBLIC
|
||||
@@ -52,6 +46,14 @@ target_link_libraries(multisig
|
||||
cryptonote_basic
|
||||
cryptonote_core
|
||||
common
|
||||
cncrypto
|
||||
PRIVATE
|
||||
${EXTRA_LIBRARIES})
|
||||
cncrypto)
|
||||
|
||||
target_include_directories(multisig
|
||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/>
|
||||
)
|
||||
|
||||
monero_install_library(multisig
|
||||
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/monero/multisig/"
|
||||
HEADERS ${MULTISIG_HEADERS})
|
||||
|
||||
@@ -27,10 +27,40 @@
|
||||
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
||||
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
set(net_sources dandelionpp.cpp error.cpp http.cpp i2p_address.cpp parse.cpp resolve.cpp
|
||||
socks.cpp socks_connect.cpp tor_address.cpp zmq.cpp)
|
||||
monero_find_all_headers(net_headers "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
SET(NET_HEADERS
|
||||
dandelionpp.h
|
||||
error.h
|
||||
fwd.h
|
||||
http.h
|
||||
i2p_address.h
|
||||
parse.h
|
||||
resolve.h
|
||||
socks_connect.h
|
||||
socks.h
|
||||
tor_address.h
|
||||
zmq.h)
|
||||
file(GLOB NET_SOURCES *.cpp *.c *.cc)
|
||||
|
||||
monero_add_library(net ${net_sources} ${net_headers})
|
||||
target_link_libraries(net common epee ${ZMQ_LIB} ${Boost_ASIO_LIBRARY})
|
||||
add_library(net)
|
||||
target_sources(net
|
||||
PRIVATE
|
||||
${NET_SOURCES}
|
||||
)
|
||||
|
||||
target_link_libraries(net PUBLIC
|
||||
common
|
||||
epee
|
||||
${ZMQ_LIBRARIES}
|
||||
Boost::system)
|
||||
|
||||
target_include_directories(net
|
||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/>
|
||||
PRIVATE ${ZMQ_INCLUDE_DIRS}
|
||||
PRIVATE ${OPENSSL_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
monero_install_library(net
|
||||
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/monero/net/"
|
||||
HEADERS ${NET_HEADERS})
|
||||
|
||||
@@ -26,27 +26,41 @@
|
||||
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
||||
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
cmake_minimum_required (VERSION 3.5)
|
||||
project (monero CXX)
|
||||
file(GLOB P2P_SOURCES *.cpp *.c *.cc)
|
||||
set(P2P_HEADERS
|
||||
net_node_common.h
|
||||
net_node.h
|
||||
net_peerlist_boost_serialization.h
|
||||
net_peerlist.h
|
||||
p2p_protocol_defs.h)
|
||||
|
||||
file(GLOB P2P *)
|
||||
source_group(p2p FILES ${P2P})
|
||||
add_library(p2p)
|
||||
target_sources(p2p
|
||||
PRIVATE
|
||||
${P2P_SOURCES}
|
||||
)
|
||||
|
||||
#add_library(p2p ${P2P})
|
||||
|
||||
#monero_private_headers(p2p ${P2P})
|
||||
monero_add_library(p2p ${P2P})
|
||||
target_link_libraries(p2p
|
||||
PUBLIC
|
||||
version
|
||||
cryptonote_core
|
||||
net
|
||||
${UPNP_LIBRARIES}
|
||||
${Boost_CHRONO_LIBRARY}
|
||||
${Boost_PROGRAM_OPTIONS_LIBRARY}
|
||||
${Boost_FILESYSTEM_LIBRARY}
|
||||
${Boost_SYSTEM_LIBRARY}
|
||||
${Boost_THREAD_LIBRARY}
|
||||
${Boost_SERIALIZATION_LIBRARY}
|
||||
PRIVATE
|
||||
${EXTRA_LIBRARIES})
|
||||
miniupnpc::miniupnpc
|
||||
Boost::chrono
|
||||
Boost::program_options
|
||||
Boost::filesystem
|
||||
Boost::system
|
||||
Boost::thread
|
||||
Boost::serialization)
|
||||
|
||||
target_include_directories(p2p
|
||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
|
||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/external>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/>
|
||||
PRIVATE ${OPENSSL_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
monero_install_library(p2p
|
||||
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/monero/p2p/"
|
||||
HEADERS ${P2P_HEADERS})
|
||||
|
||||
@@ -60,9 +60,9 @@
|
||||
#include "cryptonote_core/cryptonote_core.h"
|
||||
#include "net/parse.h"
|
||||
|
||||
#include <miniupnp/miniupnpc/miniupnpc.h>
|
||||
#include <miniupnp/miniupnpc/upnpcommands.h>
|
||||
#include <miniupnp/miniupnpc/upnperrors.h>
|
||||
#include <miniupnpc/miniupnpc.h>
|
||||
#include <miniupnpc/upnpcommands.h>
|
||||
#include <miniupnpc/upnperrors.h>
|
||||
|
||||
#undef MONERO_DEFAULT_LOG_CATEGORY
|
||||
#define MONERO_DEFAULT_LOG_CATEGORY "net.p2p"
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
// Copyright (c) 2014-2022, The Monero Project
|
||||
//
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification, are
|
||||
// permitted provided that the following conditions are met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
// conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
// of conditions and the following disclaimer in the documentation and/or other
|
||||
// materials provided with the distribution.
|
||||
//
|
||||
// 3. Neither the name of the copyright holder nor the names of its contributors may be
|
||||
// used to endorse or promote products derived from this software without specific
|
||||
// prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
||||
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <malloc.h>
|
||||
@@ -1,33 +0,0 @@
|
||||
// Copyright (c) 2014-2022, The Monero Project
|
||||
//
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification, are
|
||||
// permitted provided that the following conditions are met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
// conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
// of conditions and the following disclaimer in the documentation and/or other
|
||||
// materials provided with the distribution.
|
||||
//
|
||||
// 3. Neither the name of the copyright holder nor the names of its contributors may be
|
||||
// used to endorse or promote products derived from this software without specific
|
||||
// prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
||||
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers
|
||||
|
||||
#pragma once
|
||||
|
||||
#define alloca(size) _alloca(size)
|
||||
@@ -1,35 +0,0 @@
|
||||
// Copyright (c) 2014-2022, The Monero Project
|
||||
//
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification, are
|
||||
// permitted provided that the following conditions are met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
// conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
// of conditions and the following disclaimer in the documentation and/or other
|
||||
// materials provided with the distribution.
|
||||
//
|
||||
// 3. Neither the name of the copyright holder nor the names of its contributors may be
|
||||
// used to endorse or promote products derived from this software without specific
|
||||
// prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
||||
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef __cplusplus
|
||||
#define inline __inline
|
||||
#endif
|
||||
@@ -1,39 +0,0 @@
|
||||
// Copyright (c) 2014-2022, The Monero Project
|
||||
//
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification, are
|
||||
// permitted provided that the following conditions are met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
// conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
// of conditions and the following disclaimer in the documentation and/or other
|
||||
// materials provided with the distribution.
|
||||
//
|
||||
// 3. Neither the name of the copyright holder nor the names of its contributors may be
|
||||
// used to endorse or promote products derived from this software without specific
|
||||
// prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
||||
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers
|
||||
|
||||
#pragma once
|
||||
|
||||
#if !defined(__cplusplus)
|
||||
|
||||
typedef int bool;
|
||||
#define true 1
|
||||
#define false 0
|
||||
|
||||
#endif
|
||||
@@ -1,36 +0,0 @@
|
||||
// Copyright (c) 2014-2022, The Monero Project
|
||||
//
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification, are
|
||||
// permitted provided that the following conditions are met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
// conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
// of conditions and the following disclaimer in the documentation and/or other
|
||||
// materials provided with the distribution.
|
||||
//
|
||||
// 3. Neither the name of the copyright holder nor the names of its contributors may be
|
||||
// used to endorse or promote products derived from this software without specific
|
||||
// prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
||||
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers
|
||||
|
||||
#pragma once
|
||||
|
||||
#define LITTLE_ENDIAN 1234
|
||||
#define BIG_ENDIAN 4321
|
||||
#define PDP_ENDIAN 3412
|
||||
#define BYTE_ORDER LITTLE_ENDIAN
|
||||
@@ -27,45 +27,50 @@
|
||||
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
set(ringct_basic_sources
|
||||
rctOps.cpp
|
||||
rctTypes.cpp
|
||||
rctCryptoOps.c
|
||||
multiexp.cc
|
||||
bulletproofs.cc
|
||||
bulletproofs2.cc
|
||||
bulletproofs_plus.cc)
|
||||
rctOps.cpp
|
||||
rctTypes.cpp
|
||||
rctCryptoOps.c
|
||||
multiexp.cc
|
||||
bulletproofs.cc
|
||||
bulletproofs2.cc
|
||||
bulletproofs_plus.cc)
|
||||
|
||||
monero_find_all_headers(ringct_basic_private_headers "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
set(ringct_basic_headers
|
||||
rctOps.h
|
||||
rctTypes.h
|
||||
rctCryptoOps.h
|
||||
multiexp.h
|
||||
bulletproofs.h
|
||||
bulletproofs_plus.h)
|
||||
|
||||
|
||||
add_library(ringct_basic)
|
||||
target_sources(ringct_basic
|
||||
PRIVATE
|
||||
${ringct_basic_sources}
|
||||
)
|
||||
|
||||
monero_private_headers(ringct_basic
|
||||
${crypto_private_headers})
|
||||
monero_add_library(ringct_basic
|
||||
${ringct_basic_sources}
|
||||
${ringct_basic_private_headers})
|
||||
target_link_libraries(ringct_basic
|
||||
PUBLIC
|
||||
common
|
||||
cncrypto
|
||||
PRIVATE
|
||||
${OPENSSL_LIBRARIES}
|
||||
${EXTRA_LIBRARIES})
|
||||
OpenSSL::SSL
|
||||
OpenSSL::Crypto)
|
||||
|
||||
set(ringct_sources
|
||||
rctSigs.cpp
|
||||
)
|
||||
target_include_directories(ringct_basic
|
||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/>
|
||||
PRIVATE ${OPENSSL_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
set(ringct_headers)
|
||||
add_library(ringct)
|
||||
target_sources(ringct
|
||||
PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/rctSigs.cpp
|
||||
)
|
||||
|
||||
set(ringct_private_headers
|
||||
rctSigs.h
|
||||
)
|
||||
|
||||
monero_private_headers(ringct
|
||||
${crypto_private_headers})
|
||||
monero_add_library(ringct
|
||||
${ringct_sources}
|
||||
${ringct_headers}
|
||||
${ringct_private_headers})
|
||||
target_link_libraries(ringct
|
||||
PUBLIC
|
||||
common
|
||||
@@ -73,5 +78,19 @@ target_link_libraries(ringct
|
||||
cryptonote_basic
|
||||
device
|
||||
PRIVATE
|
||||
${OPENSSL_LIBRARIES}
|
||||
${EXTRA_LIBRARIES})
|
||||
OpenSSL::SSL)
|
||||
|
||||
target_include_directories(ringct
|
||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/>
|
||||
PRIVATE ${OPENSSL_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
monero_install_library(ringct_basic
|
||||
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/monero/ringct/"
|
||||
HEADERS ${ringct_basic_headers})
|
||||
|
||||
monero_install_library(ringct
|
||||
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/monero/ringct/"
|
||||
HEADERS rctSigs.h)
|
||||
|
||||
@@ -26,108 +26,59 @@
|
||||
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
||||
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
include_directories(SYSTEM ${ZMQ_INCLUDE_PATH})
|
||||
|
||||
set(rpc_base_sources
|
||||
rpc_args.cpp
|
||||
rpc_payment_signature.cpp
|
||||
rpc_handler.cpp)
|
||||
|
||||
set(rpc_sources
|
||||
bootstrap_daemon.cpp
|
||||
bootstrap_node_selector.cpp
|
||||
core_rpc_server.cpp
|
||||
rpc_payment.cpp
|
||||
rpc_version_str.cpp
|
||||
instanciations.cpp)
|
||||
|
||||
set(daemon_messages_sources
|
||||
message.cpp
|
||||
daemon_messages.cpp)
|
||||
|
||||
set(rpc_pub_sources zmq_pub.cpp)
|
||||
|
||||
set(daemon_rpc_server_sources
|
||||
daemon_handler.cpp
|
||||
zmq_pub.cpp
|
||||
zmq_server.cpp)
|
||||
|
||||
|
||||
set(rpc_base_headers
|
||||
rpc_args.h
|
||||
rpc_payment_signature.h
|
||||
rpc_handler.h)
|
||||
|
||||
set(rpc_headers
|
||||
rpc_version_str.h
|
||||
rpc_handler.h)
|
||||
|
||||
set(rpc_pub_headers zmq_pub.h)
|
||||
|
||||
set(daemon_rpc_server_headers)
|
||||
|
||||
set(rpc_private_headers
|
||||
bootstrap_daemon.h
|
||||
core_rpc_server.h
|
||||
rpc_payment.h
|
||||
core_rpc_server_commands_defs.h
|
||||
core_rpc_server_error_codes.h)
|
||||
|
||||
set(daemon_messages_private_headers
|
||||
message.h
|
||||
daemon_messages.h)
|
||||
|
||||
set(daemon_rpc_server_private_headers
|
||||
message.h
|
||||
daemon_messages.h
|
||||
daemon_handler.h
|
||||
zmq_server.h)
|
||||
|
||||
|
||||
monero_private_headers(rpc
|
||||
${rpc_private_headers})
|
||||
|
||||
set(rpc_pub_private_headers)
|
||||
|
||||
monero_private_headers(daemon_rpc_server
|
||||
${daemon_rpc_server_private_headers})
|
||||
|
||||
|
||||
monero_add_library(rpc_base
|
||||
${rpc_base_sources}
|
||||
${rpc_base_headers}
|
||||
${rpc_base_private_headers})
|
||||
|
||||
monero_add_library(rpc
|
||||
${rpc_sources}
|
||||
${rpc_headers}
|
||||
${rpc_private_headers})
|
||||
|
||||
monero_add_library(rpc_pub
|
||||
${rpc_pub_sources}
|
||||
${rpc_pub_headers}
|
||||
${rpc_pub_private_headers})
|
||||
|
||||
monero_add_library(daemon_messages
|
||||
${daemon_messages_sources}
|
||||
${daemon_messages_headers}
|
||||
${daemon_messages_private_headers})
|
||||
|
||||
monero_add_library(daemon_rpc_server
|
||||
${daemon_rpc_server_sources}
|
||||
${daemon_rpc_server_headers}
|
||||
${daemon_rpc_server_private_headers})
|
||||
# rpc base
|
||||
set(RPC_BASE_HEADERS
|
||||
rpc_args.h
|
||||
rpc_payment_signature.h
|
||||
rpc_handler.h)
|
||||
|
||||
add_library(rpc_base)
|
||||
target_sources(rpc_base
|
||||
PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/rpc_args.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/rpc_payment_signature.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/rpc_handler.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(rpc_base
|
||||
PUBLIC
|
||||
common
|
||||
epee
|
||||
${Boost_REGEX_LIBRARY}
|
||||
${Boost_THREAD_LIBRARY}
|
||||
${Boost_PROGRAM_OPTIONS_LIBRARY}
|
||||
PRIVATE
|
||||
${EXTRA_LIBRARIES})
|
||||
Boost::regex
|
||||
Boost::thread
|
||||
Boost::program_options)
|
||||
|
||||
target_include_directories(rpc_base
|
||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero>
|
||||
PRIVATE ${ZMQ_INCLUDE_DIRS}
|
||||
PRIVATE ${OPENSSL_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
monero_install_library(rpc_base
|
||||
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/monero/rpc_base/"
|
||||
HEADERS "${RPC_BASE_HEADERS}")
|
||||
|
||||
# rpc
|
||||
set(RPC_HEADERS
|
||||
rpc_version_str.h
|
||||
rpc_handler.h
|
||||
bootstrap_daemon.h
|
||||
core_rpc_server.h
|
||||
rpc_payment.h
|
||||
core_rpc_server_commands_defs.h
|
||||
core_rpc_server_error_codes.h)
|
||||
|
||||
add_library(rpc)
|
||||
target_sources(rpc
|
||||
PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/bootstrap_daemon.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/bootstrap_node_selector.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/core_rpc_server.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/rpc_payment.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/rpc_version_str.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/instanciations.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(rpc
|
||||
PUBLIC
|
||||
@@ -137,10 +88,30 @@ target_link_libraries(rpc
|
||||
cryptonote_protocol
|
||||
net
|
||||
version
|
||||
${Boost_REGEX_LIBRARY}
|
||||
${Boost_THREAD_LIBRARY}
|
||||
PRIVATE
|
||||
${EXTRA_LIBRARIES})
|
||||
Boost::regex
|
||||
Boost::thread)
|
||||
|
||||
target_include_directories(rpc
|
||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/>
|
||||
PRIVATE ${ZMQ_INCLUDE_DIRS}
|
||||
PRIVATE ${OPENSSL_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
monero_install_library(rpc
|
||||
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/monero/rpc/"
|
||||
HEADERS "${RPC_HEADERS}")
|
||||
|
||||
# rpc pub
|
||||
set(RPC_PUB_HEADERS
|
||||
zmq_pub.h)
|
||||
|
||||
add_library(rpc_pub)
|
||||
target_sources(rpc_pub
|
||||
PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/zmq_pub.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(rpc_pub
|
||||
PUBLIC
|
||||
@@ -148,15 +119,46 @@ target_link_libraries(rpc_pub
|
||||
net
|
||||
cryptonote_basic
|
||||
serialization
|
||||
${Boost_THREAD_LIBRARY})
|
||||
Boost::thread)
|
||||
|
||||
target_include_directories(rpc_pub
|
||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/>
|
||||
PRIVATE ${ZMQ_INCLUDE_DIRS}
|
||||
PRIVATE ${OPENSSL_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
monero_install_library(rpc_pub
|
||||
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/monero/rpc_pub/"
|
||||
HEADERS "${RPC_PUB_HEADERS}")
|
||||
|
||||
# daemon messages
|
||||
set(DAEMON_MESSAGES_HEADERS
|
||||
message.h
|
||||
daemon_messages.h)
|
||||
|
||||
add_library(daemon_messages
|
||||
message.cpp
|
||||
daemon_messages.cpp)
|
||||
|
||||
target_link_libraries(daemon_messages
|
||||
LINK_PRIVATE
|
||||
cryptonote_core
|
||||
cryptonote_protocol
|
||||
version
|
||||
serialization
|
||||
${EXTRA_LIBRARIES})
|
||||
serialization)
|
||||
|
||||
# daemon rpc server
|
||||
|
||||
add_library(daemon_rpc_server
|
||||
daemon_handler.cpp
|
||||
zmq_pub.cpp
|
||||
zmq_server.cpp
|
||||
message.h
|
||||
daemon_messages.h
|
||||
daemon_handler.h
|
||||
zmq_server.h)
|
||||
|
||||
target_link_libraries(daemon_rpc_server
|
||||
LINK_PRIVATE
|
||||
@@ -167,11 +169,13 @@ target_link_libraries(daemon_rpc_server
|
||||
version
|
||||
daemon_messages
|
||||
serialization
|
||||
${Boost_CHRONO_LIBRARY}
|
||||
${Boost_REGEX_LIBRARY}
|
||||
${Boost_SYSTEM_LIBRARY}
|
||||
${Boost_THREAD_LIBRARY}
|
||||
${ZMQ_LIB}
|
||||
${EXTRA_LIBRARIES})
|
||||
target_include_directories(daemon_rpc_server PUBLIC ${ZMQ_INCLUDE_PATH})
|
||||
target_include_directories(obj_daemon_rpc_server PUBLIC ${ZMQ_INCLUDE_PATH})
|
||||
Boost::chrono
|
||||
Boost::regex
|
||||
Boost::system
|
||||
Boost::thread
|
||||
${ZMQ_LIBRARIES})
|
||||
|
||||
target_include_directories(daemon_rpc_server
|
||||
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../
|
||||
PRIVATE ${ZMQ_INCLUDE_DIRS}
|
||||
PRIVATE ${OPENSSL_INCLUDE_DIR})
|
||||
|
||||
@@ -26,30 +26,49 @@
|
||||
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
||||
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
set(serialization_sources
|
||||
json_object.cpp)
|
||||
file(GLOB SER_SOURCES *.cpp *.c *.cc)
|
||||
set(SER_HEADERS
|
||||
binary_archive.h
|
||||
binary_utils.h
|
||||
container.h
|
||||
containers.h
|
||||
crypto.h
|
||||
debug_archive.h
|
||||
difficulty_type.h
|
||||
json_archive.h
|
||||
json_object.h
|
||||
json_utils.h
|
||||
pair.h
|
||||
serialization.h
|
||||
string.h
|
||||
tuple.h
|
||||
variant.h)
|
||||
|
||||
set(serialization_headers)
|
||||
add_library(serialization)
|
||||
target_sources(serialization
|
||||
PRIVATE
|
||||
${SER_SOURCES}
|
||||
)
|
||||
|
||||
monero_find_all_headers(serialization_private_headers "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
|
||||
monero_private_headers(serialization
|
||||
${serialization_private_headers})
|
||||
monero_add_library(serialization
|
||||
${serialization_sources}
|
||||
${serialization_headers}
|
||||
${serialization_private_headers})
|
||||
target_link_libraries(serialization
|
||||
LINK_PRIVATE
|
||||
cryptonote_basic
|
||||
cryptonote_core
|
||||
cryptonote_protocol
|
||||
epee
|
||||
${Boost_CHRONO_LIBRARY}
|
||||
${Boost_REGEX_LIBRARY}
|
||||
${Boost_SYSTEM_LIBRARY}
|
||||
${Boost_THREAD_LIBRARY}
|
||||
${EXTRA_LIBRARIES})
|
||||
add_dependencies(serialization
|
||||
version)
|
||||
Boost::chrono
|
||||
Boost::regex
|
||||
Boost::system
|
||||
Boost::thread)
|
||||
|
||||
add_dependencies(serialization version)
|
||||
|
||||
target_include_directories(serialization
|
||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/>
|
||||
)
|
||||
|
||||
monero_install_library(serialization
|
||||
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/monero/serialization/"
|
||||
HEADERS "${SER_HEADERS}")
|
||||
|
||||
@@ -26,19 +26,13 @@
|
||||
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
||||
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
set(simplewallet_sources
|
||||
simplewallet.cpp)
|
||||
file(GLOB SW_SOURCES
|
||||
*.cpp
|
||||
*.c
|
||||
*.cc
|
||||
*.h)
|
||||
|
||||
set(simplewallet_headers)
|
||||
|
||||
monero_find_all_headers(simplewallet_private_headers "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
|
||||
monero_private_headers(simplewallet
|
||||
${simplewallet_private_headers})
|
||||
monero_add_executable(simplewallet
|
||||
${simplewallet_sources}
|
||||
${simplewallet_headers}
|
||||
${simplewallet_private_headers})
|
||||
add_executable(simplewallet ${SW_SOURCES})
|
||||
target_link_libraries(simplewallet
|
||||
PRIVATE
|
||||
wallet
|
||||
@@ -50,16 +44,23 @@ target_link_libraries(simplewallet
|
||||
${EPEE_READLINE}
|
||||
qrcodegen
|
||||
version
|
||||
${Boost_CHRONO_LIBRARY}
|
||||
${Boost_PROGRAM_OPTIONS_LIBRARY}
|
||||
${Boost_FILESYSTEM_LIBRARY}
|
||||
${Boost_LOCALE_LIBRARY}
|
||||
|
||||
Boost::chrono
|
||||
Boost::program_options
|
||||
Boost::filesystem
|
||||
Boost::system
|
||||
Boost::thread
|
||||
Boost::serialization
|
||||
Boost::locale
|
||||
${ICU_LIBRARIES}
|
||||
${Boost_THREAD_LIBRARY}
|
||||
${CMAKE_THREAD_LIBS_INIT}
|
||||
${GNU_READLINE_LIBRARY}
|
||||
${EXTRA_LIBRARIES})
|
||||
${GNU_READLINE_LIBRARY})
|
||||
|
||||
target_include_directories(simplewallet
|
||||
PRIVATE ${OPENSSL_INCLUDE_DIR})
|
||||
|
||||
set_property(TARGET simplewallet
|
||||
PROPERTY
|
||||
OUTPUT_NAME "wownero-wallet-cli")
|
||||
install(TARGETS simplewallet DESTINATION bin)
|
||||
|
||||
|
||||
|
||||
@@ -26,27 +26,50 @@
|
||||
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
||||
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# include (${PROJECT_SOURCE_DIR}/cmake/libutils.cmake)
|
||||
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
||||
|
||||
set(wallet_sources
|
||||
wallet2.cpp
|
||||
wallet_args.cpp
|
||||
ringdb.cpp
|
||||
node_rpc_proxy.cpp
|
||||
message_store.cpp
|
||||
message_transporter.cpp
|
||||
wallet_rpc_payments.cpp
|
||||
)
|
||||
wallet2.cpp
|
||||
wallet_args.cpp
|
||||
ringdb.cpp
|
||||
node_rpc_proxy.cpp
|
||||
message_store.cpp
|
||||
message_transporter.cpp
|
||||
wallet_rpc_payments.cpp)
|
||||
|
||||
monero_find_all_headers(wallet_private_headers "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
set(wallet_headers
|
||||
api/pending_transaction.h
|
||||
api/pending_transaction_info.h
|
||||
api/wallet.h
|
||||
api/wallet2_api.h
|
||||
wallet2.h
|
||||
api/address_book.h
|
||||
api/coins.h
|
||||
api/coins_info.h
|
||||
api/common_defines.h
|
||||
api/subaddress.h
|
||||
api/subaddress_account.h
|
||||
api/transaction_construction_info.h
|
||||
api/transaction_history.h
|
||||
api/transaction_info.h
|
||||
api/unsigned_transaction.h
|
||||
api/wallet_manager.h
|
||||
message_store.h
|
||||
message_transporter.h
|
||||
node_rpc_proxy.h
|
||||
ringdb.h
|
||||
wallet_args.h
|
||||
wallet_errors.h
|
||||
wallet_light_rpc.h
|
||||
wallet_rpc_helpers.h
|
||||
wallet_rpc_server.h
|
||||
wallet_rpc_server_commands_defs.h
|
||||
wallet_rpc_server_error_codes.h)
|
||||
|
||||
add_library(wallet ${wallet_sources})
|
||||
target_sources(wallet
|
||||
PRIVATE
|
||||
${wallet_sources}
|
||||
)
|
||||
|
||||
monero_private_headers(wallet
|
||||
${wallet_private_headers})
|
||||
monero_add_library(wallet
|
||||
${wallet_sources}
|
||||
${wallet_private_headers})
|
||||
target_link_libraries(wallet
|
||||
PUBLIC
|
||||
rpc_base
|
||||
@@ -54,54 +77,64 @@ target_link_libraries(wallet
|
||||
common
|
||||
cryptonote_core
|
||||
mnemonics
|
||||
device_trezor
|
||||
net
|
||||
${LMDB_LIBRARY}
|
||||
${Boost_CHRONO_LIBRARY}
|
||||
${Boost_SERIALIZATION_LIBRARY}
|
||||
${Boost_FILESYSTEM_LIBRARY}
|
||||
${Boost_SYSTEM_LIBRARY}
|
||||
${Boost_THREAD_LIBRARY}
|
||||
${Boost_REGEX_LIBRARY}
|
||||
lmdb
|
||||
Boost::chrono
|
||||
Boost::serialization
|
||||
Boost::filesystem
|
||||
Boost::system
|
||||
Boost::thread
|
||||
Boost::regex
|
||||
PRIVATE
|
||||
${EXTRA_LIBRARIES})
|
||||
OpenSSL::SSL)
|
||||
|
||||
if(NOT IOS)
|
||||
set(wallet_rpc_sources
|
||||
wallet_rpc_server.cpp)
|
||||
target_include_directories(wallet
|
||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/external/>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/>
|
||||
PRIVATE ${OPENSSL_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
set(wallet_rpc_headers)
|
||||
monero_install_library(wallet
|
||||
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/monero/wallet/"
|
||||
HEADERS "${wallet_headers}")
|
||||
|
||||
set(wallet_rpc_private_headers
|
||||
wallet_rpc_server.h)
|
||||
# == rpc server
|
||||
|
||||
monero_private_headers(wallet_rpc_server
|
||||
${wallet_rpc_private_headers})
|
||||
monero_add_executable(wallet_rpc_server
|
||||
${wallet_rpc_sources}
|
||||
${wallet_rpc_headers}
|
||||
${wallet_rpc_private_headers})
|
||||
add_executable(wallet_rpc_server wallet_rpc_server.cpp)
|
||||
target_link_libraries(wallet_rpc_server
|
||||
PRIVATE
|
||||
wallet
|
||||
rpc_base
|
||||
cryptonote_core
|
||||
cncrypto
|
||||
common
|
||||
version
|
||||
daemonizer
|
||||
Boost::chrono
|
||||
Boost::program_options
|
||||
Boost::filesystem
|
||||
Boost::thread
|
||||
Threads::Threads
|
||||
OpenSSL::SSL
|
||||
OpenSSL::Crypto)
|
||||
|
||||
target_link_libraries(wallet_rpc_server
|
||||
PRIVATE
|
||||
wallet
|
||||
rpc_base
|
||||
cryptonote_core
|
||||
cncrypto
|
||||
common
|
||||
version
|
||||
daemonizer
|
||||
${EPEE_READLINE}
|
||||
${Boost_CHRONO_LIBRARY}
|
||||
${Boost_PROGRAM_OPTIONS_LIBRARY}
|
||||
${Boost_FILESYSTEM_LIBRARY}
|
||||
${Boost_THREAD_LIBRARY}
|
||||
${CMAKE_THREAD_LIBS_INIT}
|
||||
${EXTRA_LIBRARIES})
|
||||
set_property(TARGET wallet_rpc_server
|
||||
PROPERTY
|
||||
OUTPUT_NAME "wownero-wallet-rpc")
|
||||
install(TARGETS wallet_rpc_server DESTINATION bin)
|
||||
endif()
|
||||
target_include_directories(wallet_rpc_server
|
||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/external/>
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/>
|
||||
PRIVATE ${OPENSSL_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
set_property(TARGET wallet_rpc_server PROPERTY OUTPUT_NAME "wownero-wallet-rpc")
|
||||
|
||||
install(TARGETS wallet_rpc_server
|
||||
EXPORT walletRpcServerTargets
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/monero/
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/monero/
|
||||
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/monero/
|
||||
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/monero/
|
||||
)
|
||||
|
||||
add_subdirectory(api)
|
||||
|
||||
@@ -26,78 +26,67 @@
|
||||
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
||||
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# include (${PROJECT_SOURCE_DIR}/cmake/libutils.cmake)
|
||||
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
||||
|
||||
set(wallet_api_sources
|
||||
wallet.cpp
|
||||
wallet_manager.cpp
|
||||
transaction_info.cpp
|
||||
transaction_history.cpp
|
||||
transaction_construction_info.cpp
|
||||
pending_transaction_info.cpp
|
||||
pending_transaction.cpp
|
||||
utils.cpp
|
||||
address_book.cpp
|
||||
subaddress.cpp
|
||||
subaddress_account.cpp
|
||||
unsigned_transaction.cpp
|
||||
coins.cpp
|
||||
coins_info.cpp)
|
||||
wallet.cpp
|
||||
wallet_manager.cpp
|
||||
transaction_info.cpp
|
||||
transaction_history.cpp
|
||||
transaction_construction_info.cpp
|
||||
pending_transaction_info.cpp
|
||||
pending_transaction.cpp
|
||||
utils.cpp
|
||||
address_book.cpp
|
||||
subaddress.cpp
|
||||
subaddress_account.cpp
|
||||
unsigned_transaction.cpp
|
||||
coins.cpp
|
||||
coins_info.cpp)
|
||||
|
||||
set(wallet_api_headers
|
||||
wallet2_api.h)
|
||||
set(wallet_api_headers wallet2_api.h)
|
||||
|
||||
set(wallet_api_private_headers
|
||||
wallet.h
|
||||
wallet_manager.h
|
||||
transaction_info.h
|
||||
transaction_history.h
|
||||
transaction_construction_info.h
|
||||
pending_transaction_info.h
|
||||
pending_transaction.h
|
||||
common_defines.h
|
||||
address_book.h
|
||||
subaddress.h
|
||||
subaddress_account.h
|
||||
unsigned_transaction.h
|
||||
coins.h
|
||||
coins_info.h)
|
||||
wallet.h
|
||||
wallet_manager.h
|
||||
transaction_info.h
|
||||
transaction_history.h
|
||||
transaction_construction_info.h
|
||||
pending_transaction_info.h
|
||||
pending_transaction.h
|
||||
common_defines.h
|
||||
address_book.h
|
||||
subaddress.h
|
||||
subaddress_account.h
|
||||
unsigned_transaction.h
|
||||
coins.h
|
||||
coins_info.h)
|
||||
|
||||
add_library(wallet_api ${wallet_api_sources})
|
||||
|
||||
monero_private_headers(wallet_api
|
||||
${wallet_api_private_headers})
|
||||
monero_add_library(wallet_api
|
||||
${wallet_api_sources}
|
||||
${wallet_api_headers}
|
||||
${wallet_api_private_headers})
|
||||
target_link_libraries(wallet_api
|
||||
PUBLIC
|
||||
wallet
|
||||
common
|
||||
cryptonote_core
|
||||
mnemonics
|
||||
${LMDB_LIBRARY}
|
||||
${Boost_CHRONO_LIBRARY}
|
||||
${Boost_LOCALE_LIBRARY}
|
||||
${ICU_LIBRARIES}
|
||||
${Boost_SERIALIZATION_LIBRARY}
|
||||
${Boost_FILESYSTEM_LIBRARY}
|
||||
${Boost_SYSTEM_LIBRARY}
|
||||
${Boost_THREAD_LIBRARY}
|
||||
${CMAKE_THREAD_LIBS_INIT}
|
||||
${Boost_REGEX_LIBRARY}
|
||||
PRIVATE
|
||||
${EXTRA_LIBRARIES})
|
||||
lmdb
|
||||
Boost::chrono
|
||||
Boost::program_options
|
||||
Boost::filesystem
|
||||
Boost::thread
|
||||
Boost::locale
|
||||
Boost::serialization
|
||||
Boost::system
|
||||
Boost::regex
|
||||
${ICU_LIBRARIES})
|
||||
|
||||
set_property(TARGET wallet_api PROPERTY EXCLUDE_FROM_ALL TRUE)
|
||||
set_property(TARGET obj_wallet_api PROPERTY EXCLUDE_FROM_ALL TRUE)
|
||||
target_include_directories(wallet_api
|
||||
PRIVATE ${OPENSSL_INCLUDE_DIR}
|
||||
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/>)
|
||||
|
||||
if(IOS)
|
||||
set(lib_folder lib-${ARCH})
|
||||
else()
|
||||
set(lib_folder lib)
|
||||
endif()
|
||||
target_sources(wallet_api
|
||||
PRIVATE
|
||||
${wallet_api_sources})
|
||||
|
||||
install(FILES ${wallet_api_headers}
|
||||
DESTINATION include/wallet/api)
|
||||
monero_install_library(wallet_api
|
||||
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/monero/wallet/api/"
|
||||
HEADERS "${wallet_api_headers}")
|
||||
|
||||
@@ -84,6 +84,7 @@ namespace Monero {
|
||||
ci->m_unlocked = m_wallet->m_wallet->is_transfer_unlocked(td);
|
||||
ci->m_pubKey = string_tools::pod_to_hex(td.get_public_key());
|
||||
ci->m_coinbase = td.m_tx.vin.size() == 1 && td.m_tx.vin[0].type() == typeid(cryptonote::txin_gen);
|
||||
ci->m_description = m_wallet->m_wallet->get_tx_note(td.m_txid);
|
||||
|
||||
m_rows.push_back(ci);
|
||||
}
|
||||
|
||||
@@ -113,6 +113,10 @@ namespace Monero {
|
||||
bool CoinsInfoImpl::coinbase() const {
|
||||
return m_coinbase;
|
||||
}
|
||||
|
||||
string CoinsInfoImpl::description() const {
|
||||
return m_description;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
namespace Bitmonero = Monero;
|
||||
|
||||
@@ -35,6 +35,7 @@ namespace Monero {
|
||||
virtual bool unlocked() const override;
|
||||
virtual std::string pubKey() const override;
|
||||
virtual bool coinbase() const override;
|
||||
virtual std::string description() const override;
|
||||
|
||||
private:
|
||||
uint64_t m_blockHeight;
|
||||
@@ -57,6 +58,7 @@ namespace Monero {
|
||||
bool m_unlocked;
|
||||
std::string m_pubKey;
|
||||
bool m_coinbase;
|
||||
std::string m_description;
|
||||
|
||||
friend class CoinsImpl;
|
||||
|
||||
|
||||
@@ -79,6 +79,22 @@ std::vector<std::string> PendingTransactionImpl::txid() const
|
||||
return txid;
|
||||
}
|
||||
|
||||
std::vector<std::string> PendingTransactionImpl::hex() const
|
||||
{
|
||||
std::vector<std::string> hexs;
|
||||
for (const auto &pt: m_pending_tx)
|
||||
hexs.push_back(epee::string_tools::buff_to_hex_nodelimer(cryptonote::tx_to_blob(pt.tx)));
|
||||
return hexs;
|
||||
}
|
||||
|
||||
std::vector<std::string> PendingTransactionImpl::txKey() const
|
||||
{
|
||||
std::vector<std::string> keys;
|
||||
for (const auto& pt: m_pending_tx)
|
||||
keys.push_back(epee::string_tools::pod_to_hex(pt.tx_key));
|
||||
return keys;
|
||||
}
|
||||
|
||||
bool PendingTransactionImpl::commit(const std::string &filename, bool overwrite)
|
||||
{
|
||||
|
||||
|
||||
@@ -66,6 +66,8 @@ public:
|
||||
std::string multisigSignData() override;
|
||||
void signMultisigTx() override;
|
||||
std::vector<std::string> signersKeys() const override;
|
||||
std::vector<std::string> hex() const override;
|
||||
std::vector<std::string> txKey() const override;
|
||||
|
||||
private:
|
||||
friend class WalletImpl;
|
||||
|
||||
@@ -434,6 +434,9 @@ WalletImpl::WalletImpl(NetworkType nettype, uint64_t kdf_rounds)
|
||||
|
||||
m_refreshIntervalMillis = DEFAULT_REFRESH_INTERVAL_MILLIS;
|
||||
|
||||
m_refreshThread = boost::thread([this] () {
|
||||
this->refreshThreadFunc();
|
||||
});
|
||||
}
|
||||
|
||||
WalletImpl::~WalletImpl()
|
||||
@@ -1208,8 +1211,8 @@ UnsignedTransaction *WalletImpl::loadUnsignedTxFromStr(const std::string &unsign
|
||||
|
||||
// Check tx data and construct confirmation message
|
||||
std::string extra_message;
|
||||
if (!transaction->m_unsigned_tx_set.transfers.second.empty())
|
||||
extra_message = (boost::format("%u outputs to import. ") % (unsigned)transaction->m_unsigned_tx_set.transfers.second.size()).str();
|
||||
if (!std::get<2>(transaction->m_unsigned_tx_set.transfers).empty())
|
||||
extra_message = (boost::format("%u outputs to import. ") % (unsigned)std::get<2>(transaction->m_unsigned_tx_set.transfers).size()).str();
|
||||
transaction->checkLoadedTx([&transaction](){return transaction->m_unsigned_tx_set.txes.size();}, [&transaction](size_t n)->const tools::wallet2::tx_construction_data&{return transaction->m_unsigned_tx_set.txes[n];}, extra_message);
|
||||
setStatus(transaction->status(), transaction->errorString());
|
||||
|
||||
@@ -1677,13 +1680,13 @@ PendingTransaction* WalletImpl::restoreMultisigTransaction(const string& signDat
|
||||
// - unconfirmed_transfer_details;
|
||||
// - confirmed_transfer_details)
|
||||
|
||||
PendingTransaction *WalletImpl::createTransactionMultDest(const std::vector<string> &dst_addr, const string &payment_id, optional<std::vector<uint64_t>> amount, uint32_t mixin_count, PendingTransaction::Priority priority, uint32_t subaddr_account, std::set<uint32_t> subaddr_indices)
|
||||
PendingTransaction *WalletImpl::createTransactionMultDest(const std::vector<string> &dst_addr, const string &payment_id, optional<std::vector<uint64_t>> amount, uint32_t mixin_count, PendingTransaction::Priority priority, uint32_t subaddr_account, std::set<uint32_t> subaddr_indices, const std::set<std::string> &preferred_inputs)
|
||||
|
||||
{
|
||||
clearStatus();
|
||||
// Pause refresh thread while creating transaction
|
||||
pauseRefresh();
|
||||
|
||||
|
||||
cryptonote::address_parse_info info;
|
||||
|
||||
uint32_t adjusted_priority = m_wallet->adjust_priority(static_cast<uint32_t>(priority));
|
||||
@@ -1743,6 +1746,19 @@ PendingTransaction *WalletImpl::createTransactionMultDest(const std::vector<stri
|
||||
}
|
||||
}
|
||||
}
|
||||
std::vector<crypto::key_image> preferred_input_list;
|
||||
if (!preferred_inputs.empty()) {
|
||||
for (const auto &public_key : preferred_inputs) {
|
||||
crypto::key_image keyImage;
|
||||
bool r = epee::string_tools::hex_to_pod(public_key, keyImage);
|
||||
if (!r) {
|
||||
error = true;
|
||||
setStatusError(tr("failed to parse key image"));
|
||||
break;
|
||||
}
|
||||
preferred_input_list.push_back(keyImage);
|
||||
}
|
||||
}
|
||||
if (error) {
|
||||
break;
|
||||
}
|
||||
@@ -1757,11 +1773,11 @@ PendingTransaction *WalletImpl::createTransactionMultDest(const std::vector<stri
|
||||
if (amount) {
|
||||
transaction->m_pending_tx = m_wallet->create_transactions_2(dsts, fake_outs_count, 0 /* unlock_time */,
|
||||
adjusted_priority,
|
||||
extra, subaddr_account, subaddr_indices);
|
||||
extra, subaddr_account, subaddr_indices, preferred_input_list);
|
||||
} else {
|
||||
transaction->m_pending_tx = m_wallet->create_transactions_all(0, info.address, info.is_subaddress, 1, fake_outs_count, 0 /* unlock_time */,
|
||||
adjusted_priority,
|
||||
extra, subaddr_account, subaddr_indices);
|
||||
extra, subaddr_account, subaddr_indices, preferred_input_list);
|
||||
}
|
||||
pendingTxPostProcess(transaction);
|
||||
|
||||
@@ -1842,10 +1858,10 @@ PendingTransaction *WalletImpl::createTransactionMultDest(const std::vector<stri
|
||||
}
|
||||
|
||||
PendingTransaction *WalletImpl::createTransaction(const string &dst_addr, const string &payment_id, optional<uint64_t> amount, uint32_t mixin_count,
|
||||
PendingTransaction::Priority priority, uint32_t subaddr_account, std::set<uint32_t> subaddr_indices)
|
||||
PendingTransaction::Priority priority, uint32_t subaddr_account, std::set<uint32_t> subaddr_indices, const std::set<std::string> &preferred_inputs)
|
||||
|
||||
{
|
||||
return createTransactionMultDest(std::vector<string> {dst_addr}, payment_id, amount ? (std::vector<uint64_t> {*amount}) : (optional<std::vector<uint64_t>>()), mixin_count, priority, subaddr_account, subaddr_indices);
|
||||
return createTransactionMultDest(std::vector<string> {dst_addr}, payment_id, amount ? (std::vector<uint64_t> {*amount}) : (optional<std::vector<uint64_t>>()), mixin_count, priority, subaddr_account, subaddr_indices, preferred_inputs);
|
||||
}
|
||||
|
||||
PendingTransaction *WalletImpl::createTransactionSingle(const string &key_image, const string &dst_addr,
|
||||
@@ -2585,7 +2601,7 @@ void WalletImpl::doRefresh()
|
||||
LOG_PRINT_L3(__FUNCTION__ << ": doRefresh, rescan = "<<rescan);
|
||||
if(rescan)
|
||||
m_wallet->rescan_blockchain(false);
|
||||
m_wallet->refresh(trustedDaemon());
|
||||
m_wallet->refresh(true);
|
||||
if (!m_synchronized) {
|
||||
m_synchronized = true;
|
||||
}
|
||||
|
||||
@@ -164,13 +164,14 @@ public:
|
||||
optional<std::vector<uint64_t>> amount, uint32_t mixin_count,
|
||||
PendingTransaction::Priority priority = PendingTransaction::Priority_Low,
|
||||
uint32_t subaddr_account = 0,
|
||||
std::set<uint32_t> subaddr_indices = {}) override;
|
||||
std::set<uint32_t> subaddr_indices = {},
|
||||
const std::set<std::string> &preferred_inputs = {}) override;
|
||||
PendingTransaction * createTransaction(const std::string &dst_addr, const std::string &payment_id,
|
||||
optional<uint64_t> amount, uint32_t mixin_count,
|
||||
PendingTransaction::Priority priority = PendingTransaction::Priority_Low,
|
||||
uint32_t subaddr_account = 0,
|
||||
std::set<uint32_t> subaddr_indices = {}) override;
|
||||
|
||||
std::set<uint32_t> subaddr_indices = {},
|
||||
const std::set<std::string> &preferred_inputs = {}) override;
|
||||
PendingTransaction * createTransactionSingle(const std::string &key_image, const std::string &dst_addr,
|
||||
size_t outputs = 1, PendingTransaction::Priority priority = PendingTransaction::Priority_Low) override;
|
||||
|
||||
|
||||
@@ -174,6 +174,8 @@ struct PendingTransaction
|
||||
* @return vector of base58-encoded signers' public keys
|
||||
*/
|
||||
virtual std::vector<std::string> signersKeys() const = 0;
|
||||
virtual std::vector<std::string> hex() const = 0;
|
||||
virtual std::vector<std::string> txKey() const = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -340,6 +342,7 @@ struct CoinsInfo
|
||||
virtual bool unlocked() const = 0;
|
||||
virtual std::string pubKey() const = 0;
|
||||
virtual bool coinbase() const = 0;
|
||||
virtual std::string description() const = 0;
|
||||
};
|
||||
|
||||
struct Coins
|
||||
@@ -932,6 +935,7 @@ struct Wallet
|
||||
* \param subaddr_account subaddress account from which the input funds are taken
|
||||
* \param subaddr_indices set of subaddress indices to use for transfer or sweeping. if set empty, all are chosen when sweeping, and one or more are automatically chosen when transferring. after execution, returns the set of actually used indices
|
||||
* \param priority
|
||||
* \param preferred_inputs optional set of key_image strings from preferred inputs
|
||||
* \return PendingTransaction object. caller is responsible to check PendingTransaction::status()
|
||||
* after object returned
|
||||
*/
|
||||
@@ -940,7 +944,7 @@ struct Wallet
|
||||
optional<std::vector<uint64_t>> amount, uint32_t mixin_count,
|
||||
PendingTransaction::Priority = PendingTransaction::Priority_Low,
|
||||
uint32_t subaddr_account = 0,
|
||||
std::set<uint32_t> subaddr_indices = {}) = 0;
|
||||
std::set<uint32_t> subaddr_indices = {}, const std::set<std::string> &preferred_inputs = {}) = 0;
|
||||
|
||||
/*!
|
||||
* \brief createTransaction creates transaction. if dst_addr is an integrated address, payment_id is ignored
|
||||
@@ -951,6 +955,7 @@ struct Wallet
|
||||
* \param subaddr_account subaddress account from which the input funds are taken
|
||||
* \param subaddr_indices set of subaddress indices to use for transfer or sweeping. if set empty, all are chosen when sweeping, and one or more are automatically chosen when transferring. after execution, returns the set of actually used indices
|
||||
* \param priority
|
||||
* \param preferred_inputs optional set of key_image strings from preferred inputs
|
||||
* \return PendingTransaction object. caller is responsible to check PendingTransaction::status()
|
||||
* after object returned
|
||||
*/
|
||||
@@ -959,7 +964,8 @@ struct Wallet
|
||||
optional<uint64_t> amount, uint32_t mixin_count,
|
||||
PendingTransaction::Priority = PendingTransaction::Priority_Low,
|
||||
uint32_t subaddr_account = 0,
|
||||
std::set<uint32_t> subaddr_indices = {}) = 0;
|
||||
std::set<uint32_t> subaddr_indices = {},
|
||||
const std::set<std::string> &preferred_inputs = {}) = 0;
|
||||
|
||||
/*!
|
||||
* \brief createTransactionSingle creates transaction with single input
|
||||
|
||||
@@ -90,7 +90,6 @@ using namespace epee;
|
||||
#include "ringct/rctSigs.h"
|
||||
#include "ringdb.h"
|
||||
#include "device/device_cold.hpp"
|
||||
#include "device_trezor/device_trezor.hpp"
|
||||
#include "net/socks_connect.h"
|
||||
|
||||
extern "C"
|
||||
@@ -218,6 +217,17 @@ namespace
|
||||
return reason;
|
||||
}
|
||||
|
||||
bool is_preferred_input(const std::vector<crypto::key_image>& preferred_input_list, const crypto::key_image& input) {
|
||||
bool res = true;
|
||||
if (preferred_input_list.size() > 0) {
|
||||
auto it = std::find(preferred_input_list.begin(), preferred_input_list.end(), input);
|
||||
if (it == preferred_input_list.end()) {
|
||||
res = false;
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
size_t get_num_outputs(const std::vector<cryptonote::tx_destination_entry> &dsts, const std::vector<tools::wallet2::transfer_details> &transfers, const std::vector<size_t> &selected_transfers)
|
||||
{
|
||||
size_t outputs = dsts.size();
|
||||
@@ -8660,9 +8670,7 @@ crypto::chacha_key wallet2::get_ringdb_key()
|
||||
return *m_ringdb_key;
|
||||
}
|
||||
|
||||
void wallet2::register_devices(){
|
||||
hw::trezor::register_all();
|
||||
}
|
||||
void wallet2::register_devices(){}
|
||||
|
||||
hw::device& wallet2::lookup_device(const std::string & device_descriptor){
|
||||
if (!m_devices_registered){
|
||||
@@ -10264,7 +10272,7 @@ void wallet2::transfer_selected_rct(std::vector<cryptonote::tx_destination_entry
|
||||
LOG_PRINT_L2("transfer_selected_rct done");
|
||||
}
|
||||
|
||||
std::vector<size_t> wallet2::pick_preferred_rct_inputs(uint64_t needed_money, uint32_t subaddr_account, const std::set<uint32_t> &subaddr_indices)
|
||||
std::vector<size_t> wallet2::pick_preferred_rct_inputs(uint64_t needed_money, uint32_t subaddr_account, const std::set<uint32_t> &subaddr_indices, const std::vector<crypto::key_image>& preferred_input_list)
|
||||
{
|
||||
std::vector<size_t> picks;
|
||||
float current_output_relatdness = 1.0f;
|
||||
@@ -10275,6 +10283,10 @@ std::vector<size_t> wallet2::pick_preferred_rct_inputs(uint64_t needed_money, ui
|
||||
for (size_t i = 0; i < m_transfers.size(); ++i)
|
||||
{
|
||||
const transfer_details& td = m_transfers[i];
|
||||
if (!is_preferred_input(preferred_input_list, td.m_key_image)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!is_spent(td, false) && !td.m_frozen && td.is_rct() && td.amount() >= needed_money && is_transfer_unlocked(td) && td.m_subaddr_index.major == subaddr_account && subaddr_indices.count(td.m_subaddr_index.minor) == 1)
|
||||
{
|
||||
if (td.amount() > m_ignore_outputs_above || td.amount() < m_ignore_outputs_below)
|
||||
@@ -10295,6 +10307,10 @@ std::vector<size_t> wallet2::pick_preferred_rct_inputs(uint64_t needed_money, ui
|
||||
for (size_t i = 0; i < m_transfers.size(); ++i)
|
||||
{
|
||||
const transfer_details& td = m_transfers[i];
|
||||
if (!is_preferred_input(preferred_input_list, td.m_key_image)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!is_spent(td, false) && !td.m_frozen && !td.m_key_image_partial && td.is_rct() && is_transfer_unlocked(td) && td.m_subaddr_index.major == subaddr_account && subaddr_indices.count(td.m_subaddr_index.minor) == 1)
|
||||
{
|
||||
if (td.amount() > m_ignore_outputs_above || td.amount() < m_ignore_outputs_below)
|
||||
@@ -10306,6 +10322,10 @@ std::vector<size_t> wallet2::pick_preferred_rct_inputs(uint64_t needed_money, ui
|
||||
for (size_t j = i + 1; j < m_transfers.size(); ++j)
|
||||
{
|
||||
const transfer_details& td2 = m_transfers[j];
|
||||
if (!is_preferred_input(preferred_input_list, td.m_key_image)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (td2.amount() > m_ignore_outputs_above || td2.amount() < m_ignore_outputs_below)
|
||||
{
|
||||
MDEBUG("Ignoring output " << j << " of amount " << print_money(td2.amount()) << " which is outside prescribed range [" << print_money(m_ignore_outputs_below) << ", " << print_money(m_ignore_outputs_above) << "]");
|
||||
@@ -10878,7 +10898,7 @@ bool wallet2::light_wallet_key_image_is_ours(const crypto::key_image& key_image,
|
||||
// This system allows for sending (almost) the entire balance, since it does
|
||||
// not generate spurious change in all txes, thus decreasing the instantaneous
|
||||
// usable balance.
|
||||
std::vector<wallet2::pending_tx> wallet2::create_transactions_2(std::vector<cryptonote::tx_destination_entry> dsts, const size_t fake_outs_count, const uint64_t unlock_time, uint32_t priority, const std::vector<uint8_t>& extra, uint32_t subaddr_account, std::set<uint32_t> subaddr_indices)
|
||||
std::vector<wallet2::pending_tx> wallet2::create_transactions_2(std::vector<cryptonote::tx_destination_entry> dsts, const size_t fake_outs_count, const uint64_t unlock_time, uint32_t priority, const std::vector<uint8_t>& extra, uint32_t subaddr_account, std::set<uint32_t> subaddr_indices, const std::vector<crypto::key_image>& preferred_input_list)
|
||||
{
|
||||
//ensure device is let in NONE mode in any case
|
||||
hw::device &hwdev = m_account.get_device();
|
||||
@@ -11019,6 +11039,10 @@ std::vector<wallet2::pending_tx> wallet2::create_transactions_2(std::vector<cryp
|
||||
for (size_t i = 0; i < m_transfers.size(); ++i)
|
||||
{
|
||||
const transfer_details& td = m_transfers[i];
|
||||
if (!is_preferred_input(preferred_input_list, td.m_key_image)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m_ignore_fractional_outputs && td.amount() < fractional_threshold)
|
||||
{
|
||||
MDEBUG("Ignoring output " << i << " of amount " << print_money(td.amount()) << " which is below fractional threshold " << print_money(fractional_threshold));
|
||||
@@ -11103,7 +11127,7 @@ std::vector<wallet2::pending_tx> wallet2::create_transactions_2(std::vector<cryp
|
||||
// this is used to build a tx that's 1 or 2 inputs, and 2 outputs, which
|
||||
// will get us a known fee.
|
||||
uint64_t estimated_fee = estimate_fee(use_per_byte_fee, use_rct, 2, fake_outs_count, 2, extra.size(), bulletproof, clsag, bulletproof_plus, use_view_tags, base_fee, fee_quantization_mask);
|
||||
preferred_inputs = pick_preferred_rct_inputs(needed_money + estimated_fee, subaddr_account, subaddr_indices);
|
||||
preferred_inputs = pick_preferred_rct_inputs(needed_money + estimated_fee, subaddr_account, subaddr_indices, preferred_input_list);
|
||||
if (!preferred_inputs.empty())
|
||||
{
|
||||
string s;
|
||||
@@ -11139,7 +11163,7 @@ std::vector<wallet2::pending_tx> wallet2::create_transactions_2(std::vector<cryp
|
||||
unsigned int original_output_index = 0;
|
||||
std::vector<size_t>* unused_transfers_indices = &unused_transfers_indices_per_subaddr[0].second;
|
||||
std::vector<size_t>* unused_dust_indices = &unused_dust_indices_per_subaddr[0].second;
|
||||
|
||||
|
||||
hwdev.set_mode(hw::device::TRANSACTION_CREATE_FAKE);
|
||||
while ((!dsts.empty() && dsts[0].amount > 0) || adding_fee || !preferred_inputs.empty() || should_pick_a_second_output(use_rct, txes.back().selected_transfers.size(), *unused_transfers_indices, *unused_dust_indices)) {
|
||||
TX &tx = txes.back();
|
||||
@@ -11536,7 +11560,7 @@ bool wallet2::sanity_check(const std::vector<wallet2::pending_tx> &ptx_vector, s
|
||||
return true;
|
||||
}
|
||||
|
||||
std::vector<wallet2::pending_tx> wallet2::create_transactions_all(uint64_t below, const cryptonote::account_public_address &address, bool is_subaddress, const size_t outputs, const size_t fake_outs_count, const uint64_t unlock_time, uint32_t priority, const std::vector<uint8_t>& extra, uint32_t subaddr_account, std::set<uint32_t> subaddr_indices)
|
||||
std::vector<wallet2::pending_tx> wallet2::create_transactions_all(uint64_t below, const cryptonote::account_public_address &address, bool is_subaddress, const size_t outputs, const size_t fake_outs_count, const uint64_t unlock_time, uint32_t priority, const std::vector<uint8_t>& extra, uint32_t subaddr_account, std::set<uint32_t> subaddr_indices, const std::vector<crypto::key_image>& preferred_input_list)
|
||||
{
|
||||
std::vector<size_t> unused_transfers_indices;
|
||||
std::vector<size_t> unused_dust_indices;
|
||||
@@ -11565,6 +11589,10 @@ std::vector<wallet2::pending_tx> wallet2::create_transactions_all(uint64_t below
|
||||
for (size_t i = 0; i < m_transfers.size(); ++i)
|
||||
{
|
||||
const transfer_details& td = m_transfers[i];
|
||||
if (!is_preferred_input(preferred_input_list, td.m_key_image)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m_ignore_fractional_outputs && td.amount() < fractional_threshold)
|
||||
{
|
||||
MDEBUG("Ignoring output " << i << " of amount " << print_money(td.amount()) << " which is below threshold " << print_money(fractional_threshold));
|
||||
@@ -11759,7 +11787,7 @@ std::vector<wallet2::pending_tx> wallet2::create_transactions_from(const crypton
|
||||
THROW_WALLET_EXCEPTION_IF(needed_fee > available_for_fee, error::wallet_internal_error, "Transaction cannot pay for itself");
|
||||
|
||||
do {
|
||||
LOG_PRINT_L2("We made a tx, adjusting fee and saving it");
|
||||
LOG_PRINT_L2("We made a tx, adjusting fee and saving it, we need " << print_money(needed_fee) << " and we have " << print_money(test_ptx.fee));
|
||||
// distribute total transferred amount between outputs
|
||||
uint64_t amount_transferred = available_for_fee - needed_fee;
|
||||
uint64_t dt_amount = amount_transferred / outputs;
|
||||
|
||||
@@ -1112,8 +1112,8 @@ private:
|
||||
bool parse_unsigned_tx_from_str(const std::string &unsigned_tx_st, unsigned_tx_set &exported_txs) const;
|
||||
bool load_tx(const std::string &signed_filename, std::vector<tools::wallet2::pending_tx> &ptx, std::function<bool(const signed_tx_set&)> accept_func = NULL);
|
||||
bool parse_tx_from_str(const std::string &signed_tx_st, std::vector<tools::wallet2::pending_tx> &ptx, std::function<bool(const signed_tx_set &)> accept_func);
|
||||
std::vector<wallet2::pending_tx> create_transactions_2(std::vector<cryptonote::tx_destination_entry> dsts, const size_t fake_outs_count, const uint64_t unlock_time, uint32_t priority, const std::vector<uint8_t>& extra, uint32_t subaddr_account, std::set<uint32_t> subaddr_indices); // pass subaddr_indices by value on purpose
|
||||
std::vector<wallet2::pending_tx> create_transactions_all(uint64_t below, const cryptonote::account_public_address &address, bool is_subaddress, const size_t outputs, const size_t fake_outs_count, const uint64_t unlock_time, uint32_t priority, const std::vector<uint8_t>& extra, uint32_t subaddr_account, std::set<uint32_t> subaddr_indices);
|
||||
std::vector<wallet2::pending_tx> create_transactions_2(std::vector<cryptonote::tx_destination_entry> dsts, const size_t fake_outs_count, const uint64_t unlock_time, uint32_t priority, const std::vector<uint8_t>& extra, uint32_t subaddr_account, std::set<uint32_t> subaddr_indices, const std::vector<crypto::key_image>& preferred_input_list = {}); // pass subaddr_indices by value on purpose
|
||||
std::vector<wallet2::pending_tx> create_transactions_all(uint64_t below, const cryptonote::account_public_address &address, bool is_subaddress, const size_t outputs, const size_t fake_outs_count, const uint64_t unlock_time, uint32_t priority, const std::vector<uint8_t>& extra, uint32_t subaddr_account, std::set<uint32_t> subaddr_indices, const std::vector<crypto::key_image>& preferred_input_list = {});
|
||||
std::vector<wallet2::pending_tx> create_transactions_single(const crypto::key_image &ki, const cryptonote::account_public_address &address, bool is_subaddress, const size_t outputs, const size_t fake_outs_count, const uint64_t unlock_time, uint32_t priority, const std::vector<uint8_t>& extra);
|
||||
std::vector<wallet2::pending_tx> create_transactions_from(const cryptonote::account_public_address &address, bool is_subaddress, const size_t outputs, std::vector<size_t> unused_transfers_indices, std::vector<size_t> unused_dust_indices, const size_t fake_outs_count, const uint64_t unlock_time, uint32_t priority, const std::vector<uint8_t>& extra);
|
||||
bool sanity_check(const std::vector<wallet2::pending_tx> &ptx_vector, std::vector<cryptonote::tx_destination_entry> dsts) const;
|
||||
@@ -1797,7 +1797,7 @@ private:
|
||||
std::vector<uint64_t> get_unspent_amounts_vector(bool strict);
|
||||
uint64_t get_dynamic_base_fee_estimate();
|
||||
float get_output_relatedness(const transfer_details &td0, const transfer_details &td1) const;
|
||||
std::vector<size_t> pick_preferred_rct_inputs(uint64_t needed_money, uint32_t subaddr_account, const std::set<uint32_t> &subaddr_indices);
|
||||
std::vector<size_t> pick_preferred_rct_inputs(uint64_t needed_money, uint32_t subaddr_account, const std::set<uint32_t> &subaddr_indices, const std::vector<crypto::key_image>& preferred_input_list);
|
||||
void set_spent(size_t idx, uint64_t height);
|
||||
void set_unspent(size_t idx);
|
||||
bool is_spent(const transfer_details &td, bool strict = true) const;
|
||||
|
||||
@@ -530,6 +530,17 @@ namespace wallet_rpc
|
||||
END_KV_SERIALIZE_MAP()
|
||||
};
|
||||
|
||||
struct amounts_list
|
||||
{
|
||||
std::list<uint64_t> amounts;
|
||||
|
||||
bool operator==(const amounts_list& other) const { return amounts == other.amounts; }
|
||||
|
||||
BEGIN_KV_SERIALIZE_MAP()
|
||||
KV_SERIALIZE(amounts)
|
||||
END_KV_SERIALIZE_MAP()
|
||||
};
|
||||
|
||||
struct single_transfer_response
|
||||
{
|
||||
std::string tx_hash;
|
||||
|
||||
@@ -91,10 +91,6 @@ else ()
|
||||
add_subdirectory(net_load_tests)
|
||||
endif()
|
||||
|
||||
if (BUILD_GUI_DEPS)
|
||||
add_subdirectory(libwallet_api_tests)
|
||||
endif()
|
||||
|
||||
if (TREZOR_DEBUG)
|
||||
add_subdirectory(trezor)
|
||||
endif()
|
||||
|
||||
@@ -52,7 +52,6 @@ target_link_libraries(trezor_tests
|
||||
version
|
||||
epee
|
||||
device
|
||||
device_trezor
|
||||
wallet
|
||||
wallet_api
|
||||
rpc
|
||||
|
||||
Reference in New Issue
Block a user