cmake-rewrite

This commit is contained in:
dsc 2024-03-21 14:47:39 +02:00
parent 66c2b5d8ad
commit e3d8ab8281
70 changed files with 1547 additions and 4762 deletions

15
.gitmodules vendored
View file

@ -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"] [submodule "external/trezor-common"]
active = false active = false
path = external/trezor-common path = external/trezor-common
url = https://github.com/trezor/trezor-common.git url = https://github.com/trezor/trezor-common.git
[submodule "external/supercop"] [submodule "external/supercop"]
path = external/supercop path = external/supercop
url = https://github.com/monero-project/supercop url = https://git.wownero.com/dsc/supercop.git
branch = monero branch = cmake-rewrite
[submodule "external/randomwow"] [submodule "external/randomwow"]
path = external/randomwow path = external/randomwow
url = https://git.wownero.com/wownero/RandomWOW url = https://git.wownero.com/dsc/randomwow.git
branch = 1.2.1-wow branch = cmake-rewrite

File diff suppressed because it is too large Load diff

View file

@ -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;
}

View file

@ -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()

View file

@ -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()

File diff suppressed because it is too large Load diff

View file

@ -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
View 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)

View file

@ -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
View 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
View 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()

View 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)

View file

@ -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()

75
cmake/functions.cmake Normal file
View file

@ -0,0 +1,75 @@
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
#function(monero_register_lib LIB)
# set_property(GLOBAL PROPERTY source_list_property "${source_list}")
#endfunction()
function(monero_install_library LIB)
set(HEADER_DESTINATION "${ARGN}")
set(path_install ${CMAKE_INSTALL_LIBDIR}/cmake/monero)
if(NOT HEADER_DESTINATION)
set(HEADER_DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/monero/")
endif()
install(TARGETS ${LIB} 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/)
# FILE_SET HEADERS DESTINATION ${HEADER_DESTINATION})
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()

View file

@ -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);
}

View file

@ -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;
}

View file

@ -1,7 +0,0 @@
syntax = "proto2";
import "google/protobuf/descriptor.proto";
message Success {
optional string message = 1;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -26,6 +26,5 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF # 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. # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
monero_enable_coverage()
add_subdirectory(epee) add_subdirectory(epee)

View file

@ -27,64 +27,38 @@
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
set(EPEE_INCLUDE_DIR_BASE "${CMAKE_CURRENT_SOURCE_DIR}/../include") 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. file(GLOB EPEE_SOURCES
monero_find_all_headers(EPEE_HEADERS_PUBLIC "${EPEE_INCLUDE_DIR_BASE}") "${CMAKE_CURRENT_SOURCE_DIR}/*.c"
"${CMAKE_CURRENT_SOURCE_DIR}/*.cpp"
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}
) )
if (USE_READLINE AND (GNU_READLINE_FOUND OR (DEPENDS AND NOT MINGW))) add_library(epee)
monero_add_library(epee_readline readline_buffer.cpp) target_sources(epee
endif() PUBLIC
FILE_SET HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../include/
FILES
${EPEE_HEADERS_PUBLIC}
PRIVATE
${EPEE_SOURCES}
)
set_property(SOURCE memwipe.c PROPERTY C_STANDARD 11) 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 target_link_libraries(epee
PUBLIC PUBLIC
easylogging easylogging
${Boost_CHRONO_LIBRARY} Boost::chrono
${Boost_FILESYSTEM_LIBRARY} Boost::filesystem
${Boost_THREAD_LIBRARY} Boost::thread
${Boost_REGEX_LIBRARY} Boost::regex
${Boost_SYSTEM_LIBRARY} Boost::system
${OPENSSL_LIBRARIES} OpenSSL::SSL)
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()
target_include_directories(epee target_include_directories(epee
PUBLIC PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>
"${EPEE_INCLUDE_DIR_BASE}" PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
"${OPENSSL_INCLUDE_DIR}")
monero_install_library(epee "${CMAKE_INSTALL_INCLUDEDIR}/monero/epee/")

View file

@ -28,45 +28,8 @@
# #
# Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers # 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(db_drivers)
add_subdirectory(easylogging++) add_subdirectory(easylogging++)
add_subdirectory(qrcodegen) add_subdirectory(qrcodegen)
add_subdirectory(randomwow EXCLUDE_FROM_ALL) add_subdirectory(randomwow)
add_subdirectory(supercop)

View file

@ -26,40 +26,37 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF # 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. # 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}>
)
target_link_libraries(lmdb PRIVATE Threads::Threads)
if(FREEBSD) if(FREEBSD)
add_definitions(-DMDB_DSYNC=O_SYNC) target_compile_definitions(lmdb PUBLIC MDB_DSYNC=O_SYNC)
endif() endif()
if(ANDROID) if(ANDROID)
add_definitions("-DANDROID=1") target_compile_definitions(lmdb PUBLIC ANDROID=1)
endif() 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) if(${ARCH_WIDTH} EQUAL 32)
target_compile_definitions(lmdb target_compile_definitions(lmdb PUBLIC MDB_VL32=1)
PUBLIC -DMDB_VL32)
endif() endif()
# GUI/libwallet install target set_target_properties(lmdb PROPERTIES
if (BUILD_GUI_DEPS) POSITION_INDEPENDENT_CODE ON
if(IOS) CXX_STANDARD 11
set(lib_folder lib-${ARCH}) CXX_STANDARD_REQUIRED ON
else() )
set(lib_folder lib)
endif() monero_install_library(lmdb)
install(TARGETS lmdb
ARCHIVE DESTINATION ${lib_folder}
LIBRARY DESTINATION ${lib_folder})
endif()
set_property(TARGET lmdb APPEND PROPERTY COMPILE_FLAGS "-fPIC")

View file

@ -26,43 +26,29 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF # 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. # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
cmake_minimum_required(VERSION 3.5) add_library(easylogging)
target_sources(easylogging
PUBLIC
FILE_SET HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}
FILES
${CMAKE_CURRENT_SOURCE_DIR}/easylogging++.h
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/easylogging++.cc
)
project(easylogging CXX) target_compile_definitions(easylogging PUBLIC
AUTO_INITIALIZE_EASYLOGGINGPP
)
set(CMAKE_CXX_STANDARD 11) target_include_directories(easylogging
set(CMAKE_CXX_STANDARD_REQUIRED ON) PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
set(CMAKE_CXX_EXTENSIONS OFF) PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
monero_enable_coverage()
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 target_link_libraries(easylogging
PRIVATE PRIVATE
${CMAKE_THREAD_LIBS_INIT} Threads::Threads
${Backtrace_LIBRARIES}) ${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")
monero_install_library(easylogging)

1
external/miniupnp vendored

@ -1 +0,0 @@
Subproject commit 544e6fcc73c5ad9af48a8985c94f0f1d742ef2e0

View file

@ -1,8 +1,18 @@
project(libqrcodegen) add_library(qrcodegen)
add_library(qrcodegen STATIC QrCode.cpp) target_sources(qrcodegen
set_target_properties(qrcodegen PROPERTIES POSITION_INDEPENDENT_CODE ON) PUBLIC
set_target_properties(qrcodegen PROPERTIES CXX_STANDARD 11) FILE_SET HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}
FILES
${CMAKE_CURRENT_SOURCE_DIR}/QrCode.hpp
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/QrCode.cpp
)
target_include_directories(qrcodegen PUBLIC target_include_directories(qrcodegen
${CMAKE_CURRENT_SOURCE_DIR}) PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
monero_install_library(qrcodegen)

2
external/randomwow vendored

@ -1 +1 @@
Subproject commit 27b099b6dd6fef6e17f58c6dfe00009e9c5df587 Subproject commit bb4ed329c76493cc07a5c5bfae041b28434d9caf

1
external/rapidjson vendored

@ -1 +0,0 @@
Subproject commit 129d19ba7f496df5e33658527a7158c79b99c21c

2
external/supercop vendored

@ -1 +1 @@
Subproject commit 633500ad8c8759995049ccd022107d1fa8a1bbc9 Subproject commit 036511a8bdc0883059d107aeb2910b54ee0a061b

View file

@ -28,60 +28,25 @@
# #
# Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers # 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) include(Version)
monero_add_library(version SOURCES ${CMAKE_BINARY_DIR}/version.cpp DEPENDS genversion) add_library(version)
target_sources(version
PUBLIC
FILE_SET HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}
FILES
${CMAKE_CURRENT_SOURCE_DIR}/version.h
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}>
)
monero_install_library(version)
add_subdirectory(common) add_subdirectory(common)
add_subdirectory(crypto) add_subdirectory(crypto)
@ -96,6 +61,7 @@ add_subdirectory(hardforks)
add_subdirectory(blockchain_db) add_subdirectory(blockchain_db)
add_subdirectory(mnemonics) add_subdirectory(mnemonics)
add_subdirectory(rpc) add_subdirectory(rpc)
#add_subdirectory(test)
if(NOT IOS) if(NOT IOS)
add_subdirectory(serialization) add_subdirectory(serialization)
endif() endif()
@ -110,16 +76,8 @@ if(NOT IOS)
add_subdirectory(daemon) add_subdirectory(daemon)
endif() 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) if(PER_BLOCK_CHECKPOINT)
add_subdirectory(blocks) add_subdirectory(blocks)
endif() endif()
add_subdirectory(device) add_subdirectory(device)
add_subdirectory(device_trezor)

View file

@ -26,28 +26,35 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF # 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. # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
set(blockchain_db_sources file(GLOB BCDB_HEADERS *.h)
blockchain_db.cpp file(GLOB BCDB_SOURCES *.cpp *.c *.cc)
lmdb/db_lmdb.cpp
)
set(blockchain_db_headers) list(APPEND BCDB_SOURCES lmdb/db_lmdb.cpp)
list(APPEND BCDB_HEADERS lmdb/db_lmdb.h)
monero_find_all_headers(blockchain_db_private_headers "${CMAKE_CURRENT_SOURCE_DIR}") add_library(blockchain_db)
target_sources(blockchain_db
monero_private_headers(blockchain_db PUBLIC
${crypto_private_headers}) FILE_SET HEADERS
monero_add_library(blockchain_db BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../
${blockchain_db_sources} FILES
${blockchain_db_headers} ${BCDB_HEADERS}
${blockchain_db_private_headers}) PRIVATE
${BCDB_SOURCES}
)
target_link_libraries(blockchain_db target_link_libraries(blockchain_db
PUBLIC PUBLIC
common common
cncrypto cncrypto
ringct ringct
${LMDB_LIBRARY} lmdb
${Boost_FILESYSTEM_LIBRARY} Boost::filesystem
${Boost_THREAD_LIBRARY} Boost::thread)
PRIVATE
${EXTRA_LIBRARIES}) 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}>
)
monero_install_library(blockchain_db "${CMAKE_INSTALL_INCLUDEDIR}/monero/blockchain_db/")

View file

@ -158,7 +158,7 @@ endif()
set_property(TARGET blockchain_import set_property(TARGET blockchain_import
PROPERTY PROPERTY
OUTPUT_NAME "wownero-blockchain-import") OUTPUT_NAME "wownero-blockchain-import")
install(TARGETS blockchain_import DESTINATION bin) install(TARGETS blockchain_import DESTINATION ${CMAKE_INSTALL_BINDIR})
monero_add_executable(blockchain_export monero_add_executable(blockchain_export
${blockchain_export_sources} ${blockchain_export_sources}
@ -179,7 +179,7 @@ target_link_libraries(blockchain_export
set_property(TARGET blockchain_export set_property(TARGET blockchain_export
PROPERTY PROPERTY
OUTPUT_NAME "wownero-blockchain-export") OUTPUT_NAME "wownero-blockchain-export")
install(TARGETS blockchain_export DESTINATION bin) install(TARGETS blockchain_export DESTINATION ${CMAKE_INSTALL_BINDIR})
monero_add_executable(blockchain_blackball monero_add_executable(blockchain_blackball
${blockchain_blackball_sources} ${blockchain_blackball_sources}
@ -201,7 +201,7 @@ target_link_libraries(blockchain_blackball
set_property(TARGET blockchain_blackball set_property(TARGET blockchain_blackball
PROPERTY PROPERTY
OUTPUT_NAME "wownero-blockchain-mark-spent-outputs") 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 monero_add_executable(blockchain_usage
@ -223,7 +223,7 @@ target_link_libraries(blockchain_usage
set_property(TARGET blockchain_usage set_property(TARGET blockchain_usage
PROPERTY PROPERTY
OUTPUT_NAME "wownero-blockchain-usage") OUTPUT_NAME "wownero-blockchain-usage")
install(TARGETS blockchain_usage DESTINATION bin) install(TARGETS blockchain_usage DESTINATION ${CMAKE_INSTALL_BINDIR})
monero_add_executable(blockchain_ancestry monero_add_executable(blockchain_ancestry
${blockchain_ancestry_sources} ${blockchain_ancestry_sources}
@ -244,7 +244,7 @@ target_link_libraries(blockchain_ancestry
set_property(TARGET blockchain_ancestry set_property(TARGET blockchain_ancestry
PROPERTY PROPERTY
OUTPUT_NAME "wownero-blockchain-ancestry") OUTPUT_NAME "wownero-blockchain-ancestry")
install(TARGETS blockchain_ancestry DESTINATION bin) install(TARGETS blockchain_ancestry DESTINATION ${CMAKE_INSTALL_BINDIR})
monero_add_executable(blockchain_depth monero_add_executable(blockchain_depth
${blockchain_depth_sources} ${blockchain_depth_sources}
@ -265,7 +265,7 @@ target_link_libraries(blockchain_depth
set_property(TARGET blockchain_depth set_property(TARGET blockchain_depth
PROPERTY PROPERTY
OUTPUT_NAME "wownero-blockchain-depth") OUTPUT_NAME "wownero-blockchain-depth")
install(TARGETS blockchain_depth DESTINATION bin) install(TARGETS blockchain_depth DESTINATION ${CMAKE_INSTALL_BINDIR})
monero_add_executable(blockchain_stats monero_add_executable(blockchain_stats
${blockchain_stats_sources} ${blockchain_stats_sources}
@ -286,7 +286,7 @@ target_link_libraries(blockchain_stats
set_property(TARGET blockchain_stats set_property(TARGET blockchain_stats
PROPERTY PROPERTY
OUTPUT_NAME "wownero-blockchain-stats") 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 monero_add_executable(blockchain_prune_known_spent_data
${blockchain_prune_known_spent_data_sources} ${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 set_property(TARGET blockchain_prune_known_spent_data
PROPERTY PROPERTY
OUTPUT_NAME "wownero-blockchain-prune-known-spent-data") 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 monero_add_executable(blockchain_prune
${blockchain_prune_sources} ${blockchain_prune_sources}
@ -317,7 +317,7 @@ monero_add_executable(blockchain_prune
set_property(TARGET blockchain_prune set_property(TARGET blockchain_prune
PROPERTY PROPERTY
OUTPUT_NAME "wownero-blockchain-prune") OUTPUT_NAME "wownero-blockchain-prune")
install(TARGETS blockchain_prune DESTINATION bin) install(TARGETS blockchain_prune DESTINATION ${CMAKE_INSTALL_BINDIR})
target_link_libraries(blockchain_prune target_link_libraries(blockchain_prune
PRIVATE PRIVATE

View file

@ -57,4 +57,22 @@ foreach(BLOB_NAME checkpoints)
) )
endforeach() endforeach()
monero_add_library(blocks blocks.cpp ${GENERATED_SOURCES}) add_library(blocks)
target_sources(blocks
PUBLIC
FILE_SET HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}
FILES
${CMAKE_CURRENT_SOURCE_DIR}/blocks.h
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}>
)
monero_install_library(blocks "${CMAKE_INSTALL_INCLUDEDIR}/monero/blocks/")

View file

@ -26,38 +26,30 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF # 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. # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
if(APPLE) add_library(checkpoints)
if(DEPENDS) target_sources(checkpoints
list(APPEND EXTRA_LIBRARIES "-framework Foundation -framework ApplicationServices -framework AppKit -framework IOKit") PUBLIC
else() FILE_SET HEADERS
find_library(IOKIT_LIBRARY IOKit) BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}
mark_as_advanced(IOKIT_LIBRARY) FILES
list(APPEND EXTRA_LIBRARIES ${IOKIT_LIBRARY}) ${CMAKE_CURRENT_SOURCE_DIR}/checkpoints.h
endif() PRIVATE
endif() ${CMAKE_CURRENT_SOURCE_DIR}/checkpoints.cpp
)
set(checkpoints_sources target_link_libraries(checkpoints PUBLIC
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
common common
cncrypto cncrypto
${Boost_DATE_TIME_LIBRARY} Boost::date_time
${Boost_PROGRAM_OPTIONS_LIBRARY} Boost::program_options
${Boost_SERIALIZATION_LIBRARY} Boost::serialization
${Boost_FILESYSTEM_LIBRARY} Boost::filesystem
${Boost_SYSTEM_LIBRARY} Boost::system
${Boost_THREAD_LIBRARY} Boost::thread)
PRIVATE
${EXTRA_LIBRARIES}) target_include_directories(checkpoints
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
monero_install_library(checkpoints "${CMAKE_INSTALL_INCLUDEDIR}/monero/checkpoints/")

View file

@ -26,61 +26,47 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF # 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. # 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")
file(GLOB COMMON_HEADERS "*.h")
set(common_sources add_library(common)
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)
if (STACK_TRACE) target_sources(common
list(APPEND common_sources stack_trace.cpp) PUBLIC
endif() FILE_SET HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}
FILES
${COMMON_HEADERS}
PRIVATE
${COMMON_SOURCES}
)
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 target_link_libraries(common
PUBLIC PUBLIC
cncrypto cncrypto
${UNBOUND_LIBRARIES} easylogging
${LIBUNWIND_LIBRARIES} Libunbound::Libunbound
${Boost_DATE_TIME_LIBRARY} Boost::chrono
${Boost_FILESYSTEM_LIBRARY} Boost::date_time
${Boost_SYSTEM_LIBRARY} Boost::filesystem
${Boost_THREAD_LIBRARY} Boost::thread
${Boost_REGEX_LIBRARY} Boost::regex
${Boost_CHRONO_LIBRARY} Boost::system
PRIVATE PRIVATE
${OPENSSL_LIBRARIES} OpenSSL::SSL
${EXTRA_LIBRARIES}) OpenSSL::Crypto)
#monero_install_headers(common target_include_directories(common
# ${common_headers}) PRIVATE ${LIBUNBOUND_INCLUDE_DIR}
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../>
PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/translations>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
if(STATIC)
target_compile_definitions(common PUBLIC STATICLIB=1)
endif()
add_dependencies(common generate_translations_header)
monero_install_library(common "${CMAKE_INSTALL_INCLUDEDIR}/monero/common/")

View file

@ -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);
}

View file

@ -31,7 +31,7 @@
#else #else
#define ELPP_FEATURE_CRASH_LOG 1 #define ELPP_FEATURE_CRASH_LOG 1
#endif #endif
#include "easylogging++/easylogging++.h" #include "easylogging++.h"
#include <stdexcept> #include <stdexcept>
#ifdef USE_UNWIND #ifdef USE_UNWIND

View file

@ -27,76 +27,79 @@
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
set(crypto_sources set(crypto_sources
aesb.c aesb.c
blake256.c blake256.c
chacha.c chacha.c
crypto-ops-data.c crypto-ops-data.c
crypto-ops.c crypto-ops.c
crypto.cpp crypto.cpp
groestl.c groestl.c
hash-extra-blake.c hash-extra-blake.c
hash-extra-groestl.c hash-extra-groestl.c
hash-extra-jh.c hash-extra-jh.c
hash-extra-skein.c hash-extra-skein.c
hash.c hash.c
hmac-keccak.c hmac-keccak.c
jh.c jh.c
keccak.c keccak.c
oaes_lib.c oaes_lib.c
random.c random.c
skein.c skein.c
slow-hash.c slow-hash.c
rx-slow-hash.c rx-slow-hash.c
CryptonightR_JIT.c CryptonightR_JIT.c
tree-hash.c) tree-hash.c)
file(GLOB crypto_headers "*.h")
if(ARCH_ID STREQUAL "i386" OR ARCH_ID STREQUAL "x86_64" OR ARCH_ID STREQUAL "x86-64" OR ARCH_ID STREQUAL "amd64") if(NOT ARM)
list(APPEND crypto_sources CryptonightR_template.S) list(APPEND crypto_sources CryptonightR_template.S)
endif() endif()
include_directories(${RANDOMX_INCLUDE}) add_library(cncrypto)
target_sources(cncrypto
PUBLIC
FILE_SET HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}
FILES
${crypto_headers}
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 target_link_libraries(cncrypto
PUBLIC PUBLIC
epee epee
randomx randomx
${Boost_SYSTEM_LIBRARY} Boost::system
${SODIUM_LIBRARY} ${sodium_LIBRARY_RELEASE}
PRIVATE PRIVATE
${EXTRA_LIBRARIES}) OpenSSL::SSL
OpenSSL::Crypto)
if (ARM) target_include_directories(cncrypto
option(NO_OPTIMIZED_MULTIPLY_ON_ARM PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
"Compute multiply using generic C implementation instead of ARM ASM" OFF) PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
if(NO_OPTIMIZED_MULTIPLY_ON_ARM) PUBLIC ${sodium_INCLUDE_DIR}
message(STATUS "Using generic C implementation for multiply") )
set_property(SOURCE slow-hash.c
PROPERTY COMPILE_DEFINITIONS "NO_OPTIMIZED_MULTIPLY_ON_ARM") if (ARM AND NO_OPTIMIZED_MULTIPLY_ON_ARM)
endif() message(STATUS "Using generic C implementation for multiply")
set_property(SOURCE slow-hash.c
PROPERTY COMPILE_DEFINITIONS "NO_OPTIMIZED_MULTIPLY_ON_ARM")
endif() endif()
# Because of the way Qt works on android with JNI, the code does not live in the main android thread # 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. # 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 # This will force the use of the heap for the allocation of the scratchpad
if (ANDROID OR IOS) if (ANDROID OR IOS)
if( BUILD_GUI_DEPS )
add_definitions(-DFORCE_USE_HEAP=1) add_definitions(-DFORCE_USE_HEAP=1)
endif()
endif() endif()
# cheat because cmake and ccache hate each other # 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) set_property(SOURCE CryptonightR_template.S PROPERTY XCODE_EXPLICIT_FILE_TYPE sourcecode.asm)
# Must be done last, because it references libraries in this directory # Must be done last, because it references libraries in this directory
add_subdirectory(wallet) add_subdirectory(wallet)
monero_install_library(cncrypto "${CMAKE_INSTALL_INCLUDEDIR}/monero/crypto/")

View file

@ -61,11 +61,11 @@ static void generate_system_random_bytes(size_t n, void *result) {
#include <err.h> #include <err.h>
#include <errno.h> #include <errno.h>
#include <fcntl.h>
#include <stdlib.h> #include <stdlib.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/types.h> #include <sys/types.h>
#include <unistd.h> #include <unistd.h>
#include <fcntl.h>
static void generate_system_random_bytes(size_t n, void *result) { static void generate_system_random_bytes(size_t n, void *result) {
int fd; int fd;

View file

@ -27,37 +27,23 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF # 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. # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# include(CheckLanguage)
# Possibly user defined values. check_language(ASM-ATT)
#
set(MONERO_WALLET_CRYPTO_LIBRARY "auto" CACHE STRING "Select a wallet crypto library")
# add_library(wallet-crypto crypto.h)
# If the user specified "auto", detect best library defaulting to internal. target_sources(wallet-crypto
# PUBLIC
if (${MONERO_WALLET_CRYPTO_LIBRARY} STREQUAL "auto") FILE_SET HEADERS
monero_crypto_autodetect(AVAILABLE BEST) BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}
if (DEFINED BEST) FILES
message("Wallet crypto is using ${BEST} backend") ${CMAKE_CURRENT_SOURCE_DIR}/crypto.h
set(MONERO_WALLET_CRYPTO_LIBRARY ${BEST}) )
else ()
message("Defaulting to internal crypto library for wallet")
set(MONERO_WALLET_CRYPTO_LIBRARY "cn")
endif ()
endif ()
#
# 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 "${CMAKE_INSTALL_INCLUDEDIR}/monero/wallet-crypto/")

View file

@ -26,56 +26,51 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF # 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. # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
if(APPLE) file(GLOB CN_BASIC_HEADERS *.h)
if(DEPENDS) file(GLOB CN_BASIC_SOURCES *.cpp *.c *.cc)
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()
monero_add_library(cryptonote_format_utils_basic # cryptonote_format_utils_basic
cryptonote_format_utils_basic.cpp add_library(cryptonote_format_utils_basic)
) target_sources(cryptonote_format_utils_basic
target_link_libraries(cryptonote_format_utils_basic PRIVATE
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/cryptonote_format_utils_basic.cpp
cncrypto )
)
set(cryptonote_basic_sources target_link_libraries(cryptonote_format_utils_basic PUBLIC cncrypto)
account.cpp target_include_directories(cryptonote_format_utils_basic
connection_context.cpp PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
cryptonote_basic_impl.cpp PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
cryptonote_format_utils.cpp )
difficulty.cpp
hardfork.cpp
merge_mining.cpp
miner.cpp)
set(cryptonote_basic_headers) # cryptonote_basic
add_library(cryptonote_basic)
target_sources(cryptonote_basic
PUBLIC
FILE_SET HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../
FILES
${CN_BASIC_HEADERS}
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 target_link_libraries(cryptonote_basic
PUBLIC PUBLIC
common common
cncrypto cncrypto
checkpoints checkpoints
cryptonote_format_utils_basic
device device
${Boost_DATE_TIME_LIBRARY} Boost::date_time
${Boost_PROGRAM_OPTIONS_LIBRARY} Boost::program_options
${Boost_SERIALIZATION_LIBRARY} Boost::serialization
${Boost_FILESYSTEM_LIBRARY} Boost::filesystem
${Boost_SYSTEM_LIBRARY} Boost::system
${Boost_THREAD_LIBRARY} Boost::thread)
PRIVATE
${EXTRA_LIBRARIES}) target_include_directories(cryptonote_basic
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
monero_install_library(cryptonote_format_utils_basic "${CMAKE_INSTALL_INCLUDEDIR}/monero/cryptonote_basic/")
monero_install_library(cryptonote_basic "${CMAKE_INSTALL_INCLUDEDIR}/monero/cryptonote_basic/")

View file

@ -26,25 +26,10 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF # 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. # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
set(cryptonote_core_sources file(GLOB CN_CORE_HEADERS *.h)
blockchain.cpp file(GLOB CN_CORE_SOURCES *.cpp *.c *.cc)
cryptonote_core.cpp
tx_pool.cpp
tx_sanity_check.cpp
cryptonote_tx_utils.cpp
tx_verification_utils.cpp
)
set(cryptonote_core_headers) add_library(cryptonote_core ${CN_CORE_SOURCES})
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})
target_link_libraries(cryptonote_core target_link_libraries(cryptonote_core
PUBLIC PUBLIC
version version
@ -54,11 +39,35 @@ target_link_libraries(cryptonote_core
ringct ringct
device device
hardforks hardforks
${Boost_DATE_TIME_LIBRARY} Boost::date_time
${Boost_PROGRAM_OPTIONS_LIBRARY} Boost::program_options
${Boost_SERIALIZATION_LIBRARY} Boost::serialization
${Boost_FILESYSTEM_LIBRARY} Boost::filesystem
${Boost_SYSTEM_LIBRARY} Boost::system
${Boost_THREAD_LIBRARY} Boost::thread)
PRIVATE
${EXTRA_LIBRARIES}) target_include_directories(cryptonote_core PRIVATE
PUBLIC $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/external>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
if(PER_BLOCK_CHECKPOINT)
target_compile_definitions(cryptonote_core PUBLIC PER_BLOCK_CHECKPOINT=1)
endif()
target_sources(cryptonote_core
PUBLIC
FILE_SET HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../
FILES
${CN_CORE_HEADERS}
PRIVATE
${CN_CORE_SOURCES}
)
target_include_directories(cryptonote_core
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
monero_install_library(cryptonote_core "${CMAKE_INSTALL_INCLUDEDIR}/monero/cryptonote_core/")

View file

@ -26,16 +26,26 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF # 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. # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
cmake_minimum_required (VERSION 3.5) file(GLOB CN_PROT_HEADERS *.h)
project (monero CXX) file(GLOB CN_PROT_SOURCES *.cpp *.c *.cc)
file(GLOB CRYPTONOTE_PROTOCOL *) add_library(cryptonote_protocol)
source_group(cryptonote_protocol FILES ${CRYPTONOTE_PROTOCOL}) target_sources(cryptonote_protocol
PUBLIC
FILE_SET HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}
FILES
${CN_PROT_HEADERS}
PRIVATE
${CN_PROT_SOURCES}
)
#monero_private_headers(cryptonote_protocol ${CRYPTONOTE_PROTOCOL}) target_link_libraries(cryptonote_protocol PUBLIC p2p)
monero_add_library(cryptonote_protocol ${CRYPTONOTE_PROTOCOL})
target_link_libraries(cryptonote_protocol target_include_directories(cryptonote_protocol
PUBLIC PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
p2p PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PRIVATE PRIVATE ${OPENSSL_INCLUDE_DIR}
${EXTRA_LIBRARIES}) )
monero_install_library(cryptonote_protocol "${CMAKE_INSTALL_INCLUDEDIR}/monero/cryptonote_protocol/")

View file

@ -26,25 +26,14 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF # 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. # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
set(daemon_sources file(GLOB DAEMON_SOURCES
command_parser_executor.cpp *.cpp
command_server.cpp *.c
daemon.cpp *.cc
executor.cpp *.h)
main.cpp
rpc_command_executor.cpp
)
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 target_link_libraries(daemon
PRIVATE PRIVATE
rpc rpc
@ -57,19 +46,27 @@ target_link_libraries(daemon
daemonizer daemonizer
serialization serialization
daemon_rpc_server daemon_rpc_server
${EPEE_READLINE}
version version
${Boost_CHRONO_LIBRARY} Boost::chrono
${Boost_FILESYSTEM_LIBRARY} Boost::program_options
${Boost_PROGRAM_OPTIONS_LIBRARY} Boost::filesystem
${Boost_REGEX_LIBRARY} Boost::system
${Boost_SYSTEM_LIBRARY} Boost::thread
${CMAKE_THREAD_LIBS_INIT} Boost::regex
${ZMQ_LIB} Threads::Threads
${GNU_READLINE_LIBRARY} ${ZMQ_LIBRARIES}
${EXTRA_LIBRARIES} blocks)
${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 set_property(TARGET daemon
PROPERTY PROPERTY
OUTPUT_NAME "wownerod") OUTPUT_NAME "wownerod")
install(TARGETS daemon DESTINATION bin)
install(TARGETS daemon DESTINATION ${CMAKE_INSTALL_BINDIR})

View file

@ -58,17 +58,17 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug")
add_definitions(-DDEBUG_TMPDIR_LOG=1) add_definitions(-DDEBUG_TMPDIR_LOG=1)
endif() endif()
monero_private_headers(daemonizer add_library(daemonizer
${daemonizer_private_headers})
monero_add_library(daemonizer
${daemonizer_sources} ${daemonizer_sources}
${daemonizer_headers} ${daemonizer_headers}
${daemonizer_private_headers}) ${daemonizer_private_headers})
target_link_libraries(daemonizer target_link_libraries(daemonizer
PUBLIC PUBLIC
common common
${Boost_CHRONO_LIBRARY} Boost::chrono
${Boost_FILESYSTEM_LIBRARY} Boost::filesystem
${Boost_PROGRAM_OPTIONS_LIBRARY} Boost::program_options)
PRIVATE
${EXTRA_LIBRARIES}) target_include_directories(daemonizer PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../)

View file

@ -26,57 +26,40 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF # 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. # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
set(device_sources add_library(device)
device.cpp target_sources(device
device_default.cpp PUBLIC
log.cpp FILE_SET HEADERS
) BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../
FILES
if(HIDAPI_FOUND) ${CMAKE_CURRENT_SOURCE_DIR}/device.hpp
set(device_sources ${CMAKE_CURRENT_SOURCE_DIR}/device_io.hpp
${device_sources} ${CMAKE_CURRENT_SOURCE_DIR}/device_default.hpp
device_ledger.cpp ${CMAKE_CURRENT_SOURCE_DIR}/device_cold.hpp
device_io_hid.cpp ${CMAKE_CURRENT_SOURCE_DIR}/log.hpp
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 target_link_libraries(device
PUBLIC PUBLIC
${HIDAPI_LIBRARIES}
cncrypto cncrypto
cryptonote_format_utils_basic cryptonote_format_utils_basic
ringct_basic ringct_basic
wallet-crypto wallet-crypto
${OPENSSL_CRYPTO_LIBRARIES} monero-crypto-amd64-64-24k
${Boost_SERIALIZATION_LIBRARY} OpenSSL::Crypto
Boost::serialization
PRIVATE PRIVATE
version version
${Blocks} blocks)
${EXTRA_LIBRARIES})
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}>
)
monero_install_library(device "${CMAKE_INSTALL_INCLUDEDIR}/monero/device/")

View file

@ -51,4 +51,4 @@ add_dependencies(gen_multisig
set_property(TARGET gen_multisig set_property(TARGET gen_multisig
PROPERTY PROPERTY
OUTPUT_NAME "wownero-gen-trusted-multisig") OUTPUT_NAME "wownero-gen-trusted-multisig")
install(TARGETS gen_multisig DESTINATION bin) install(TARGETS gen_multisig DESTINATION ${CMAKE_INSTALL_BINDIR})

View file

@ -46,4 +46,4 @@ add_dependencies(gen_ssl_cert
set_property(TARGET gen_ssl_cert set_property(TARGET gen_ssl_cert
PROPERTY PROPERTY
OUTPUT_NAME "wownero-gen-ssl-cert") OUTPUT_NAME "wownero-gen-ssl-cert")
install(TARGETS gen_ssl_cert DESTINATION bin) install(TARGETS gen_ssl_cert DESTINATION ${CMAKE_INSTALL_BINDIR})

View file

@ -26,21 +26,17 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF # 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. # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
set(hardforks_sources add_library(hardforks)
hardforks.cpp) target_sources(hardforks
PUBLIC
FILE_SET HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}
FILES
${CMAKE_CURRENT_SOURCE_DIR}/hardforks.h
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_install_library(hardforks "${CMAKE_INSTALL_INCLUDEDIR}/monero/hardforks/")
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})

View file

@ -26,8 +26,22 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF # 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. # 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) file(GLOB LMDB_HEADERS *.h)
monero_find_all_headers(lmdb_headers "${CMAKE_CURRENT_SOURCE_DIR}") file(GLOB LMDB_SOURCES *.cpp *.c *.cc)
monero_add_library(lmdb_lib ${lmdb_sources} ${lmdb_headers}) add_library(lmdb_lib ${LMDB_SOURCES})
target_link_libraries(lmdb_lib common ${LMDB_LIBRARY}) target_sources(lmdb_lib
PUBLIC
FILE_SET HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}
FILES
${LMDB_HEADERS}
PRIVATE
${LMDB_SOURCES}
)
target_link_libraries(lmdb_lib PRIVATE
common
lmdb)
monero_install_library(lmdb_lib "${CMAKE_INSTALL_INCLUDEDIR}/monero/lmdb/")

View file

@ -26,23 +26,29 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF # 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. # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
set(mnemonics_sources file(GLOB MN_HEADERS *.h)
electrum-words.cpp) file(GLOB MN_SOURCES *.cpp *.c *.cc)
set(mnemonics_headers) add_library(mnemonics)
target_sources(mnemonics
PUBLIC
FILE_SET HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}
FILES
${MN_HEADERS}
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 target_link_libraries(mnemonics
PUBLIC PUBLIC
epee epee
easylogging easylogging
${Boost_SYSTEM_LIBRARY} Boost::system)
PRIVATE
${EXTRA_LIBRARIES}) target_include_directories(mnemonics
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
monero_install_library(mnemonics "${CMAKE_INSTALL_INCLUDEDIR}/monero/mnemonics/")

View file

@ -25,26 +25,22 @@
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, # 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 # 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. # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
file(GLOB MULTISIG_HEADERS *.h)
file(GLOB MULTISIG_SOURCES
*.cpp
*.c
*.cc)
set(multisig_sources add_library(multisig)
multisig.cpp target_sources(multisig
multisig_account.cpp PUBLIC
multisig_account_kex_impl.cpp FILE_SET HEADERS
multisig_clsag_context.cpp BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}
multisig_kex_msg.cpp FILES
multisig_tx_builder_ringct.cpp) ${MULTISIG_HEADERS}
PRIVATE
set(multisig_headers) ${MULTISIG_SOURCES}
)
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})
target_link_libraries(multisig target_link_libraries(multisig
PUBLIC PUBLIC
@ -52,6 +48,11 @@ target_link_libraries(multisig
cryptonote_basic cryptonote_basic
cryptonote_core cryptonote_core
common common
cncrypto cncrypto)
PRIVATE
${EXTRA_LIBRARIES}) target_include_directories(multisig
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
monero_install_library(multisig "${CMAKE_INSTALL_INCLUDEDIR}/monero/multisig/")

View file

@ -27,10 +27,31 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF # 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. # 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 file(GLOB NET_HEADERS *.h)
socks.cpp socks_connect.cpp tor_address.cpp zmq.cpp) file(GLOB NET_SOURCES *.cpp *.c *.cc)
monero_find_all_headers(net_headers "${CMAKE_CURRENT_SOURCE_DIR}")
monero_add_library(net ${net_sources} ${net_headers}) add_library(net)
target_link_libraries(net common epee ${ZMQ_LIB} ${Boost_ASIO_LIBRARY}) target_sources(net
PUBLIC
FILE_SET HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../
FILES
${NET_HEADERS}
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}>
PRIVATE ${ZMQ_INCLUDE_DIRS}
PRIVATE ${OPENSSL_INCLUDE_DIR}
)
monero_install_library(net "${CMAKE_INSTALL_INCLUDEDIR}/monero/net/")

View file

@ -26,27 +26,38 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF # 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. # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
cmake_minimum_required (VERSION 3.5) file(GLOB P2P_HEADERS *.h)
project (monero CXX) file(GLOB P2P_SOURCES *.cpp *.c *.cc)
file(GLOB P2P *) add_library(p2p)
source_group(p2p FILES ${P2P}) target_sources(p2p
PUBLIC
FILE_SET HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}
FILES
${P2P_HEADERS}
PRIVATE
${P2P_SOURCES}
)
#add_library(p2p ${P2P})
#monero_private_headers(p2p ${P2P})
monero_add_library(p2p ${P2P})
target_link_libraries(p2p target_link_libraries(p2p
PUBLIC PUBLIC
version version
cryptonote_core cryptonote_core
net net
${UPNP_LIBRARIES} miniupnpc::miniupnpc
${Boost_CHRONO_LIBRARY} Boost::chrono
${Boost_PROGRAM_OPTIONS_LIBRARY} Boost::program_options
${Boost_FILESYSTEM_LIBRARY} Boost::filesystem
${Boost_SYSTEM_LIBRARY} Boost::system
${Boost_THREAD_LIBRARY} Boost::thread
${Boost_SERIALIZATION_LIBRARY} Boost::serialization)
PRIVATE
${EXTRA_LIBRARIES}) target_include_directories(p2p
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
PUBLIC $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/external>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PRIVATE ${OPENSSL_INCLUDE_DIR}
)
monero_install_library(p2p "${CMAKE_INSTALL_INCLUDEDIR}/monero/p2p/")

View file

@ -60,9 +60,9 @@
#include "cryptonote_core/cryptonote_core.h" #include "cryptonote_core/cryptonote_core.h"
#include "net/parse.h" #include "net/parse.h"
#include <miniupnp/miniupnpc/miniupnpc.h> #include <miniupnpc/miniupnpc.h>
#include <miniupnp/miniupnpc/upnpcommands.h> #include <miniupnpc/upnpcommands.h>
#include <miniupnp/miniupnpc/upnperrors.h> #include <miniupnpc/upnperrors.h>
#undef MONERO_DEFAULT_LOG_CATEGORY #undef MONERO_DEFAULT_LOG_CATEGORY
#define MONERO_DEFAULT_LOG_CATEGORY "net.p2p" #define MONERO_DEFAULT_LOG_CATEGORY "net.p2p"

View file

@ -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>

View file

@ -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)

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -27,45 +27,59 @@
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
set(ringct_basic_sources set(ringct_basic_sources
rctOps.cpp rctOps.cpp
rctTypes.cpp rctTypes.cpp
rctCryptoOps.c rctCryptoOps.c
multiexp.cc multiexp.cc
bulletproofs.cc bulletproofs.cc
bulletproofs2.cc bulletproofs2.cc
bulletproofs_plus.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
PUBLIC
FILE_SET HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}
FILES
${ringct_basic_headers}
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 target_link_libraries(ringct_basic
PUBLIC PUBLIC
common common
cncrypto cncrypto
PRIVATE PRIVATE
${OPENSSL_LIBRARIES} OpenSSL::SSL
${EXTRA_LIBRARIES}) OpenSSL::Crypto)
set(ringct_sources target_include_directories(ringct_basic
rctSigs.cpp PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
) PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PRIVATE ${OPENSSL_INCLUDE_DIR}
)
set(ringct_headers) add_library(ringct)
target_sources(ringct
PUBLIC
FILE_SET HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}
FILES
${CMAKE_CURRENT_SOURCE_DIR}/rctSigs.h
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 target_link_libraries(ringct
PUBLIC PUBLIC
common common
@ -73,5 +87,13 @@ target_link_libraries(ringct
cryptonote_basic cryptonote_basic
device device
PRIVATE PRIVATE
${OPENSSL_LIBRARIES} OpenSSL::SSL)
${EXTRA_LIBRARIES})
target_include_directories(ringct
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PRIVATE ${OPENSSL_INCLUDE_DIR}
)
monero_install_library(ringct_basic "${CMAKE_INSTALL_INCLUDEDIR}/monero/ringct/")
monero_install_library(ringct "${CMAKE_INSTALL_INCLUDEDIR}/monero/ringct/")

View file

@ -26,108 +26,64 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF # 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. # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
include_directories(SYSTEM ${ZMQ_INCLUDE_PATH}) # rpc base
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})
add_library(rpc_base)
target_sources(rpc_base
PUBLIC
FILE_SET HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}
FILES
${CMAKE_CURRENT_SOURCE_DIR}/rpc_args.h
${CMAKE_CURRENT_SOURCE_DIR}/rpc_payment_signature.h
${CMAKE_CURRENT_SOURCE_DIR}/rpc_handler.h
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 target_link_libraries(rpc_base
PUBLIC PUBLIC
common common
epee epee
${Boost_REGEX_LIBRARY} Boost::regex
${Boost_THREAD_LIBRARY} Boost::thread
${Boost_PROGRAM_OPTIONS_LIBRARY} Boost::program_options)
PRIVATE
${EXTRA_LIBRARIES}) 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 "${CMAKE_INSTALL_INCLUDEDIR}/monero/rpc/")
# rpc
add_library(rpc)
target_sources(rpc
PUBLIC
FILE_SET HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}
FILES
${CMAKE_CURRENT_SOURCE_DIR}/rpc_version_str.h
${CMAKE_CURRENT_SOURCE_DIR}/rpc_handler.h
${CMAKE_CURRENT_SOURCE_DIR}/bootstrap_daemon.h
${CMAKE_CURRENT_SOURCE_DIR}/core_rpc_server.h
${CMAKE_CURRENT_SOURCE_DIR}/rpc_payment.h
${CMAKE_CURRENT_SOURCE_DIR}/core_rpc_server_commands_defs.h
${CMAKE_CURRENT_SOURCE_DIR}/core_rpc_server_error_codes.h
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 target_link_libraries(rpc
PUBLIC PUBLIC
@ -137,10 +93,30 @@ target_link_libraries(rpc
cryptonote_protocol cryptonote_protocol
net net
version version
${Boost_REGEX_LIBRARY} Boost::regex
${Boost_THREAD_LIBRARY} Boost::thread)
PRIVATE
${EXTRA_LIBRARIES}) target_include_directories(rpc
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PRIVATE ${ZMQ_INCLUDE_DIRS}
PRIVATE ${OPENSSL_INCLUDE_DIR}
)
monero_install_library(rpc "${CMAKE_INSTALL_INCLUDEDIR}/monero/rpc/")
# rpc pub
add_library(rpc_pub)
target_sources(rpc_pub
PUBLIC
FILE_SET HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}
FILES
${CMAKE_CURRENT_SOURCE_DIR}/zmq_pub.h
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/zmq_pub.cpp
)
target_link_libraries(rpc_pub target_link_libraries(rpc_pub
PUBLIC PUBLIC
@ -148,15 +124,42 @@ target_link_libraries(rpc_pub
net net
cryptonote_basic cryptonote_basic
serialization serialization
${Boost_THREAD_LIBRARY}) Boost::thread)
target_include_directories(rpc_pub
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PRIVATE ${ZMQ_INCLUDE_DIRS}
PRIVATE ${OPENSSL_INCLUDE_DIR}
)
monero_install_library(rpc_pub "${CMAKE_INSTALL_INCLUDEDIR}/monero/rpc/")
# daemon messages
add_library(daemon_messages
message.cpp
daemon_messages.cpp
message.h
daemon_messages.h)
target_link_libraries(daemon_messages target_link_libraries(daemon_messages
LINK_PRIVATE LINK_PRIVATE
cryptonote_core cryptonote_core
cryptonote_protocol cryptonote_protocol
version version
serialization serialization)
${EXTRA_LIBRARIES})
# 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 target_link_libraries(daemon_rpc_server
LINK_PRIVATE LINK_PRIVATE
@ -167,11 +170,13 @@ target_link_libraries(daemon_rpc_server
version version
daemon_messages daemon_messages
serialization serialization
${Boost_CHRONO_LIBRARY} Boost::chrono
${Boost_REGEX_LIBRARY} Boost::regex
${Boost_SYSTEM_LIBRARY} Boost::system
${Boost_THREAD_LIBRARY} Boost::thread
${ZMQ_LIB} ${ZMQ_LIBRARIES})
${EXTRA_LIBRARIES})
target_include_directories(daemon_rpc_server PUBLIC ${ZMQ_INCLUDE_PATH}) target_include_directories(daemon_rpc_server
target_include_directories(obj_daemon_rpc_server PUBLIC ${ZMQ_INCLUDE_PATH}) PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../
PRIVATE ${ZMQ_INCLUDE_DIRS}
PRIVATE ${OPENSSL_INCLUDE_DIR})

View file

@ -26,30 +26,36 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF # 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. # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
set(serialization_sources file(GLOB SER_HEADERS *.h)
json_object.cpp) file(GLOB SER_SOURCES *.cpp *.c *.cc)
set(serialization_headers) add_library(serialization)
target_sources(serialization
PUBLIC
FILE_SET HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../
FILES
${SER_HEADERS}
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 target_link_libraries(serialization
LINK_PRIVATE LINK_PRIVATE
cryptonote_basic cryptonote_basic
cryptonote_core cryptonote_core
cryptonote_protocol cryptonote_protocol
epee epee
${Boost_CHRONO_LIBRARY} Boost::chrono
${Boost_REGEX_LIBRARY} Boost::regex
${Boost_SYSTEM_LIBRARY} Boost::system
${Boost_THREAD_LIBRARY} Boost::thread)
${EXTRA_LIBRARIES})
add_dependencies(serialization
version)
add_dependencies(serialization version)
target_include_directories(serialization
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
monero_install_library(serialization "${CMAKE_INSTALL_INCLUDEDIR}/monero/serialization/")

View file

@ -26,19 +26,13 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF # 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. # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
set(simplewallet_sources file(GLOB SW_SOURCES
simplewallet.cpp) *.cpp
*.c
*.cc
*.h)
set(simplewallet_headers) add_executable(simplewallet ${SW_SOURCES})
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})
target_link_libraries(simplewallet target_link_libraries(simplewallet
PRIVATE PRIVATE
wallet wallet
@ -50,16 +44,23 @@ target_link_libraries(simplewallet
${EPEE_READLINE} ${EPEE_READLINE}
qrcodegen qrcodegen
version version
${Boost_CHRONO_LIBRARY}
${Boost_PROGRAM_OPTIONS_LIBRARY} Boost::chrono
${Boost_FILESYSTEM_LIBRARY} Boost::program_options
${Boost_LOCALE_LIBRARY} Boost::filesystem
Boost::system
Boost::thread
Boost::serialization
Boost::locale
${ICU_LIBRARIES} ${ICU_LIBRARIES}
${Boost_THREAD_LIBRARY}
${CMAKE_THREAD_LIBS_INIT} ${CMAKE_THREAD_LIBS_INIT}
${GNU_READLINE_LIBRARY} ${GNU_READLINE_LIBRARY})
${EXTRA_LIBRARIES})
target_include_directories(simplewallet
PRIVATE ${OPENSSL_INCLUDE_DIR})
set_property(TARGET simplewallet set_property(TARGET simplewallet
PROPERTY PROPERTY
OUTPUT_NAME "wownero-wallet-cli") OUTPUT_NAME "wownero-wallet-cli")
install(TARGETS simplewallet DESTINATION bin)

View file

@ -26,27 +26,55 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF # 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. # 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 set(wallet_sources
wallet2.cpp wallet2.cpp
wallet_args.cpp wallet_args.cpp
ringdb.cpp ringdb.cpp
node_rpc_proxy.cpp node_rpc_proxy.cpp
message_store.cpp message_store.cpp
message_transporter.cpp message_transporter.cpp
wallet_rpc_payments.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)
set(wallet_private_headers
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
PUBLIC
${wallet_headers}
PRIVATE
${wallet_sources}
${wallet_private_headers}
)
monero_private_headers(wallet
${wallet_private_headers})
monero_add_library(wallet
${wallet_sources}
${wallet_private_headers})
target_link_libraries(wallet target_link_libraries(wallet
PUBLIC PUBLIC
rpc_base rpc_base
@ -54,54 +82,62 @@ target_link_libraries(wallet
common common
cryptonote_core cryptonote_core
mnemonics mnemonics
device_trezor
net net
${LMDB_LIBRARY} lmdb
${Boost_CHRONO_LIBRARY} Boost::chrono
${Boost_SERIALIZATION_LIBRARY} Boost::serialization
${Boost_FILESYSTEM_LIBRARY} Boost::filesystem
${Boost_SYSTEM_LIBRARY} Boost::system
${Boost_THREAD_LIBRARY} Boost::thread
${Boost_REGEX_LIBRARY} Boost::regex
PRIVATE PRIVATE
${EXTRA_LIBRARIES}) OpenSSL::SSL)
if(NOT IOS) target_include_directories(wallet
set(wallet_rpc_sources PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
wallet_rpc_server.cpp) 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 "${CMAKE_INSTALL_INCLUDEDIR}/monero/wallet/")
set(wallet_rpc_private_headers # == rpc server
wallet_rpc_server.h)
monero_private_headers(wallet_rpc_server add_executable(wallet_rpc_server wallet_rpc_server.cpp)
${wallet_rpc_private_headers}) target_link_libraries(wallet_rpc_server
monero_add_executable(wallet_rpc_server PRIVATE
${wallet_rpc_sources} wallet
${wallet_rpc_headers} rpc_base
${wallet_rpc_private_headers}) 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 target_include_directories(wallet_rpc_server
PRIVATE PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
wallet PUBLIC $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/external/>
rpc_base PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/>
cryptonote_core PRIVATE ${OPENSSL_INCLUDE_DIR}
cncrypto )
common
version set_property(TARGET wallet_rpc_server PROPERTY OUTPUT_NAME "wownero-wallet-rpc")
daemonizer
${EPEE_READLINE} install(TARGETS wallet_rpc_server
${Boost_CHRONO_LIBRARY} EXPORT walletRpcServerTargets
${Boost_PROGRAM_OPTIONS_LIBRARY} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
${Boost_FILESYSTEM_LIBRARY} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/monero/
${Boost_THREAD_LIBRARY} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/monero/
${CMAKE_THREAD_LIBS_INIT} INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/monero/
${EXTRA_LIBRARIES}) PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/monero/
set_property(TARGET wallet_rpc_server )
PROPERTY
OUTPUT_NAME "wownero-wallet-rpc")
install(TARGETS wallet_rpc_server DESTINATION bin)
endif()
add_subdirectory(api) add_subdirectory(api)

View file

@ -28,8 +28,6 @@
# include (${PROJECT_SOURCE_DIR}/cmake/libutils.cmake) # include (${PROJECT_SOURCE_DIR}/cmake/libutils.cmake)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(wallet_api_sources set(wallet_api_sources
wallet.cpp wallet.cpp
wallet_manager.cpp wallet_manager.cpp
@ -46,8 +44,7 @@ set(wallet_api_sources
coins.cpp coins.cpp
coins_info.cpp) coins_info.cpp)
set(wallet_api_headers set(wallet_api_headers wallet2_api.h)
wallet2_api.h)
set(wallet_api_private_headers set(wallet_api_private_headers
wallet.h wallet.h
@ -65,39 +62,33 @@ set(wallet_api_private_headers
coins.h coins.h
coins_info.h) coins_info.h)
monero_private_headers(wallet_api add_library(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 target_link_libraries(wallet_api
PUBLIC PUBLIC
wallet wallet
common common
cryptonote_core cryptonote_core
mnemonics mnemonics
${LMDB_LIBRARY} lmdb
${Boost_CHRONO_LIBRARY} Boost::chrono
${Boost_LOCALE_LIBRARY} Boost::program_options
${ICU_LIBRARIES} Boost::filesystem
${Boost_SERIALIZATION_LIBRARY} Boost::thread
${Boost_FILESYSTEM_LIBRARY} Boost::locale
${Boost_SYSTEM_LIBRARY} Boost::serialization
${Boost_THREAD_LIBRARY} Boost::system
${CMAKE_THREAD_LIBS_INIT} Boost::regex
${Boost_REGEX_LIBRARY} ${ICU_LIBRARIES})
PRIVATE
${EXTRA_LIBRARIES})
set_property(TARGET wallet_api PROPERTY EXCLUDE_FROM_ALL TRUE) target_include_directories(wallet_api
set_property(TARGET obj_wallet_api PROPERTY EXCLUDE_FROM_ALL TRUE) PRIVATE ${OPENSSL_INCLUDE_DIR})
if(IOS) target_sources(wallet_api
set(lib_folder lib-${ARCH}) PRIVATE
else() ${wallet_api_private_headers}
set(lib_folder lib) ${wallet_api_sources}
endif() PUBLIC
FILE_SET HEADERS BASE_DIRS ${PROJECT_SOURCE_DIR}/src FILES ${wallet_api_headers})
install(FILES ${wallet_api_headers} monero_install_library(wallet_api "${CMAKE_INSTALL_INCLUDEDIR}/monero/wallet/api/")
DESTINATION include/wallet/api)

View file

@ -90,7 +90,6 @@ using namespace epee;
#include "ringct/rctSigs.h" #include "ringct/rctSigs.h"
#include "ringdb.h" #include "ringdb.h"
#include "device/device_cold.hpp" #include "device/device_cold.hpp"
#include "device_trezor/device_trezor.hpp"
#include "net/socks_connect.h" #include "net/socks_connect.h"
extern "C" extern "C"
@ -8671,9 +8670,7 @@ crypto::chacha_key wallet2::get_ringdb_key()
return *m_ringdb_key; return *m_ringdb_key;
} }
void wallet2::register_devices(){ void wallet2::register_devices(){}
hw::trezor::register_all();
}
hw::device& wallet2::lookup_device(const std::string & device_descriptor){ hw::device& wallet2::lookup_device(const std::string & device_descriptor){
if (!m_devices_registered){ if (!m_devices_registered){

View file

@ -530,6 +530,17 @@ namespace wallet_rpc
END_KV_SERIALIZE_MAP() 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 struct single_transfer_response
{ {
std::string tx_hash; std::string tx_hash;

View file

@ -91,10 +91,6 @@ else ()
add_subdirectory(net_load_tests) add_subdirectory(net_load_tests)
endif() endif()
if (BUILD_GUI_DEPS)
add_subdirectory(libwallet_api_tests)
endif()
if (TREZOR_DEBUG) if (TREZOR_DEBUG)
add_subdirectory(trezor) add_subdirectory(trezor)
endif() endif()

View file

@ -52,7 +52,6 @@ target_link_libraries(trezor_tests
version version
epee epee
device device
device_trezor
wallet wallet
wallet_api wallet_api
rpc rpc