diff --git a/.gitmodules b/.gitmodules index 74571d5ee..d59acc093 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,19 +1,12 @@ -[submodule "external/miniupnp"] - path = external/miniupnp - url = https://github.com/miniupnp/miniupnp -[submodule "external/rapidjson"] - path = external/rapidjson - url = https://github.com/Tencent/rapidjson [submodule "external/trezor-common"] active = false path = external/trezor-common url = https://github.com/trezor/trezor-common.git [submodule "external/supercop"] path = external/supercop - url = https://github.com/monero-project/supercop - branch = monero + url = https://git.wownero.com/dsc/supercop.git + branch = cmake-rewrite [submodule "external/randomwow"] path = external/randomwow - url = https://git.wownero.com/wownero/RandomWOW - branch = 1.2.1-wow - + url = https://git.wownero.com/dsc/randomwow.git + branch = cmake-rewrite diff --git a/CMakeLists.txt b/CMakeLists.txt index 20829bc30..3703ec3ac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,646 +27,88 @@ # 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 +list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_CURRENT_SOURCE_DIR}/cmake") -set(CMAKE_EXPORT_COMPILE_COMMANDS ON) - -list(INSERT CMAKE_MODULE_PATH 0 - "${CMAKE_CURRENT_SOURCE_DIR}/cmake") -include(CheckCCompilerFlag) -include(CheckCXXCompilerFlag) -include(CheckLinkerFlag) -include(CheckLibraryExists) -include(CheckFunctionExists) -include(FindPythonInterp) - -if (IOS) - INCLUDE(CmakeLists_IOS.txt) -endif() - -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.23) message(STATUS "CMake version ${CMAKE_VERSION}") -project(monero) - -option (USE_CCACHE "Use ccache if a usable instance is found" ON) -if (USE_CCACHE) - include(FindCcache) # Has to be included after the project() macro, to be able to read the CXX variable. -else() - message(STATUS "ccache deselected") -endif() -option (USE_COMPILATION_TIME_PROFILER "Use compilation time profiler (for CLang >= 9 only)" OFF) -if (USE_COMPILATION_TIME_PROFILER) - if (NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") - message(FATAL_ERROR "The flag USE_COMPILATION_TIME_PROFILER is meant to be set only for CLang compiler!") - endif() - add_compile_options("-ftime-trace") -endif() - -if (${CMAKE_VERSION} VERSION_GREATER "3.0.0" AND CMAKE_MAKE_PROGRAM MATCHES "ninja") - set(MONERO_PARALLEL_COMPILE_JOBS "" CACHE STRING "The maximum number of concurrent compilation jobs.") - if (MONERO_PARALLEL_COMPILE_JOBS) - set_property(GLOBAL APPEND PROPERTY JOB_POOLS compile_job_pool=${MONERO_PARALLEL_COMPILE_JOBS}) - set(CMAKE_JOB_POOL_COMPILE compile_job_pool) - endif () - - set(MONERO_PARALLEL_LINK_JOBS "" CACHE STRING "The maximum number of concurrent link jobs.") - if (MONERO_PARALLEL_LINK_JOBS) - set_property(GLOBAL APPEND PROPERTY JOB_POOLS link_job_pool=${MONERO_PARALLEL_LINK_JOBS}) - set(CMAKE_JOB_POOL_LINK link_job_pool) - endif () -endif () - -option (USE_CLANG_TIDY_C "Lint the code with clang-tidy - variant C" OFF) -option (USE_CLANG_TIDY_CXX "Lint the code with clang-tidy - variant C++" OFF) -if (USE_CLANG_TIDY_C AND USE_CLANG_TIDY_CXX) - message(FATAL_ERROR "Enabling both USE_CLANG_TIDY_C and USE_CLANG_TIDY_CXX simultaneously crashes clang-tidy.") -endif() -if (USE_CLANG_TIDY_C OR USE_CLANG_TIDY_CXX) - include(SetClangTidy) -endif() -if (USE_CLANG_TIDY_C) - monero_clang_tidy("C") -elseif (USE_CLANG_TIDY_CXX) - monero_clang_tidy("CXX") -endif() - +set(VERSION "11.1.0") +project(wownero VERSION ${VERSION}) enable_language(C ASM) -# Require C11/C++11 and disable extensions for all targets +set(CMAKE_VERBOSE_MAKEFILE on) set(CMAKE_C_STANDARD 11) set(CMAKE_C_STANDARD_REQUIRED ON) -set(CMAKE_C_EXTENSIONS OFF) +set(CMAKE_C_EXTENSIONS ON) set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_CXX_EXTENSIONS OFF) +set(CMAKE_CXX_EXTENSIONS ON) +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) +set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) -function (die msg) - if (NOT WIN32) - string(ASCII 27 Esc) - set(ColourReset "${Esc}[m") - set(BoldRed "${Esc}[1;31m") - else () - set(ColourReset "") - set(BoldRed "") - endif () +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -ftemplate-depth=900") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -maes") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -maes") - message(FATAL_ERROR "${BoldRed}${msg}${ColourReset}") -endfunction () +option(STATIC "Link libraries statically" off) +option(ARM "ARM build" OFF) +option(IOS "iOS build" OFF) +option(BUILD_DEBUG_UTILITIES "Build debug utilities." OFF) +option(USE_READLINE "Build with GNU readline support." OFF) +option(STACK_TRACE "Install a hook that dumps stack on exception" OFF) -function (add_c_flag_if_supported flag var) - # Prepending the flag with -Werror will only add the flag, - # if it doesn't result in generation of a warning of using a flag unknown to the compiler. - set(TMP "-Werror ${flag}") - string(REGEX REPLACE "[- ]" "_" supported ${TMP}_c) - check_c_compiler_flag(${TMP} ${supported}) - if(${${supported}}) - set(${var} "${${var}} ${flag}" PARENT_SCOPE) - endif() -endfunction() - -function (add_cxx_flag_if_supported flag var) - set(TMP "-Werror ${flag}") - string(REGEX REPLACE "[- ]" "_" supported ${TMP}_cxx) - check_cxx_compiler_flag(${TMP} ${supported}) - if(${${supported}}) - set(${var} "${${var}} ${flag}" PARENT_SCOPE) - endif() -endfunction() - -function (add_linker_flag_if_supported flag var) - string(REPLACE "-" "_" supported ${flag}_ld) - string(REPLACE "," "_" supported ${flag}_ld) - check_linker_flag(${flag} ${supported}) - if(${${supported}}) - set(${var} "${${var}} ${flag}" PARENT_SCOPE) - endif() -endfunction() - -function (add_definition_if_function_found function var) - string(REPLACE "-" "_" supported ${function}_function) - check_function_exists(${function} ${supported}) - if(${${supported}}) - add_definitions("-D${var}") - endif() -endfunction() - -function (add_definition_if_library_exists library function header var) - string(REPLACE "-" "_" supported ${function}_library) - check_library_exists(${library} ${function} ${header} ${supported}) - if(${${supported}}) - add_definitions("-D${var}") - endif() -endfunction() - -option(RELINK_TARGETS "Relink targets, when just a dependant .so changed, but not its header?" OFF) -function (monero_set_target_no_relink target) - if (RELINK_TARGETS MATCHES OFF) - # Will not relink the target, when just its dependant .so has changed, but not it's interface - set_target_properties("${target}" PROPERTIES LINK_DEPENDS_NO_SHARED true) - endif() -endfunction() - -option(STRIP_TARGETS "Strip symbols from targets?" OFF) -function (monero_set_target_strip target) - if (STRIP_TARGETS) - set_target_properties("${target}" PROPERTIES LINK_FLAGS_RELEASE -s) - set_target_properties("${target}" PROPERTIES LINK_FLAGS_DEBUG -s) - # Stripping from Debug might make sense if you're low on disk space, but want to test if debug version builds properly. - endif() -endfunction() - -function (monero_add_minimal_executable name) - source_group("${name}" - FILES - ${ARGN}) - - add_executable("${name}" - ${ARGN}) - monero_set_target_no_relink("${name}") - monero_set_target_strip ("${name}") -endfunction() +if(STATIC) + set(BUILD_SHARED_LIBS OFF) + set(MINIUPNPC_USE_STATIC_LIBS ON) + set(Boost_USE_STATIC_LIBS ON) + set(Boost_USE_STATIC_RUNTIME ON) + set(sodium_USE_STATIC_LIBS ON) + set(OPENSSL_USE_STATIC_LIBS ON) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static -static-libgcc -static-libstdc++") +endif() -# Finds all headers in a directory and its subdirs, to be able to search for them and autosave in IDEs. -# -# Parameters: -# - headers_found: Output variable, which will hold the found headers -# - module_root_dir: The search path for the headers. Typically it will be the module's root dir, so "${CMAKE_CURRENT_SOURCE_DIR}" or a derivative of it. -macro (monero_find_all_headers headers_found module_root_dir) - file(GLOB ${headers_found} - "${module_root_dir}/*.h*" # h* will include hpps as well. - "${module_root_dir}/**/*.h*" # Any number of subdirs will be included. - "${module_root_dir}/*.inl" # .inl is typically template code and is being treated as headers (it's being included). - "${module_root_dir}/**/*.inl" -) -endmacro() +set(THREADS_PREFER_PTHREAD_FLAG ON) +set(USE_LTO_DEFAULT false) +set(PER_BLOCK_CHECKPOINT 1) -# Function to forbid undefined symbols and also verify -# 1) Test project with all types of libraries and without undefined symbols can compile successfully -# 2) Test project with all types of libraries and undefined symbols can not compile successfully -function(forbid_undefined_symbols) - unset(TMP) - # https://www.unix.com/man-page/linux/1/ld, --no-undefined, Report unresolved symbol references from regular object files. - add_linker_flag_if_supported(-Wl,--no-undefined TMP) - # https://www.unix.com/man-page/osx/1/ld/, -undefined, Specifies how undefined symbols are to be treated. - add_linker_flag_if_supported(-Wl,-undefined,error TMP) - string(APPEND CMAKE_SHARED_LINKER_FLAGS ${TMP}) - string(APPEND CMAKE_MODULE_LINKER_FLAGS ${TMP}) - set(CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS} PARENT_SCOPE) - set(CMAKE_MODULE_LINKER_FLAGS ${CMAKE_MODULE_LINKER_FLAGS} PARENT_SCOPE) - set(TEST_PROJECT "${CMAKE_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/CMakeTmp/test_project") - foreach(EXPECT IN ITEMS TRUE FALSE) - file(REMOVE_RECURSE "${TEST_PROJECT}") - file(MAKE_DIRECTORY "${TEST_PROJECT}") - file(WRITE "${TEST_PROJECT}/CMakeLists.txt" - [=[ -cmake_minimum_required(VERSION 3.1) -project(test) -option(EXPECT_SUCCESS "" ON) -file(WRITE "${CMAKE_SOURCE_DIR}/incorrect_source.cpp" "void undefined_symbol(); void symbol() { undefined_symbol(); }") -if (EXPECT_SUCCESS) - file(APPEND "${CMAKE_SOURCE_DIR}/incorrect_source.cpp" " void undefined_symbol() {}; ") -endif() -add_library(l0 SHARED incorrect_source.cpp) -add_library(l1 MODULE incorrect_source.cpp) -add_library(l2 STATIC incorrect_source.cpp) -add_library(l3 OBJECT incorrect_source.cpp) -]=] - ) - try_compile(SUCCESS "${TEST_PROJECT}/build" "${TEST_PROJECT}" test - CMAKE_FLAGS - "-DCMAKE_SHARED_LINKER_FLAGS=${CMAKE_SHARED_LINKER_FLAGS}" - "-DCMAKE_MODULE_LINKER_FLAGS=${CMAKE_MODULE_LINKER_FLAGS}" - "-DEXPECT_SUCCESS=${EXPECT}" - ) - if (NOT ${SUCCESS} STREQUAL ${EXPECT}) - message(FATAL_ERROR "Undefined symbols test failure: expect(${EXPECT}), success(${SUCCESS})") - endif() - file(REMOVE_RECURSE "${TEST_PROJECT}") - endforeach() -endfunction() -if (NOT (CMAKE_SYSTEM_NAME MATCHES "kOpenBSD.*|OpenBSD.*") AND NOT OSSFUZZ) - forbid_undefined_symbols() -endif() +# @TODO: ARM +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -maes") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -maes") +option(NO_OPTIMIZED_MULTIPLY_ON_ARM "Compute multiply using generic C implementation instead of ARM ASM" OFF) -if (MINGW) - function(export_all_symbols) - unset(TMP) - add_linker_flag_if_supported(-Wl,--export-all-symbols TMP) - string(APPEND CMAKE_SHARED_LINKER_FLAGS ${TMP}) - string(APPEND CMAKE_MODULE_LINKER_FLAGS ${TMP}) - set(CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS} PARENT_SCOPE) - set(CMAKE_MODULE_LINKER_FLAGS ${CMAKE_MODULE_LINKER_FLAGS} PARENT_SCOPE) - endfunction() - export_all_symbols() -endif() +include(FindPythonInterp) +include(ExternalProject) +include(FindCcache) +include(FetchContent) +include(functions) +# CMake build type if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE) message(STATUS "Setting default build type: ${CMAKE_BUILD_TYPE}") endif() string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_LOWER) -# ARCH defines the target architecture, either by an explicit identifier or -# one of the following two keywords. By default, ARCH a value of 'native': -# target arch = host arch, binary is not portable. When ARCH is set to the -# string 'default', no -march arg is passed, which creates a binary that is -# portable across processors in the same family as host processor. In cases -# when ARCH is not set to an explicit identifier, cmake's builtin is used -# to identify the target architecture, to direct logic in this cmake script. -# Since ARCH is a cached variable, it will not be set on first cmake invocation. -if (NOT ARCH_ID) -if (NOT ARCH OR ARCH STREQUAL "" OR ARCH STREQUAL "native" OR ARCH STREQUAL "default") - if(CMAKE_SYSTEM_PROCESSOR STREQUAL "") - set(CMAKE_SYSTEM_PROCESSOR ${CMAKE_HOST_SYSTEM_PROCESSOR}) - endif() - set(ARCH_ID "${CMAKE_SYSTEM_PROCESSOR}") -else() - set(ARCH_ID "${ARCH}") -endif() -endif() -string(TOLOWER "${ARCH_ID}" ARM_ID) -string(SUBSTRING "${ARM_ID}" 0 3 ARM_TEST) -if (ARM_TEST STREQUAL "arm") - set(ARM 1) - string(SUBSTRING "${ARM_ID}" 0 5 ARM_TEST) - if (ARM_TEST STREQUAL "armv6") - set(ARM6 1) - endif() - if (ARM_TEST STREQUAL "armv7") - set(ARM7 1) - endif() -endif() - -if (ARM_ID STREQUAL "aarch64" OR ARM_ID STREQUAL "arm64" OR ARM_ID STREQUAL "armv8-a") - set(ARM 1) - set(ARM8 1) - set(ARCH "armv8-a") -endif() - -if(ARCH_ID STREQUAL "ppc64le") - set(PPC64LE 1) - set(PPC64 0) - set(PPC 0) -endif() - -if(ARCH_ID STREQUAL "powerpc64" OR ARCH_ID STREQUAL "ppc64") - set(PPC64LE 0) - set(PPC64 1) - set(PPC 0) -endif() - -if(ARCH_ID STREQUAL "powerpc" OR ARCH_ID STREQUAL "ppc") - set(PPC64LE 0) - set(PPC64 0) - set(PPC 1) -endif() - -if(ARCH_ID STREQUAL "s390x") - set(S390X 1) -endif() - -if(ARCH_ID STREQUAL "riscv64") -set(RISCV 1) -set(RISCV64 1) -endif() - -if(ARCH_ID STREQUAL "riscv32") -set(RISCV 1) -set(RISCV32 1) -endif() - -if(WIN32 OR ARM OR PPC64LE OR PPC64 OR PPC) - set(OPT_FLAGS_RELEASE "-O2") -else() - set(OPT_FLAGS_RELEASE "-Ofast") -endif() - -# BUILD_TAG is used to select the build type to check for a new version -if(BUILD_TAG) - message(STATUS "Building build tag ${BUILD_TAG}") - add_definitions("-DBUILD_TAG=${BUILD_TAG}") -else() - message(STATUS "Building without build tag") -endif() - -if(NOT MANUAL_SUBMODULES) - find_package(Git) - if(GIT_FOUND) - function (check_submodule relative_path) - execute_process(COMMAND git rev-parse "HEAD" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${relative_path} OUTPUT_VARIABLE localHead) - execute_process(COMMAND git rev-parse "HEAD:${relative_path}" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} OUTPUT_VARIABLE checkedHead) - string(COMPARE EQUAL "${localHead}" "${checkedHead}" upToDate) - if (upToDate) - message(STATUS "Submodule '${relative_path}' is up-to-date") - else() - message(STATUS "Initializing submodules") - execute_process(COMMAND git "submodule" "update" "--init" "--recursive" WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) - endif() - endfunction () - - message(STATUS "Checking submodules") - check_submodule(external/miniupnp) - check_submodule(external/rapidjson) - #check_submodule(external/trezor-common) - check_submodule(external/randomwow) - check_submodule(external/supercop) - endif() -endif() - -set(CMAKE_C_FLAGS_RELEASE "-DNDEBUG ${OPT_FLAGS_RELEASE}") -set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG ${OPT_FLAGS_RELEASE}") - -# set this to 0 if per-block checkpoint needs to be disabled -set(PER_BLOCK_CHECKPOINT 1) - -if(PER_BLOCK_CHECKPOINT) - add_definitions("-DPER_BLOCK_CHECKPOINT") - set(Blocks "blocks") -else() - set(Blocks "") -endif() - -list(INSERT CMAKE_MODULE_PATH 0 - "${CMAKE_SOURCE_DIR}/cmake") - -if (NOT DEFINED ENV{DEVELOPER_LOCAL_TOOLS}) - message(STATUS "Could not find DEVELOPER_LOCAL_TOOLS in env (not required)") - set(BOOST_IGNORE_SYSTEM_PATHS_DEFAULT OFF) -elseif ("$ENV{DEVELOPER_LOCAL_TOOLS}" EQUAL 1) - message(STATUS "Found: env DEVELOPER_LOCAL_TOOLS = 1") - set(BOOST_IGNORE_SYSTEM_PATHS_DEFAULT ON) -else() - message(STATUS "Found: env DEVELOPER_LOCAL_TOOLS = 0") - set(BOOST_IGNORE_SYSTEM_PATHS_DEFAULT OFF) -endif() - -message(STATUS "BOOST_IGNORE_SYSTEM_PATHS defaults to ${BOOST_IGNORE_SYSTEM_PATHS_DEFAULT}") -option(BOOST_IGNORE_SYSTEM_PATHS "Ignore boost system paths for local boost installation" ${BOOST_IGNORE_SYSTEM_PATHS_DEFAULT}) - -set_property(GLOBAL PROPERTY USE_FOLDERS ON) -enable_testing() - -option(BUILD_DOCUMENTATION "Build the Doxygen documentation." OFF) -option(BUILD_TESTS "Build tests." OFF) -if (CMAKE_BUILD_TYPE STREQUAL "Debug") - set(DEFAULT_BUILD_DEBUG_UTILITIES ON) -else() - set(DEFAULT_BUILD_DEBUG_UTILITIES OFF) -endif() -option(BUILD_DEBUG_UTILITIES "Build debug utilities." DEFAULT_BUILD_DEBUG_UTILITIES) - -if(OSSFUZZ) - message(STATUS "Using OSS-Fuzz fuzzing system") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DOSSFUZZ") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DOSSFUZZ") -endif() - -# Check whether we're on a 32-bit or 64-bit system -if(CMAKE_SIZEOF_VOID_P EQUAL "8") - set(DEFAULT_BUILD_64 ON) -else() - set(DEFAULT_BUILD_64 OFF) -endif() -option(BUILD_64 "Build for 64-bit? 'OFF' builds for 32-bit." ${DEFAULT_BUILD_64}) - -if(BUILD_64) - set(ARCH_WIDTH "64") -else() +set(ARCH_WIDTH "64") +if(NOT CMAKE_SIZEOF_VOID_P EQUAL "8") set(ARCH_WIDTH "32") endif() -message(STATUS "Building for a ${ARCH_WIDTH}-bit system") - -# Check if we're on FreeBSD so we can exclude the local miniupnpc (it should be installed from ports instead) -# CMAKE_SYSTEM_NAME checks are commonly known, but specifically taken from libsdl's CMakeLists -if(CMAKE_SYSTEM_NAME MATCHES "kFreeBSD.*|FreeBSD") - set(FREEBSD TRUE) -endif() - -# Check if we're on DragonFly BSD. See the README.md for build instructions. -if(CMAKE_SYSTEM_NAME MATCHES "DragonFly.*") - set(DRAGONFLY TRUE) -endif() - -# Check if we're on OpenBSD. See the README.md for build instructions. -if(CMAKE_SYSTEM_NAME MATCHES "kOpenBSD.*|OpenBSD.*") - set(OPENBSD TRUE) -endif() -# TODO: check bsdi, NetBSD, to see if they need the same FreeBSD changes -# -# elseif(CMAKE_SYSTEM_NAME MATCHES "kNetBSD.*|NetBSD.*") -# set(NETBSD TRUE) -# elseif(CMAKE_SYSTEM_NAME MATCHES ".*BSDI.*") -# set(BSDI TRUE) - -include_directories(external/rapidjson/include external/easylogging++ src contrib/epee/include external external/supercop/include) - -if(APPLE) - cmake_policy(SET CMP0042 NEW) -endif() - -if(MSVC OR MINGW) - set(DEFAULT_STATIC true) -else() - set(DEFAULT_STATIC false) -endif() -option(STATIC "Link libraries statically" ${DEFAULT_STATIC}) - -# This is a CMake built-in switch that concerns internal libraries -set(BUILD_SHARED_LIBS_DEFAULT OFF) -if (NOT STATIC AND CMAKE_BUILD_TYPE_LOWER STREQUAL "debug") - set(BUILD_SHARED_LIBS_DEFAULT ON) -endif() -option(BUILD_SHARED_LIBS "Build internal libraries as shared" ${BUILD_SHARED_LIBS_DEFAULT}) - -if (BUILD_SHARED_LIBS) - message(STATUS "Building internal libraries with position independent code") - add_definitions("-DBUILD_SHARED_LIBS") -else() - message(STATUS "Building internal libraries as static") -endif() -set(PIC_FLAG "-fPIC") - -if(MINGW) - string(REGEX MATCH "^[^/]:/[^/]*" msys2_install_path "${CMAKE_C_COMPILER}") - message(STATUS "MSYS location: ${msys2_install_path}") - set(CMAKE_INCLUDE_PATH "${msys2_install_path}/mingw${ARCH_WIDTH}/include") - # This is necessary because otherwise CMake will make Boost libraries -lfoo - # rather than a full path. Unfortunately, this makes the shared libraries get - # linked due to a bug in CMake which misses putting -static flags around the - # -lfoo arguments. - set(DEFLIB ${msys2_install_path}/mingw${ARCH_WIDTH}/lib) - list(REMOVE_ITEM CMAKE_C_IMPLICIT_LINK_DIRECTORIES ${DEFLIB}) - list(REMOVE_ITEM CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES ${DEFLIB}) -endif() - -if(STATIC) - if(MSVC) - set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .dll.a .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) - else() - set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) - endif() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DZMQ_STATIC") -endif() - -option(SANITIZE "Use ASAN memory sanitizer" OFF) -if(SANITIZE) - if (MSVC) - message(FATAL_ERROR "Cannot sanitize with MSVC") - else() - message(STATUS "Using ASAN") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address") - endif() -endif() - -# Set default blockchain storage location: -# memory was the default in Cryptonote before Monero implemented LMDB, it still works but is unnecessary. -# set(DATABASE memory) -set(DATABASE lmdb) -message(STATUS "Using LMDB as default DB type") -set(BLOCKCHAIN_DB DB_LMDB) -add_definitions("-DDEFAULT_DB_TYPE=\"lmdb\"") -add_definitions("-DBLOCKCHAIN_DB=${BLOCKCHAIN_DB}") - -# Can't install hook in static build on OSX, because OSX linker does not support --wrap -# On ARM, having libunwind package (with .so's only) installed breaks static link. -# When possible, avoid stack tracing using libunwind in favor of using easylogging++. -if (APPLE) - set(DEFAULT_STACK_TRACE OFF) - set(LIBUNWIND_LIBRARIES "") -elseif (DEPENDS AND NOT LINUX) - set(DEFAULT_STACK_TRACE OFF) - set(LIBUNWIND_LIBRARIES "") -elseif(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT MINGW) - set(DEFAULT_STACK_TRACE ON) - set(STACK_TRACE_LIB "easylogging++") # for diag output only - set(LIBUNWIND_LIBRARIES "") -elseif (ARM) - set(DEFAULT_STACK_TRACE OFF) - set(LIBUNWIND_LIBRARIES "") -else() - find_package(Libunwind) - if(LIBUNWIND_FOUND) - set(DEFAULT_STACK_TRACE ON) - set(STACK_TRACE_LIB "libunwind") # for diag output only - else() - set(DEFAULT_STACK_TRACE OFF) - set(LIBUNWIND_LIBRARIES "") - endif() -endif() - -option(STACK_TRACE "Install a hook that dumps stack on exception" ${DEFAULT_STACK_TRACE}) - -if(STACK_TRACE) - message(STATUS "Stack trace on exception enabled (using ${STACK_TRACE_LIB})") -else() - message(STATUS "Stack trace on exception disabled") -endif() - -if (UNIX AND NOT APPLE) - # Note that at the time of this writing the -Wstrict-prototypes flag added below will make this fail - set(THREADS_PREFER_PTHREAD_FLAG ON) - find_package(Threads) - add_c_flag_if_supported(-pthread CMAKE_C_FLAGS) - add_cxx_flag_if_supported(-pthread CMAKE_CXX_FLAGS) -endif() - -# Handle OpenSSL, used for sha256sum on binary updates and light wallet ssl http -if (CMAKE_SYSTEM_NAME MATCHES "(SunOS|Solaris)") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthreads") -endif () - -if (APPLE AND NOT IOS) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=default") - if (NOT OPENSSL_ROOT_DIR) - EXECUTE_PROCESS(COMMAND brew --prefix openssl - OUTPUT_VARIABLE OPENSSL_ROOT_DIR - OUTPUT_STRIP_TRAILING_WHITESPACE) - message(STATUS "Using OpenSSL found at ${OPENSSL_ROOT_DIR}") - endif() -endif() +find_package(Threads) +find_package(Backtrace) +find_package(PythonInterp) +find_package(miniupnpc REQUIRED) +find_package(ZMQ REQUIRED) +find_package(Libunbound 1.16 REQUIRED) +find_package(sodium REQUIRED) +set(OPENSSL_ROOT_DIR /usr/local/openssl) +set(OPENSSL_LIBRARIES /usr/local/openssl/lib/) find_package(OpenSSL REQUIRED) -message(STATUS "Using OpenSSL include dir at ${OPENSSL_INCLUDE_DIR}") -include_directories(${OPENSSL_INCLUDE_DIR}) -if(STATIC AND NOT IOS) - if(UNIX) - set(OPENSSL_LIBRARIES "${OPENSSL_LIBRARIES};${CMAKE_DL_LIBS};${CMAKE_THREAD_LIBS_INIT}") - endif() -endif() - -if (WIN32) - list(APPEND OPENSSL_LIBRARIES ws2_32 crypt32) -endif() - -find_package(HIDAPI) - -add_definition_if_library_exists(c memset_s "string.h" HAVE_MEMSET_S) -add_definition_if_library_exists(c explicit_bzero "strings.h" HAVE_EXPLICIT_BZERO) -add_definition_if_function_found(strptime HAVE_STRPTIME) - -add_definitions(-DAUTO_INITIALIZE_EASYLOGGINGPP) - -set(MONERO_GENERATED_HEADERS_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated_include") -include_directories(${MONERO_GENERATED_HEADERS_DIR}) - -# As of OpenBSD 6.8, -march= breaks the build -function(set_default_arch) - if (OPENBSD) - set(ARCH default) - else() - set(ARCH native) - endif() - - set(ARCH ${ARCH} CACHE STRING "CPU to build for: -march value or 'default' to not pass -march at all") -endfunction() -if (NOT (MSVC OR ARCH)) - set_default_arch() -endif() - -option(COVERAGE "Enable profiling for test coverage report" OFF) -if(COVERAGE) - message(STATUS "Building with profiling for test coverage report") -endif() -macro (monero_enable_coverage) - if(COVERAGE) - foreach(COV_FLAG -fprofile-arcs -ftest-coverage --coverage) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COV_FLAG}") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COV_FLAG}") - endforeach() - endif() -endmacro() - -function (monero_add_library name) - monero_add_library_with_deps(NAME "${name}" SOURCES ${ARGN}) -endfunction() +set(BOOST_ROOT /usr/local) +find_package(Boost 1.70 REQUIRED COMPONENTS system filesystem thread date_time chrono regex serialization program_options locale) -function (monero_add_library_with_deps) - cmake_parse_arguments(MONERO_ADD_LIBRARY "" "NAME" "DEPENDS;SOURCES" ${ARGN}) - source_group("${MONERO_ADD_LIBRARY_NAME}" FILES ${MONERO_ADD_LIBRARY_SOURCES}) - - # Define a ("virtual") object library and an actual library that links those - # objects together. The virtual libraries can be arbitrarily combined to link - # any subset of objects into one library archive. This is used for releasing - # libwallet, which combines multiple components. - set(objlib obj_${MONERO_ADD_LIBRARY_NAME}) - add_library(${objlib} OBJECT ${MONERO_ADD_LIBRARY_SOURCES}) - add_library("${MONERO_ADD_LIBRARY_NAME}" $) - monero_set_target_no_relink("${MONERO_ADD_LIBRARY_NAME}") - monero_set_target_strip ("${MONERO_ADD_LIBRARY_NAME}") - if (MONERO_ADD_LIBRARY_DEPENDS) - add_dependencies(${objlib} ${MONERO_ADD_LIBRARY_DEPENDS}) - endif() - set_property(TARGET "${MONERO_ADD_LIBRARY_NAME}" PROPERTY FOLDER "libs") - target_compile_definitions(${objlib} - PRIVATE $) -endfunction () - -# Generate header for embedded translations -# Generate header for embedded translations, use target toolchain if depends, otherwise use the -# lrelease and lupdate binaries from the host include(ExternalProject) ExternalProject_Add(generate_translations_header SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/translations" @@ -674,595 +116,39 @@ ExternalProject_Add(generate_translations_header STAMP_DIR ${LRELEASE_PATH} CMAKE_ARGS -DLRELEASE_PATH=${LRELEASE_PATH} INSTALL_COMMAND ${CMAKE_COMMAND} -E echo "") -include_directories("${CMAKE_CURRENT_BINARY_DIR}/translations") -add_subdirectory(external) - -# Final setup for libunbound -include_directories(${UNBOUND_INCLUDE_DIR}) - -# Final setup for easylogging++ -include_directories(${EASYLOGGING_INCLUDE}) -link_directories(${EASYLOGGING_LIBRARY_DIRS}) - -# Final setup for liblmdb -include_directories(${LMDB_INCLUDE}) - -# Final setup for libunwind -include_directories(${LIBUNWIND_INCLUDE}) -link_directories(${LIBUNWIND_LIBRARY_DIRS}) - -# Final setup for hid -if (HIDAPI_FOUND) - message(STATUS "Using HIDAPI include dir at ${HIDAPI_INCLUDE_DIR}") - add_definitions(-DHAVE_HIDAPI) - include_directories(${HIDAPI_INCLUDE_DIR}) - link_directories(${LIBHIDAPI_LIBRARY_DIRS}) -else() - message(STATUS "Could not find HIDAPI") -endif() - -# Trezor support check -include(CheckTrezor) - -if(MSVC) - add_definitions("/bigobj /MP /W3 /GS- /D_CRT_SECURE_NO_WARNINGS /wd4996 /wd4345 /D_WIN32_WINNT=0x0600 /DWIN32_LEAN_AND_MEAN /DGTEST_HAS_TR1_TUPLE=0 /FIinline_c.h /D__SSE4_1__") - # set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Dinline=__inline") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:10485760") - if(STATIC) - foreach(VAR CMAKE_C_FLAGS_DEBUG CMAKE_CXX_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELEASE) - string(REPLACE "/MD" "/MT" ${VAR} "${${VAR}}") - endforeach() - endif() - include_directories(SYSTEM src/platform/msc) -else() - include(TestCXXAcceptsFlag) - message(STATUS "Building on ${CMAKE_SYSTEM_PROCESSOR} for ${ARCH}") - if(ARCH STREQUAL "default") - set(ARCH_FLAG "") - elseif(PPC64LE) - set(ARCH_FLAG "-mcpu=power8") - elseif(PPC64) - set(ARCH_FLAG "-mcpu=970") - elseif(PPC) - set(ARCH_FLAG "-mcpu=7400") - elseif(IOS AND ARCH STREQUAL "arm64") - message(STATUS "IOS: Changing arch from arm64 to armv8") - set(ARCH_FLAG "-march=armv8") - else() - set(ARCH_FLAG "-march=${ARCH}") - if(ARCH STREQUAL "native") - check_c_compiler_flag(-march=native CC_SUPPORTS_MARCH_NATIVE) - if (NOT CC_SUPPORTS_MARCH_NATIVE) - check_c_compiler_flag(-mtune=native CC_SUPPORTS_MTUNE_NATIVE) - if (CC_SUPPORTS_MTUNE_NATIVE) - set(ARCH_FLAG "-mtune=${ARCH}") - else() - set(ARCH_FLAG "") - endif() - endif() - endif() - endif() - - option(NO_AES "Explicitly disable AES support" ${NO_AES}) - - if(NO_AES) - message(STATUS "AES support explicitly disabled") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNO_AES") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNO_AES") - elseif(NOT ARM AND NOT PPC64LE AND NOT PPC64 AND NOT PPC AND NOT S390X AND NOT RISCV) - message(STATUS "AES support enabled") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -maes") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -maes") - elseif(PPC64LE OR PPC64 OR PPC) - message(STATUS "AES support not available on POWER") - elseif(S390X) - message(STATUS "AES support not available on s390x") - elseif(RISCV) - message(STATUS "AES support not available on RISC-V") - elseif(ARM6) - message(STATUS "AES support not available on ARMv6") - elseif(ARM7) - message(STATUS "AES support not available on ARMv7") - elseif(ARM8) - CHECK_CXX_ACCEPTS_FLAG("-march=${ARCH}+crypto" ARCH_PLUS_CRYPTO) - if(ARCH_PLUS_CRYPTO) - message(STATUS "Crypto extensions enabled for ARMv8") - set(ARCH_FLAG "-march=${ARCH}+crypto") - else() - message(STATUS "Crypto extensions unavailable on your ARMv8 device") - endif() - else() - message(STATUS "AES support disabled") - endif() - - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ARCH_FLAG}") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ARCH_FLAG}") - - set(WARNINGS "-Wall -Wextra -Wpointer-arith -Wundef -Wvla -Wwrite-strings -Wno-error=extra -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-error=unused-variable -Wno-error=undef -Wno-error=uninitialized") - if(CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") - if(ARM) - set(WARNINGS "${WARNINGS} -Wno-error=inline-asm") - endif() - else() - set(WARNINGS "${WARNINGS} -Wlogical-op -Wno-error=maybe-uninitialized -Wno-error=cpp") - endif() - if(MINGW) - set(WARNINGS "${WARNINGS} -Wno-error=unused-value -Wno-error=unused-but-set-variable") - set(MINGW_FLAG "${MINGW_FLAG} -DWIN32_LEAN_AND_MEAN") - set(Boost_THREADAPI win32) - include_directories(SYSTEM src/platform/mingw) - # mingw doesn't support LTO (multiple definition errors at link time) - set(USE_LTO_DEFAULT false) - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--stack,10485760") - if(NOT BUILD_64) - add_definitions(-DWINVER=0x0600 -D_WIN32_WINNT=0x0600) - endif() - endif() - set(C_WARNINGS "-Waggregate-return -Wnested-externs -Wold-style-definition -Wstrict-prototypes") - set(CXX_WARNINGS "-Wno-reorder -Wno-missing-field-initializers") - try_compile(STATIC_ASSERT_RES "${CMAKE_CURRENT_BINARY_DIR}/static-assert" "${CMAKE_CURRENT_SOURCE_DIR}/cmake/test-static-assert.c" CMAKE_FLAGS -DCMAKE_C_STANDARD=11) - if(STATIC_ASSERT_RES) - set(STATIC_ASSERT_FLAG "") - else() - set(STATIC_ASSERT_FLAG "-Dstatic_assert=_Static_assert") - endif() - - try_compile(STATIC_ASSERT_CPP_RES "${CMAKE_CURRENT_BINARY_DIR}/static-assert" "${CMAKE_CURRENT_SOURCE_DIR}/cmake/test-static-assert.cpp" CMAKE_FLAGS -DCMAKE_CXX_STANDARD=11) - if(STATIC_ASSERT_CPP_RES) - set(STATIC_ASSERT_CPP_FLAG "") - else() - set(STATIC_ASSERT_CPP_FLAG "-Dstatic_assert=_Static_assert") - endif() - - monero_enable_coverage() - # With GCC 6.1.1 the compiled binary malfunctions due to aliasing. Until that - # is fixed in the code (Issue #847), force compiler to be conservative. - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-strict-aliasing") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing") - - # if those don't work for your compiler, single it out where appropriate - if(CMAKE_BUILD_TYPE STREQUAL "Release" AND NOT OPENBSD) - set(C_SECURITY_FLAGS "${C_SECURITY_FLAGS} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1") - set(CXX_SECURITY_FLAGS "${CXX_SECURITY_FLAGS} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1") - endif() - - # warnings - add_c_flag_if_supported(-Wformat C_SECURITY_FLAGS) - add_cxx_flag_if_supported(-Wformat CXX_SECURITY_FLAGS) - add_c_flag_if_supported(-Wformat-security C_SECURITY_FLAGS) - add_cxx_flag_if_supported(-Wformat-security CXX_SECURITY_FLAGS) - - # -fstack-protector - if (NOT OPENBSD AND NOT (WIN32 AND (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_LESS 9.1))) - add_c_flag_if_supported(-fstack-protector C_SECURITY_FLAGS) - add_cxx_flag_if_supported(-fstack-protector CXX_SECURITY_FLAGS) - add_c_flag_if_supported(-fstack-protector-strong C_SECURITY_FLAGS) - add_cxx_flag_if_supported(-fstack-protector-strong CXX_SECURITY_FLAGS) - endif() - - # New in GCC 8.2 - if (NOT OPENBSD AND NOT (WIN32 AND (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_LESS 9.1))) - add_c_flag_if_supported(-fcf-protection=full C_SECURITY_FLAGS) - add_cxx_flag_if_supported(-fcf-protection=full CXX_SECURITY_FLAGS) - endif() - if (NOT WIN32 AND NOT OPENBSD) - add_c_flag_if_supported(-fstack-clash-protection C_SECURITY_FLAGS) - add_cxx_flag_if_supported(-fstack-clash-protection CXX_SECURITY_FLAGS) - endif() - - # Removed in GCC 9.1 (or before ?), but still accepted, so spams the output - if (NOT (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 9.1)) - add_c_flag_if_supported(-mmitigate-rop C_SECURITY_FLAGS) - add_cxx_flag_if_supported(-mmitigate-rop CXX_SECURITY_FLAGS) - endif() - - # linker - if (NOT SANITIZE AND NOT OSSFUZZ AND NOT (WIN32 AND (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND (CMAKE_C_COMPILER_VERSION VERSION_LESS 9.1 OR NOT STATIC)))) - # PIE executables randomly crash at startup with ASAN - # Windows binaries die on startup with PIE when compiled with GCC <9.x - # Windows dynamically-linked binaries die on startup with PIE regardless of GCC version - if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") - # Clang does not support -pie flag - add_linker_flag_if_supported("-Wl,-pie" LD_SECURITY_FLAGS) - else() - add_linker_flag_if_supported("-pie" LD_SECURITY_FLAGS) - endif() - endif() - add_linker_flag_if_supported(-Wl,-z,relro LD_SECURITY_FLAGS) - add_linker_flag_if_supported(-Wl,-z,now LD_SECURITY_FLAGS) - add_linker_flag_if_supported(-Wl,-z,noexecstack noexecstack_SUPPORTED) - if (noexecstack_SUPPORTED) - set(LD_SECURITY_FLAGS "${LD_SECURITY_FLAGS} -Wl,-z,noexecstack") - endif() - add_linker_flag_if_supported(-Wl,-z,noexecheap noexecheap_SUPPORTED) - if (noexecheap_SUPPORTED) - set(LD_SECURITY_FLAGS "${LD_SECURITY_FLAGS} -Wl,-z,noexecheap") - endif() - - if(BACKCOMPAT) - add_linker_flag_if_supported(-Wl,--wrap=__divmoddi4 LD_BACKCOMPAT_FLAGS) - add_linker_flag_if_supported(-Wl,--wrap=glob LD_BACKCOMPAT_FLAGS) - message(STATUS "Using Lib C back compat flags: ${LD_BACKCOMPAT_FLAGS}") - endif() - - # some windows linker bits - if (WIN32) - add_linker_flag_if_supported(-Wl,--dynamicbase LD_SECURITY_FLAGS) - add_linker_flag_if_supported(-Wl,--nxcompat LD_SECURITY_FLAGS) - add_linker_flag_if_supported(-Wl,--high-entropy-va LD_SECURITY_FLAGS) - endif() - - # Warnings, that when ignored are so severe, that they can segfault or even UB any application. - # Treat them as errors. - add_c_flag_if_supported( -Werror=switch C_SECURITY_FLAGS) - add_cxx_flag_if_supported(-Werror=switch CXX_SECURITY_FLAGS) - add_c_flag_if_supported( -Werror=return-type C_SECURITY_FLAGS) - add_cxx_flag_if_supported(-Werror=return-type CXX_SECURITY_FLAGS) - - 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}") - - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_GNU_SOURCE ${MINGW_FLAG} ${STATIC_ASSERT_FLAG} ${WARNINGS} ${C_WARNINGS} ${PIC_FLAG} ${C_SECURITY_FLAGS}") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GNU_SOURCE ${MINGW_FLAG} ${STATIC_ASSERT_CPP_FLAG} ${WARNINGS} ${CXX_WARNINGS} ${PIC_FLAG} ${CXX_SECURITY_FLAGS}") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LD_SECURITY_FLAGS} ${LD_BACKCOMPAT_FLAGS}") - - # With GCC 6.1.1 the compiled binary malfunctions due to aliasing. Until that - # is fixed in the code (Issue #847), force compiler to be conservative. - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-strict-aliasing") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing") - - if(ARM) - message(STATUS "Setting FPU Flags for ARM Processors") - - #NB NEON hardware does not fully implement the IEEE 754 standard for floating-point arithmetic - #Need custom assembly code to take full advantage of NEON SIMD - - #Cortex-A5/9 -mfpu=neon-fp16 - #Cortex-A7/15 -mfpu=neon-vfpv4 - #Cortex-A8 -mfpu=neon - #ARMv8 -FP and SIMD on by default for all ARM8v-A series, NO -mfpu setting needed - - #For custom -mtune, processor IDs for ARMv8-A series: - #0xd04 - Cortex-A35 - #0xd07 - Cortex-A57 - #0xd08 - Cortex-A72 - #0xd03 - Cortex-A73 - - if(NOT ARM8) - CHECK_CXX_ACCEPTS_FLAG(-mfpu=vfp3-d16 CXX_ACCEPTS_VFP3_D16) - CHECK_CXX_ACCEPTS_FLAG(-mfpu=vfp4 CXX_ACCEPTS_VFP4) - CHECK_CXX_ACCEPTS_FLAG(-mfloat-abi=hard CXX_ACCEPTS_MFLOAT_HARD) - CHECK_CXX_ACCEPTS_FLAG(-mfloat-abi=softfp CXX_ACCEPTS_MFLOAT_SOFTFP) - endif() - - if(ARM8) - CHECK_CXX_ACCEPTS_FLAG(-mfix-cortex-a53-835769 CXX_ACCEPTS_MFIX_CORTEX_A53_835769) - CHECK_CXX_ACCEPTS_FLAG(-mfix-cortex-a53-843419 CXX_ACCEPTS_MFIX_CORTEX_A53_843419) - endif() - - if(ARM6) - message(STATUS "Selecting VFP for ARMv6") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfpu=vfp") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpu=vfp") - if(DEPENDS) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -marm") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -marm") - endif() - endif(ARM6) - - if(ARM7) - if(CXX_ACCEPTS_VFP3_D16 AND NOT CXX_ACCEPTS_VFP4) - message(STATUS "Selecting VFP3 for ARMv7") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfpu=vfp3-d16") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpu=vfp3-d16") - endif() - - if(CXX_ACCEPTS_VFP4) - message(STATUS "Selecting VFP4 for ARMv7") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfpu=vfp4") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpu=vfp4") - endif() - - if(CXX_ACCEPTS_MFLOAT_HARD) - message(STATUS "Setting Hardware ABI for Floating Point") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfloat-abi=hard") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfloat-abi=hard") - endif() - - if(CXX_ACCEPTS_MFLOAT_SOFTFP AND NOT CXX_ACCEPTS_MFLOAT_HARD) - message(STATUS "Setting Software ABI for Floating Point") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfloat-abi=softfp") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfloat-abi=softfp") - endif() - endif(ARM7) - - if(ARM8) - if(CXX_ACCEPTS_MFIX_CORTEX_A53_835769) - message(STATUS "Enabling Cortex-A53 workaround 835769") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfix-cortex-a53-835769") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfix-cortex-a53-835769") - endif() - - if(CXX_ACCEPTS_MFIX_CORTEX_A53_843419) - message(STATUS "Enabling Cortex-A53 workaround 843419") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfix-cortex-a53-843419") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfix-cortex-a53-843419") - endif() - endif(ARM8) - - endif(ARM) - - # random crash on startup when asan is on if pie is enabled - if(NOT SANITIZE AND ANDROID AND NOT BUILD_GUI_DEPS STREQUAL "ON" OR IOS) - #From Android 5: "only position independent executables (PIE) are supported" - message(STATUS "Enabling PIE executable") - set(PIC_FLAG "") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIE") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIE") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_CXX_FLAGS} -fPIE -pie") - endif() - - if(APPLE) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=default -DGTEST_HAS_TR1_TUPLE=0") - endif() - set(DEBUG_FLAGS "-g3") - - # At least some CLANGs default to not enough for monero - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftemplate-depth=900") - - if(NOT DEFINED USE_LTO_DEFAULT) - set(USE_LTO_DEFAULT false) - endif() - set(USE_LTO ${USE_LTO_DEFAULT} CACHE BOOL "Use Link-Time Optimization (Release mode only)") - - if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - # There is a clang bug that does not allow to compile code that uses AES-NI intrinsics if -flto is enabled, so explicitly disable - set(USE_LTO false) - endif() - - - if(USE_LTO) - set(RELEASE_FLAGS "${RELEASE_FLAGS} -flto") - if(STATIC) - set(RELEASE_FLAGS "${RELEASE_FLAGS} -ffat-lto-objects") - endif() - # Since gcc 4.9 the LTO format is non-standard (slim), so we need the gcc-specific ar and ranlib binaries - if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9.0) AND NOT OPENBSD AND NOT DRAGONFLY) - # When invoking cmake on distributions on which gcc's binaries are prefixed - # with an arch-specific triplet, the user must specify -DCHOST= - if (DEFINED CHOST) - set(CMAKE_AR "${CHOST}-gcc-ar") - set(CMAKE_RANLIB "${CHOST}-gcc-ranlib") - else() - set(CMAKE_AR "gcc-ar") - set(CMAKE_RANLIB "gcc-ranlib") - endif() - endif() - endif() - - set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${DEBUG_FLAGS}") - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${DEBUG_FLAGS}") - set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${RELEASE_FLAGS}") - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${RELEASE_FLAGS}") - - if(STATIC) - # STATIC already configures most deps to be linked in statically, - # here we make more deps static if the platform permits it - if (MINGW) - # On Windows, this is as close to fully-static as we get: - # this leaves only deps on /c/Windows/system32/*.dll - set(STATIC_FLAGS "-static") - elseif (NOT (APPLE OR FREEBSD OR OPENBSD OR DRAGONFLY)) - # On Linux, we don't support fully static build, but these can be static - set(STATIC_FLAGS "-static-libgcc -static-libstdc++") - endif() - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${STATIC_FLAGS} ") - endif() -endif() - -if (${BOOST_IGNORE_SYSTEM_PATHS} STREQUAL "ON") - set(Boost_NO_SYSTEM_PATHS TRUE) -endif() - -set(OLD_LIB_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) -set(Boost_NO_BOOST_CMAKE ON) -if(STATIC) - if(MINGW) - set(CMAKE_FIND_LIBRARY_SUFFIXES .a) - endif() - - set(Boost_USE_STATIC_LIBS ON) - set(Boost_USE_STATIC_RUNTIME ON) -endif() -find_package(Boost 1.58 QUIET REQUIRED COMPONENTS system filesystem thread date_time chrono regex serialization program_options locale) -add_definitions(-DBOOST_ASIO_ENABLE_SEQUENTIAL_STRAND_ALLOCATION) - -set(CMAKE_FIND_LIBRARY_SUFFIXES ${OLD_LIB_SUFFIXES}) -if(NOT Boost_FOUND) - die("Could not find Boost libraries, please make sure you have installed Boost or libboost-all-dev (>=1.58) or the equivalent") -elseif(Boost_FOUND) - message(STATUS "Found Boost Version: ${Boost_VERSION}") - if (Boost_VERSION VERSION_LESS 10 AND Boost_VERSION VERSION_LESS 1.62.0 AND NOT (OPENSSL_VERSION VERSION_LESS 1.1)) - set(BOOST_BEFORE_1_62 true) - endif() - if (NOT Boost_VERSION VERSION_LESS 10 AND Boost_VERSION VERSION_LESS 106200 AND NOT (OPENSSL_VERSION VERSION_LESS 1.1)) - set(BOOST_BEFORE_1_62 true) - endif() - if (BOOST_BEFORE_1_62) - message(FATAL_ERROR "Boost ${Boost_VERSION} (older than 1.62) is too old to link with OpenSSL ${OPENSSL_VERSION} (1.1 or newer) found at ${OPENSSL_INCLUDE_DIR} and ${OPENSSL_LIBRARIES}. " - "Update Boost or install OpenSSL 1.0 and set path to it when running cmake: " - "cmake -DOPENSSL_ROOT_DIR='/usr/include/openssl-1.0'") - endif() -endif() - -include_directories(SYSTEM ${Boost_INCLUDE_DIRS}) -if(MINGW) - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wa,-mbig-obj") - set(EXTRA_LIBRARIES mswsock;ws2_32;iphlpapi;crypt32;bcrypt) - if(DEPENDS) - set(ICU_LIBRARIES icuio icui18n icuuc icudata icutu iconv) - else() - set(ICU_LIBRARIES icuio icuin icuuc icudt icutu iconv) - endif() -elseif(APPLE OR OPENBSD OR ANDROID) - set(EXTRA_LIBRARIES "") -elseif(FREEBSD) - set(EXTRA_LIBRARIES execinfo) -elseif(DRAGONFLY) - find_library(COMPAT compat) - set(EXTRA_LIBRARIES execinfo ${COMPAT}) -elseif(CMAKE_SYSTEM_NAME MATCHES "(SunOS|Solaris)") - set(EXTRA_LIBRARIES socket nsl resolv) -elseif(NOT MSVC AND NOT DEPENDS) - find_library(RT rt) - set(EXTRA_LIBRARIES ${RT}) -endif() - -list(APPEND EXTRA_LIBRARIES ${CMAKE_DL_LIBS}) - -if (HIDAPI_FOUND OR LibUSB_COMPILE_TEST_PASSED) - if (APPLE) - if(DEPENDS) - list(APPEND EXTRA_LIBRARIES "-framework Foundation -framework AppKit -framework IOKit") - else() - find_library(COREFOUNDATION CoreFoundation) - find_library(APPKIT AppKit) - find_library(IOKIT IOKit) - list(APPEND EXTRA_LIBRARIES ${APPKIT}) - list(APPEND EXTRA_LIBRARIES ${IOKIT}) - list(APPEND EXTRA_LIBRARIES ${COREFOUNDATION}) - endif() - endif() - if (WIN32) - list(APPEND EXTRA_LIBRARIES setupapi) - endif() -endif() - -option(USE_READLINE "Build with GNU readline support." ON) -if(USE_READLINE AND NOT DEPENDS) - find_package(Readline) - if(READLINE_FOUND AND GNU_READLINE_FOUND) - add_definitions(-DHAVE_READLINE) - include_directories(${Readline_INCLUDE_DIR}) - message(STATUS "Found readline library at: ${Readline_ROOT_DIR}") - set(EPEE_READLINE epee_readline) - else() - message(STATUS "Could not find GNU readline library so building without readline support") - endif() -elseif(USE_READLINE AND DEPENDS AND NOT MINGW) - find_path(Readline_INCLUDE_PATH readline/readline.h) - find_library(Readline_LIBRARY readline) - find_library(Terminfo_LIBRARY tinfo) - set(Readline_LIBRARY "${Readline_LIBRARY};${Terminfo_LIBRARY}") - set(GNU_READLINE_LIBRARY ${Readline_LIBRARY}) - add_definitions(-DHAVE_READLINE) - set(EPEE_READLINE epee_readline) -endif() - -if(ANDROID) - set(ATOMIC libatomic.a) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=user-defined-warnings") -endif() -if(CMAKE_C_COMPILER_ID MATCHES "Clang" AND ARCH_WIDTH EQUAL "32" AND NOT IOS AND NOT FREEBSD) - find_library(ATOMIC atomic) - if (ATOMIC_FOUND) - list(APPEND EXTRA_LIBRARIES ${ATOMIC}) - endif() -endif() - -find_path(ZMQ_INCLUDE_PATH zmq.h) -find_library(ZMQ_LIB zmq) -find_library(PGM_LIBRARY pgm) -find_library(NORM_LIBRARY norm) -find_library(GSSAPI_LIBRARY gssapi_krb5) -find_library(PROTOLIB_LIBRARY protolib) -find_library(SODIUM_LIBRARY sodium) -find_library(BSD_LIBRARY bsd) -find_library(MD_LIBRARY md) -find_library(PROTOKIT_LIBRARY protokit) - -if(NOT ZMQ_INCLUDE_PATH) - message(FATAL_ERROR "Could not find required header zmq.h") -endif() -if(NOT ZMQ_LIB) - message(FATAL_ERROR "Could not find required libzmq") -endif() -if(PGM_LIBRARY) - set(ZMQ_LIB "${ZMQ_LIB};${PGM_LIBRARY}") -endif() -if(NORM_LIBRARY) - set(ZMQ_LIB "${ZMQ_LIB};${NORM_LIBRARY}") -endif() -if(GSSAPI_LIBRARY) - set(ZMQ_LIB "${ZMQ_LIB};${GSSAPI_LIBRARY}") -endif() -if(PROTOLIB_LIBRARY) - set(ZMQ_LIB "${ZMQ_LIB};${PROTOLIB_LIBRARY}") -endif() -if(SODIUM_LIBRARY) - set(ZMQ_LIB "${ZMQ_LIB};${SODIUM_LIBRARY}") -endif() -if(BSD_LIBRARY) - set(ZMQ_LIB "${ZMQ_LIB};${BSD_LIBRARY}") -endif() -if(MD_LIBRARY) - set(ZMQ_LIB "${ZMQ_LIB};${MD_LIBRARY}") -endif() -if(PROTOKIT_LIBRARY) - set(ZMQ_LIB "${ZMQ_LIB};${PROTOKIT_LIBRARY}") -endif() - -include(external/supercop/functions.cmake) # place after setting flags and before src directory inclusion +add_subdirectory(external) add_subdirectory(contrib) add_subdirectory(src) -find_package(PythonInterp) -if(BUILD_TESTS) - message(STATUS "Building tests") - add_subdirectory(tests) -else() - message(STATUS "Not building tests") -endif() - -if(BUILD_DEBUG_UTILITIES) - message(STATUS "Building debug utilities") -else() - message(STATUS "Not building debug utilities") -endif() - -if(BUILD_DOCUMENTATION) - set(DOC_GRAPHS "YES" CACHE STRING "Create dependency graphs (needs graphviz)") - set(DOC_FULLGRAPHS "NO" CACHE STRING "Create call/callee graphs (large)") - - find_program(DOT_PATH dot) - - if (DOT_PATH STREQUAL "DOT_PATH-NOTFOUND") - message("Doxygen: graphviz not found - graphs disabled") - set(DOC_GRAPHS "NO") - endif() - - find_package(Doxygen) - if(DOXYGEN_FOUND) - configure_file("cmake/Doxyfile.in" "Doxyfile" @ONLY) - configure_file("cmake/Doxygen.extra.css.in" "Doxygen.extra.css" @ONLY) - add_custom_target(doc - ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - COMMENT "Generating API documentation with Doxygen.." VERBATIM) - endif() -endif() - -# when ON - will install libwallet_merged into "lib" -option(BUILD_GUI_DEPS "Build GUI dependencies." OFF) +# copy cmake/Find*.cmake files to the module folder +install(DIRECTORY "${CMAKE_SOURCE_DIR}/cmake/" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/monero/modules" + FILES_MATCHING PATTERN "Find*.cmake") + +# CMake version config +write_basic_package_version_file( + MoneroConfigVersion.cmake + VERSION ${PACKAGE_VERSION} + COMPATIBILITY AnyNewerVersion) +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/MoneroConfigVersion.cmake" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/monero") + +# CMake targets file +install(EXPORT MoneroTargets + FILE MoneroTargets.cmake + NAMESPACE monero:: + DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/monero") + +# generate CMake config file +configure_package_config_file("${CMAKE_SOURCE_DIR}/cmake/MoneroConfig.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/MoneroConfig.cmake" + INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/monero") + +# install CMake config file +install(FILES + "${CMAKE_CURRENT_BINARY_DIR}/MoneroConfig.cmake" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/monero" +) -find_package(PythonInterp) -find_program(iwyu_tool_path NAMES iwyu_tool.py iwyu_tool) -if (iwyu_tool_path AND PYTHONINTERP_FOUND) - add_custom_target(iwyu - COMMAND "${PYTHON_EXECUTABLE}" "${iwyu_tool_path}" -p "${CMAKE_BINARY_DIR}" -- --no_fwd_decls - COMMENT "Running include-what-you-use tool" - VERBATIM - ) -endif() +print_cmake_summary() \ No newline at end of file diff --git a/cmake/CheckLinkerFlag.c b/cmake/CheckLinkerFlag.c deleted file mode 100644 index a0dcc168d..000000000 --- a/cmake/CheckLinkerFlag.c +++ /dev/null @@ -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; -} diff --git a/cmake/CheckLinkerFlag.cmake b/cmake/CheckLinkerFlag.cmake deleted file mode 100644 index 7ecf5f610..000000000 --- a/cmake/CheckLinkerFlag.cmake +++ /dev/null @@ -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() diff --git a/cmake/CheckTrezor.cmake b/cmake/CheckTrezor.cmake deleted file mode 100644 index f600cc0bb..000000000 --- a/cmake/CheckTrezor.cmake +++ /dev/null @@ -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() diff --git a/cmake/Doxyfile.in b/cmake/Doxyfile.in deleted file mode 100644 index 81199d5e4..000000000 --- a/cmake/Doxyfile.in +++ /dev/null @@ -1,1803 +0,0 @@ -# Doxyfile 1.8.1.2 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project -# -# All text after a hash (#) is considered a comment and will be ignored -# The format is: -# TAG = value [value, ...] -# For lists items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (" ") - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all -# text before the first occurrence of this tag. Doxygen uses libiconv (or the -# iconv built into libc) for the transcoding. See -# https://www.gnu.org/software/libiconv for the list of possible encodings. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or sequence of words) that should -# identify the project. Note that if you do not use Doxywizard you need -# to put quotes around the project name if it contains spaces. - -PROJECT_NAME = Monero - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or -# if some version control system is used. - -PROJECT_NUMBER = @VERSION_STRING@ - -# Using the PROJECT_BRIEF tag one can provide an optional one line description -# for a project that appears at the top of each page and should give viewer -# a quick idea about the purpose of the project. Keep the description short. - -PROJECT_BRIEF = @CPACK_PACKAGE_DESCRIPTION_SUMMARY@ - -# With the PROJECT_LOGO tag one can specify an logo or icon that is -# included in the documentation. The maximum height of the logo should not -# exceed 55 pixels and the maximum width should not exceed 200 pixels. -# Doxygen will copy the logo to the output directory. - -PROJECT_LOGO = - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location -# where doxygen was started. If left blank the current directory will be used. - -OUTPUT_DIRECTORY = ./docs - -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create -# 4096 sub-directories (in 2 levels) under the output directory of each output -# format and will distribute the generated files over these directories. -# Enabling this option can be useful when feeding doxygen a huge amount of -# source files, where putting all generated files in the same directory would -# otherwise cause performance problems for the file system. - -CREATE_SUBDIRS = YES - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, -# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, -# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English -# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, -# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, -# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. - -OUTPUT_LANGUAGE = English - -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will -# include brief member descriptions after the members that are listed in -# the file and class documentation (similar to JavaDoc). -# Set to NO to disable this. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator -# that is used to form the text in various listings. Each string -# in this list, if found as the leading text of the brief description, will be -# stripped from the text and the result after processing the whole list, is -# used as the annotated text. Otherwise, the brief description is used as-is. -# If left blank, the following values are used ("$name" is automatically -# replaced with the name of the entity): "The $name class" "The $name widget" -# "The $name file" "is" "provides" "specifies" "contains" -# "represents" "a" "an" "the" - -ABBREVIATE_BRIEF = - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief -# description. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set -# to NO the shortest path that makes the file name unique will be used. - -FULL_PATH_NAMES = YES - -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the -# path to strip. - -STRIP_FROM_PATH = - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of -# the path mentioned in the documentation of a class, which tells -# the reader which header file to include in order to use a class. -# If left blank only the name of the header file containing the class -# definition is used. Otherwise one should specify the include paths that -# are normally passed to the compiler using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful if your file system -# doesn't support long names like on DOS, Mac, or CD-ROM. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like regular Qt-style comments -# (thus requiring an explicit @brief command for a brief description.) - -JAVADOC_AUTOBRIEF = NO - -# If the QT_AUTOBRIEF tag is set to YES then Doxygen will -# interpret the first line (until the first dot) of a Qt-style -# comment as the brief description. If set to NO, the comments -# will behave just like regular Qt-style comments (thus requiring -# an explicit \brief command for a brief description.) - -QT_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed -# description. Set this tag to YES if you prefer the old behaviour instead. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it -# re-implements. - -INHERIT_DOCS = YES - -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce -# a new page for each member. If set to NO, the documentation of a member will -# be part of the file/class/namespace that contains it. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. -# Doxygen uses this value to replace tabs by spaces in code fragments. - -TAB_SIZE = 4 - -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" will allow you to -# put the command \sideeffect (or @sideeffect) in the documentation, which -# will result in a user-defined paragraph with heading "Side Effects:". -# You can put \n's in the value part of an alias to insert newlines. - -ALIASES = - -# This tag can be used to specify a number of word-keyword mappings (TCL only). -# A mapping has the form "name=value". For example adding -# "class=itcl::class" will allow you to use the command class in the -# itcl::class meaning. - -TCL_SUBST = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C -# sources only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list -# of all members will be omitted, etc. - -OPTIMIZE_OUTPUT_FOR_C = NO - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java -# sources only. Doxygen will then generate output that is more tailored for -# Java. For instance, namespaces will be presented as packages, qualified -# scopes will look different, etc. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran -# sources only. Doxygen will then generate output that is more tailored for -# Fortran. - -OPTIMIZE_FOR_FORTRAN = NO - -# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL -# sources. Doxygen will then generate output that is tailored for -# VHDL. - -OPTIMIZE_OUTPUT_VHDL = NO - -# Doxygen selects the parser to use depending on the extension of the files it -# parses. With this tag you can assign which parser to use for a given extension. -# Doxygen has a built-in mapping, but you can override or extend it using this -# tag. The format is ext=language, where ext is a file extension, and language -# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C, -# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make -# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C -# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions -# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. - -EXTENSION_MAPPING = - -# If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all -# comments according to the Markdown format, which allows for more readable -# documentation. See https://daringfireball.net/projects/markdown/ for details. -# The output of markdown processing is further processed by doxygen, so you -# can mix doxygen, HTML, and XML commands with Markdown formatting. -# Disable only in case of backward compatibilities issues. - -MARKDOWN_SUPPORT = YES - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want -# to include (a tag file for) the STL sources as input, then you should -# set this tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. -# func(std::string) {}). This also makes the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. - -BUILTIN_STL_SUPPORT = YES - -# If you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. - -CPP_CLI_SUPPORT = NO - -# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. -# Doxygen will parse them like normal C++ but will assume all classes use public -# instead of private inheritance when no explicit protection keyword is present. - -SIP_SUPPORT = NO - -# For Microsoft's IDL there are propget and propput attributes to indicate getter -# and setter methods for a property. Setting this option to YES (the default) -# will make doxygen replace the get and set methods by a property in the -# documentation. This will only work if the methods are indeed getting or -# setting a simple type. If this is not the case, or you want to show the -# methods anyway, you should set this option to NO. - -IDL_PROPERTY_SUPPORT = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. - -DISTRIBUTE_GROUP_DOC = NO - -# Set the SUBGROUPING tag to YES (the default) to allow class member groups of -# the same type (for instance a group of public functions) to be put as a -# subgroup of that type (e.g. under the Public Functions section). Set it to -# NO to prevent subgrouping. Alternatively, this can be done per class using -# the \nosubgrouping command. - -SUBGROUPING = YES - -# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and -# unions are shown inside the group in which they are included (e.g. using -# @ingroup) instead of on a separate page (for HTML and Man pages) or -# section (for LaTeX and RTF). - -INLINE_GROUPED_CLASSES = NO - -# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and -# unions with only public data fields will be shown inline in the documentation -# of the scope in which they are defined (i.e. file, namespace, or group -# documentation), provided this scope is documented. If set to NO (the default), -# structs, classes, and unions are shown on a separate page (for HTML and Man -# pages) or section (for LaTeX and RTF). - -INLINE_SIMPLE_STRUCTS = NO - -# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum -# is documented as struct, union, or enum with the name of the typedef. So -# typedef struct TypeS {} TypeT, will appear in the documentation as a struct -# with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically -# be useful for C code in case the coding convention dictates that all compound -# types are typedef'ed and only the typedef is referenced, never the tag name. - -TYPEDEF_HIDES_STRUCT = NO - -# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to -# determine which symbols to keep in memory and which to flush to disk. -# When the cache is full, less often used symbols will be written to disk. -# For small to medium size projects (<1000 input files) the default value is -# probably good enough. For larger projects a too small cache size can cause -# doxygen to be busy swapping symbols to and from disk most of the time -# causing a significant performance penalty. -# If the system has enough physical memory increasing the cache will improve the -# performance by keeping more symbols in memory. Note that the value works on -# a logarithmic scale so increasing the size by one will roughly double the -# memory usage. The cache size is given by this formula: -# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, -# corresponding to a cache size of 2^16 = 65536 symbols. - -SYMBOL_CACHE_SIZE = 0 - -# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be -# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given -# their name and scope. Since this can be an expensive process and often the -# same symbol appear multiple times in the code, doxygen keeps a cache of -# pre-resolved symbols. If the cache is too small doxygen will become slower. -# If the cache is too large, memory is wasted. The cache size is given by this -# formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range is 0..9, the default is 0, -# corresponding to a cache size of 2^16 = 65536 symbols. - -LOOKUP_CACHE_SIZE = 0 - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless -# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES - -EXTRACT_ALL = YES - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class -# will be included in the documentation. - -EXTRACT_PRIVATE = NO - -# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal -# scope will be included in the documentation. - -EXTRACT_PACKAGE = NO - -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. - -EXTRACT_STATIC = NO - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. -# If set to NO only classes defined in header files are included. - -EXTRACT_LOCAL_CLASSES = YES - -# This flag is only useful for Objective-C code. When set to YES local -# methods, which are defined in the implementation section but not in -# the interface are included in the documentation. -# If set to NO (the default) only methods in the interface are included. - -EXTRACT_LOCAL_METHODS = NO - -# If this flag is set to YES, the members of anonymous namespaces will be -# extracted and appear in the documentation as a namespace called -# 'anonymous_namespace{file}', where file will be replaced with the base -# name of the file that contains the anonymous namespace. By default -# anonymous namespaces are hidden. - -EXTRACT_ANON_NSPACES = NO - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. -# This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various -# overviews. This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all -# friend (class|struct|union) declarations. -# If set to NO (the default) these declarations will be included in the -# documentation. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. -# If set to NO (the default) these blocks will be appended to the -# function's detailed documentation block. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. -# Set it to YES to include the internal documentation. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate -# file names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. - -CASE_SENSE_NAMES = NO - -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the -# documentation. If set to YES the scope will be hidden. - -HIDE_SCOPE_NAMES = NO - -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation -# of that file. - -SHOW_INCLUDE_FILES = YES - -# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen -# will list include files with double quotes in the documentation -# rather than with sharp brackets. - -FORCE_LOCAL_INCLUDES = NO - -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] -# is inserted in the documentation for inline members. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in -# declaration order. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the -# brief documentation of file, namespace and class members alphabetically -# by member name. If set to NO (the default) the members will appear in -# declaration order. - -SORT_BRIEF_DOCS = NO - -# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen -# will sort the (brief and detailed) documentation of class members so that -# constructors and destructors are listed first. If set to NO (the default) -# the constructors will appear in the respective orders defined by -# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. -# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO -# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. - -SORT_MEMBERS_CTORS_1ST = NO - -# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the -# hierarchy of group names into alphabetical order. If set to NO (the default) -# the group names will appear in their defined order. - -SORT_GROUP_NAMES = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be -# sorted by fully-qualified names, including namespaces. If set to -# NO (the default), the class list will be sorted only by class name, -# not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the -# alphabetical list. - -SORT_BY_SCOPE_NAME = NO - -# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to -# do proper type resolution of all parameters of a function it will reject a -# match between the prototype and the implementation of a member function even -# if there is only one candidate or it is obvious which candidate to choose -# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen -# will still accept a match between prototype and implementation in such cases. - -STRICT_PROTO_MATCHING = NO - -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo -# commands in the documentation. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test -# commands in the documentation. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug -# commands in the documentation. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting -# \deprecated commands in the documentation. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional -# documentation sections, marked by \if sectionname ... \endif. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or macro consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and macros in the -# documentation can be controlled using \showinitializer or \hideinitializer -# command in the documentation regardless of this setting. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the -# list will mention the files that were used to generate the documentation. - -SHOW_USED_FILES = YES - -# Set the SHOW_FILES tag to NO to disable the generation of the Files page. -# This will remove the Files entry from the Quick Index and from the -# Folder Tree View (if specified). The default is YES. - -SHOW_FILES = YES - -# Set the SHOW_NAMESPACES tag to NO to disable the generation of the -# Namespaces page. This will remove the Namespaces entry from the Quick Index -# and from the Folder Tree View (if specified). The default is YES. - -SHOW_NAMESPACES = YES - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from -# the version control system). Doxygen will invoke the program by executing (via -# popen()) the command , where is the value of -# the FILE_VERSION_FILTER tag, and is the name of an input file -# provided by doxygen. Whatever the program writes to standard output -# is used as the file version. See the manual for examples. - -FILE_VERSION_FILTER = - -# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed -# by doxygen. The layout file controls the global structure of the generated -# output files in an output format independent way. To create the layout file -# that represents doxygen's defaults, run doxygen with the -l option. -# You can optionally specify a file name after the option, if omitted -# DoxygenLayout.xml will be used as the name of the layout file. - -LAYOUT_FILE = - -# The CITE_BIB_FILES tag can be used to specify one or more bib files -# containing the references data. This must be a list of .bib files. The -# .bib extension is automatically appended if omitted. Using this command -# requires the bibtex tool to be installed. See also -# https://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style -# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this -# feature you need bibtex and perl available in the search path. - -CITE_BIB_FILES = - -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated -# by doxygen. Possible values are YES and NO. If left blank NO is used. - -QUIET = NO - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank -# NO is used. - -WARNINGS = YES - -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will -# automatically be disabled. - -WARN_IF_UNDOCUMENTED = YES - -# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some -# parameters in a documented function, or documenting parameters that -# don't exist or using markup commands wrongly. - -WARN_IF_DOC_ERROR = YES - -# The WARN_NO_PARAMDOC option can be enabled to get warnings for -# functions that are documented, but have no documentation for their parameters -# or return value. If set to NO (the default) doxygen will only warn about -# wrong or incomplete parameter documentation, but not about the absence of -# documentation. - -WARN_NO_PARAMDOC = NO - -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. Optionally the format may contain -# $version, which will be replaced by the version of the file (if it could -# be obtained via FILE_VERSION_FILTER) - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning -# and error messages should be written. If left blank the output is written -# to stderr. - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories -# with spaces. - -INPUT = ../README.md \ - ../contrib/ \ - ../external/ \ - ../include/ \ - ../tests/ \ - ../src/ - -# This tag can be used to specify the character encoding of the source files -# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is -# also the default input encoding. Doxygen uses libiconv (or the iconv built -# into libc) for the transcoding. See https://www.gnu.org/software/libiconv for -# the list of possible encodings. - -INPUT_ENCODING = UTF-8 - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh -# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py -# *.f90 *.f *.for *.vhd *.vhdl - -FILE_PATTERNS = *.cpp \ - *.h \ - *.hpp - -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. -# If left blank NO is used. - -RECURSIVE = YES - -# The EXCLUDE tag can be used to specify files and/or directories that should be -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. -# Note that relative paths are relative to the directory from which doxygen is -# run. - -EXCLUDE = - -# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or -# directories that are symbolic links (a Unix file system feature) are excluded -# from the input. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. Note that the wildcards are matched -# against the file with absolute path, so to exclude all test directories -# for example use the pattern */test/* - -EXCLUDE_PATTERNS = *.pb.* \ - tinythread.* \ - fast_mutex.* \ - anyoption.* \ - stacktrace.* \ - */simpleini/* \ - ExportWrapper.* \ - WinsockWrapper.* \ - otapicli.* \ - test*.* \ - irrXML.* \ - */chaiscript/* \ - */zmq/* - -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the -# output. The symbol name can be a fully qualified name, a word, or if the -# wildcard * is used, a substring. Examples: ANamespace, AClass, -# AClass::ANamespace, ANamespace::*Test - -EXCLUDE_SYMBOLS = tinythread - -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see -# the \include command). - -EXAMPLE_PATH = - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank all files are included. - -EXAMPLE_PATTERNS = - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. -# Possible values are YES and NO. If left blank NO is used. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see -# the \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command , where -# is the value of the INPUT_FILTER tag, and is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. If FILTER_PATTERNS is specified, this tag will be -# ignored. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. The filters are a list of the form: -# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further -# info on how filters are used. If FILTER_PATTERNS is empty or if -# non of the patterns match the file name, INPUT_FILTER is applied. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source -# files to browse (i.e. when SOURCE_BROWSER is set to YES). - -FILTER_SOURCE_FILES = NO - -# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file -# pattern. A pattern will override the setting for FILTER_PATTERN (if any) -# and it is also possible to disable source filtering for a specific pattern -# using *.ext= (so without naming a filter). This option only has effect when -# FILTER_SOURCE_FILES is enabled. - -FILTER_SOURCE_PATTERNS = - -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. - -SOURCE_BROWSER = YES - -# Setting the INLINE_SOURCES tag to YES will include the body -# of functions and classes directly in the documentation. - -INLINE_SOURCES = YES - -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code -# fragments. Normal C, C++ and Fortran comments will always remain visible. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES -# then for each documented function all documented -# functions referencing it will be listed. - -REFERENCED_BY_RELATION = NO - -# If the REFERENCES_RELATION tag is set to YES -# then for each documented function all documented entities -# called/used by that function will be listed. - -REFERENCES_RELATION = NO - -# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) -# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from -# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will -# link to the source code. Otherwise they will link to the documentation. - -REFERENCES_LINK_SOURCE = YES - -# If the USE_HTAGS tag is set to YES then the references to source code -# will point to the HTML generated by the htags(1) tool instead of doxygen -# built-in source browser. The htags tool is part of GNU's global source -# tagging system (see https://www.gnu.org/software/global/global.html). You -# will need version 4.8.6 or higher. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for -# which an include is specified. Set to NO to disable this. - -VERBATIM_HEADERS = YES - -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project -# contains a lot of classes, structs, unions or interfaces. - -ALPHABETICAL_INDEX = YES - -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns -# in which this list will be split (can be a number in the range [1..20]) - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes that -# should be ignored while generating the index headers. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will -# generate HTML output. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `html' will be used as the default path. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank -# doxygen will generate files with .html extension. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a -# standard header. Note that when using a custom header you are responsible -# for the proper inclusion of any scripts and style sheets that doxygen -# needs, which is dependent on the configuration options used. -# It is advised to generate a default header using "doxygen -w html -# header.html footer.html stylesheet.css YourConfigFile" and then modify -# that header. Note that the header is subject to change so you typically -# have to redo this when upgrading to a newer version of doxygen or when -# changing the value of configuration settings such as GENERATE_TREEVIEW! - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a -# standard footer. - -HTML_FOOTER = - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading -# style sheet that is used by each HTML page. It can be used to -# fine-tune the look of the HTML output. If the tag is left blank doxygen -# will generate a default style sheet. Note that doxygen will try to copy -# the style sheet file to the HTML output directory, so don't put your own -# style sheet in the HTML output directory as well, or it will be erased! - -HTML_STYLESHEET = - -# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or -# other source files which should be copied to the HTML output directory. Note -# that these files will be copied to the base HTML output directory. Use the -# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these -# files. In the HTML_STYLESHEET file, use the file name only. Also note that -# the files will be copied as-is; there are no commands or markers available. - -HTML_EXTRA_FILES = - -# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. -# Doxygen will adjust the colors in the style sheet and background images -# according to this color. Hue is specified as an angle on a colorwheel, -# see https://en.wikipedia.org/wiki/Hue for more information. -# For instance the value 0 represents red, 60 is yellow, 120 is green, -# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. -# The allowed range is 0 to 359. - -HTML_COLORSTYLE_HUE = 220 - -# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of -# the colors in the HTML output. For a value of 0 the output will use -# grayscales only. A value of 255 will produce the most vivid colors. - -HTML_COLORSTYLE_SAT = 100 - -# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to -# the luminance component of the colors in the HTML output. Values below -# 100 gradually make the output lighter, whereas values above 100 make -# the output darker. The value divided by 100 is the actual gamma applied, -# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, -# and 100 does not change the gamma. - -HTML_COLORSTYLE_GAMMA = 80 - -# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML -# page will contain the date and time when the page was generated. Setting -# this to NO can help when comparing the output of multiple runs. - -HTML_TIMESTAMP = YES - -# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML -# documentation will contain sections that can be hidden and shown after the -# page has loaded. - -HTML_DYNAMIC_SECTIONS = NO - -# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of -# entries shown in the various tree structured indices initially; the user -# can expand and collapse entries dynamically later on. Doxygen will expand -# the tree to such a level that at most the specified number of entries are -# visible (unless a fully collapsed tree already exceeds this amount). -# So setting the number of entries 1 will produce a full collapsed tree by -# default. 0 is a special value representing an infinite number of entries -# and will result in a full expanded tree by default. - -HTML_INDEX_NUM_ENTRIES = 100 - -# If the GENERATE_DOCSET tag is set to YES, additional index files -# will be generated that can be used as input for Apple's Xcode 3 -# integrated development environment, introduced with OSX 10.5 (Leopard). -# To create a documentation set, doxygen will generate a Makefile in the -# HTML output directory. Running make will produce the docset in that -# directory and running "make install" will install the docset in -# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find -# it at startup. -# See https://developer.apple.com/tools/creatingdocsetswithdoxygen.html -# for more information. - -GENERATE_DOCSET = NO - -# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the -# feed. A documentation feed provides an umbrella under which multiple -# documentation sets from a single provider (such as a company or product suite) -# can be grouped. - -DOCSET_FEEDNAME = "Doxygen generated docs" - -# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that -# should uniquely identify the documentation set bundle. This should be a -# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen -# will append .docset to the name. - -DOCSET_BUNDLE_ID = org.doxygen.Project - -# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify -# the documentation publisher. This should be a reverse domain-name style -# string, e.g. com.mycompany.MyDocSet.documentation. - -DOCSET_PUBLISHER_ID = org.doxygen.Publisher - -# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. - -DOCSET_PUBLISHER_NAME = Publisher - -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) -# of the generated HTML documentation. - -GENERATE_HTMLHELP = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can -# be used to specify the file name of the resulting .chm file. You -# can add a path in front of the file if the result should not be -# written to the html output directory. - -CHM_FILE = - -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) of -# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run -# the HTML help compiler on the generated index.hhp. - -HHC_LOCATION = - -# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag -# controls if a separate .chi index file is generated (YES) or that -# it should be included in the master .chm file (NO). - -GENERATE_CHI = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING -# is used to encode HtmlHelp index (hhk), content (hhc) and project file -# content. - -CHM_INDEX_ENCODING = - -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a -# normal table of contents (NO) in the .chm file. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members -# to the contents of the HTML help documentation and to the tree view. - -TOC_EXPAND = NO - -# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and -# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated -# that can be used as input for Qt's qhelpgenerator to generate a -# Qt Compressed Help (.qch) of the generated HTML documentation. - -GENERATE_QHP = NO - -# If the QHG_LOCATION tag is specified, the QCH_FILE tag can -# be used to specify the file name of the resulting .qch file. -# The path specified is relative to the HTML output folder. - -QCH_FILE = - -# The QHP_NAMESPACE tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#namespace - -QHP_NAMESPACE = org.doxygen.Project - -# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#virtual-folders - -QHP_VIRTUAL_FOLDER = doc - -# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to -# add. For more information please see -# http://doc.trolltech.com/qthelpproject.html#custom-filters - -QHP_CUST_FILTER_NAME = - -# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the -# custom filter to add. For more information please see -# -# Qt Help Project / Custom Filters. - -QHP_CUST_FILTER_ATTRS = - -# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this -# project's -# filter section matches. -# -# Qt Help Project / Filter Attributes. - -QHP_SECT_FILTER_ATTRS = - -# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can -# be used to specify the location of Qt's qhelpgenerator. -# If non-empty doxygen will try to run qhelpgenerator on the generated -# .qhp file. - -QHG_LOCATION = - -# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files -# will be generated, which together with the HTML files, form an Eclipse help -# plugin. To install this plugin and make it available under the help contents -# menu in Eclipse, the contents of the directory containing the HTML and XML -# files needs to be copied into the plugins directory of eclipse. The name of -# the directory within the plugins directory should be the same as -# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before -# the help appears. - -GENERATE_ECLIPSEHELP = NO - -# A unique identifier for the eclipse help plugin. When installing the plugin -# the directory name containing the HTML and XML files should also have -# this name. - -ECLIPSE_DOC_ID = org.doxygen.Project - -# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) -# at top of each HTML page. The value NO (the default) enables the index and -# the value YES disables it. Since the tabs have the same information as the -# navigation tree you can set this option to NO if you already set -# GENERATE_TREEVIEW to YES. - -DISABLE_INDEX = NO - -# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index -# structure should be generated to display hierarchical information. -# If the tag value is set to YES, a side panel will be generated -# containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). -# Windows users are probably better off using the HTML help feature. -# Since the tree basically has the same information as the tab index you -# could consider to set DISABLE_INDEX to NO when enabling this option. - -GENERATE_TREEVIEW = YES - -# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values -# (range [0,1..20]) that doxygen will group on one line in the generated HTML -# documentation. Note that a value of 0 will completely suppress the enum -# values from appearing in the overview section. - -ENUM_VALUES_PER_LINE = 4 - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be -# used to set the initial width (in pixels) of the frame in which the tree -# is shown. - -TREEVIEW_WIDTH = 250 - -# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open -# links to external symbols imported via tag files in a separate window. - -EXT_LINKS_IN_WINDOW = YES - -# Use this tag to change the font size of Latex formulas included -# as images in the HTML documentation. The default is 10. Note that -# when you change the font size after a successful doxygen run you need -# to manually remove any form_*.png images from the HTML output directory -# to force them to be regenerated. - -FORMULA_FONTSIZE = 10 - -# Use the FORMULA_TRANPARENT tag to determine whether or not the images -# generated for formulas are transparent PNGs. Transparent PNGs are -# not supported properly for IE 6.0, but are supported on all modern browsers. -# Note that when changing this option you need to delete any form_*.png files -# in the HTML output before the changes have effect. - -FORMULA_TRANSPARENT = YES - -# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax -# (see https://www.mathjax.org) which uses client side Javascript for the -# rendering instead of using prerendered bitmaps. Use this if you do not -# have LaTeX installed or if you want to formulas look prettier in the HTML -# output. When enabled you may also need to install MathJax separately and -# configure the path to it using the MATHJAX_RELPATH option. - -USE_MATHJAX = NO - -# When MathJax is enabled you need to specify the location relative to the -# HTML output directory using the MATHJAX_RELPATH option. The destination -# directory should contain the MathJax.js script. For instance, if the mathjax -# directory is located at the same level as the HTML output directory, then -# MATHJAX_RELPATH should be ../mathjax. The default value points to -# the MathJax Content Delivery Network so you can quickly see the result without -# installing MathJax. However, it is strongly recommended to install a local -# copy of MathJax from https://www.mathjax.org before deployment. - -MATHJAX_RELPATH = https://cdn.mathjax.org/mathjax/latest - -# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension -# names that should be enabled during MathJax rendering. - -MATHJAX_EXTENSIONS = - -# When the SEARCHENGINE tag is enabled doxygen will generate a search box -# for the HTML output. The underlying search engine uses javascript -# and DHTML and should work on any modern browser. Note that when using -# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets -# (GENERATE_DOCSET) there is already a search function so this one should -# typically be disabled. For large projects the javascript based search engine -# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. - -SEARCHENGINE = YES - -# When the SERVER_BASED_SEARCH tag is enabled the search engine will be -# implemented using a PHP enabled web server instead of at the web client -# using Javascript. Doxygen will generate the search PHP script and index -# file to put on the web server. The advantage of the server -# based approach is that it scales better to large projects and allows -# full text search. The disadvantages are that it is more difficult to setup -# and does not have live searching capabilities. - -SERVER_BASED_SEARCH = NO - -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- - -# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will -# generate Latex output. - -GENERATE_LATEX = NO - -# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `latex' will be used as the default path. - -LATEX_OUTPUT = latex - -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be -# invoked. If left blank `latex' will be used as the default command name. -# Note that when enabling USE_PDFLATEX this option is only used for -# generating bitmaps for formulas in the HTML output, but not in the -# Makefile that is written to the output directory. - -LATEX_CMD_NAME = latex - -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to -# generate index for LaTeX. If left blank `makeindex' will be used as the -# default command name. - -MAKEINDEX_CMD_NAME = makeindex - -# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact -# LaTeX documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_LATEX = NO - -# The PAPER_TYPE tag can be used to set the paper type that is used -# by the printer. Possible values are: a4, letter, legal and -# executive. If left blank a4wide will be used. - -PAPER_TYPE = a4 - -# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX -# packages that should be included in the LaTeX output. - -EXTRA_PACKAGES = - -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for -# the generated latex document. The header should contain everything until -# the first chapter. If it is left blank doxygen will generate a -# standard header. Notice: only use this tag if you know what you are doing! - -LATEX_HEADER = - -# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for -# the generated latex document. The footer should contain everything after -# the last chapter. If it is left blank doxygen will generate a -# standard footer. Notice: only use this tag if you know what you are doing! - -LATEX_FOOTER = - -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated -# is prepared for conversion to pdf (using ps2pdf). The pdf file will -# contain links (just like the HTML output) instead of page references -# This makes the output suitable for online browsing using a pdf viewer. - -PDF_HYPERLINKS = YES - -# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of -# plain latex in the generated Makefile. Set this option to YES to get a -# higher quality PDF documentation. - -USE_PDFLATEX = YES - -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. -# command to the generated LaTeX files. This will instruct LaTeX to keep -# running if errors occur, instead of asking the user for help. -# This option is also used when generating formulas in HTML. - -LATEX_BATCHMODE = NO - -# If LATEX_HIDE_INDICES is set to YES then doxygen will not -# include the index chapters (such as File Index, Compound Index, etc.) -# in the output. - -LATEX_HIDE_INDICES = NO - -# If LATEX_SOURCE_CODE is set to YES then doxygen will include -# source code with syntax highlighting in the LaTeX output. -# Note that which sources are shown also depends on other settings -# such as SOURCE_BROWSER. - -LATEX_SOURCE_CODE = NO - -# The LATEX_BIB_STYLE tag can be used to specify the style to use for the -# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See -# https://en.wikipedia.org/wiki/BibTeX for more info. - -LATEX_BIB_STYLE = plain - -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- - -# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output -# The RTF output is optimized for Word 97 and may not look very pretty with -# other RTF readers or editors. - -GENERATE_RTF = NO - -# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `rtf' will be used as the default path. - -RTF_OUTPUT = rtf - -# If the COMPACT_RTF tag is set to YES Doxygen generates more compact -# RTF documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_RTF = NO - -# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated -# will contain hyperlink fields. The RTF file will -# contain links (just like the HTML output) instead of page references. -# This makes the output suitable for online browsing using WORD or other -# programs which support those fields. -# Note: wordpad (write) and others do not support links. - -RTF_HYPERLINKS = NO - -# Load style sheet definitions from file. Syntax is similar to doxygen's -# config file, i.e. a series of assignments. You only have to provide -# replacements, missing definitions are set to their default value. - -RTF_STYLESHEET_FILE = - -# Set optional variables used in the generation of an rtf document. -# Syntax is similar to doxygen's config file. - -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- - -# If the GENERATE_MAN tag is set to YES (the default) Doxygen will -# generate man pages - -GENERATE_MAN = NO - -# The MAN_OUTPUT tag is used to specify where the man pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `man' will be used as the default path. - -MAN_OUTPUT = man - -# The MAN_EXTENSION tag determines the extension that is added to -# the generated man pages (default is the subroutine's section .3) - -MAN_EXTENSION = .3 - -# If the MAN_LINKS tag is set to YES and Doxygen generates man output, -# then it will generate one additional man file for each entity -# documented in the real man page(s). These additional files -# only source the real man page, but without them the man command -# would be unable to find the correct page. The default is NO. - -MAN_LINKS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- - -# If the GENERATE_XML tag is set to YES Doxygen will -# generate an XML file that captures the structure of -# the code including all documentation. - -GENERATE_XML = NO - -# The XML_OUTPUT tag is used to specify where the XML pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `xml' will be used as the default path. - -XML_OUTPUT = xml - -# The XML_SCHEMA tag can be used to specify an XML schema, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_SCHEMA = - -# The XML_DTD tag can be used to specify an XML DTD, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_DTD = - -# If the XML_PROGRAMLISTING tag is set to YES Doxygen will -# dump the program listings (including syntax highlighting -# and cross-referencing information) to the XML output. Note that -# enabling this will significantly increase the size of the XML output. - -XML_PROGRAMLISTING = YES - -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- - -# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will -# generate an AutoGen Definitions (see autogen.sf.net) file -# that captures the structure of the code including all -# documentation. Note that this feature is still experimental -# and incomplete at the moment. - -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- - -# If the GENERATE_PERLMOD tag is set to YES Doxygen will -# generate a Perl module file that captures the structure of -# the code including all documentation. Note that this -# feature is still experimental and incomplete at the -# moment. - -GENERATE_PERLMOD = NO - -# If the PERLMOD_LATEX tag is set to YES Doxygen will generate -# the necessary Makefile rules, Perl scripts and LaTeX code to be able -# to generate PDF and DVI output from the Perl module output. - -PERLMOD_LATEX = NO - -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be -# nicely formatted so it can be parsed by a human reader. This is useful -# if you want to understand what is going on. On the other hand, if this -# tag is set to NO the size of the Perl module output will be much smaller -# and Perl will parse it just the same. - -PERLMOD_PRETTY = YES - -# The names of the make variables in the generated doxyrules.make file -# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. -# This is useful so different doxyrules.make files included by the same -# Makefile don't overwrite each other's variables. - -PERLMOD_MAKEVAR_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- - -# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will -# evaluate all C-preprocessor directives found in the sources and include -# files. - -ENABLE_PREPROCESSING = YES - -# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro -# names in the source code. If set to NO (the default) only conditional -# compilation will be performed. Macro expansion can be done in a controlled -# way by setting EXPAND_ONLY_PREDEF to YES. - -MACRO_EXPANSION = NO - -# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES -# then the macro expansion is limited to the macros specified with the -# PREDEFINED and EXPAND_AS_DEFINED tags. - -EXPAND_ONLY_PREDEF = NO - -# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files -# pointed to by INCLUDE_PATH will be searched when a #include is found. - -SEARCH_INCLUDES = YES - -# The INCLUDE_PATH tag can be used to specify one or more directories that -# contain include files that are not input files but should be processed by -# the preprocessor. - -INCLUDE_PATH = - -# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard -# patterns (like *.h and *.hpp) to filter out the header-files in the -# directories. If left blank, the patterns specified with FILE_PATTERNS will -# be used. - -INCLUDE_FILE_PATTERNS = - -# The PREDEFINED tag can be used to specify one or more macro names that -# are defined before the preprocessor is started (similar to the -D option of -# gcc). The argument of the tag is a list of macros of the form: name -# or name=definition (no spaces). If the definition and the = are -# omitted =1 is assumed. To prevent a macro definition from being -# undefined via #undef or recursively expanded use the := operator -# instead of the = operator. - -PREDEFINED = OT_CRYPTO_USING_OPENSSL \ - OT_CASH_USING_LUCRE - -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then -# this tag can be used to specify a list of macro names that should be expanded. -# The macro definition that is found in the sources will be used. -# Use the PREDEFINED tag if you want to use a different macro definition that -# overrules the definition found in the source code. - -EXPAND_AS_DEFINED = - -# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then -# doxygen's preprocessor will remove all references to function-like macros -# that are alone on a line, have an all uppercase name, and do not end with a -# semicolon, because these will confuse the parser if not removed. - -SKIP_FUNCTION_MACROS = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- - -# The TAGFILES option can be used to specify one or more tagfiles. For each -# tag file the location of the external documentation should be added. The -# format of a tag file without this location is as follows: -# TAGFILES = file1 file2 ... -# Adding location for the tag files is done as follows: -# TAGFILES = file1=loc1 "file2 = loc2" ... -# where "loc1" and "loc2" can be relative or absolute paths -# or URLs. Note that each tag file must have a unique name (where the name does -# NOT include the path). If a tag file is not located in the directory in which -# doxygen is run, you must also specify the path to the tagfile here. - -TAGFILES = - -# When a file name is specified after GENERATE_TAGFILE, doxygen will create -# a tag file that is based on the input files it reads. - -GENERATE_TAGFILE = - -# If the ALLEXTERNALS tag is set to YES all external classes will be listed -# in the class index. If set to NO only the inherited external classes -# will be listed. - -ALLEXTERNALS = NO - -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will -# be listed. - -EXTERNAL_GROUPS = YES - -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of `which perl'). - -PERL_PATH = /usr/bin/perl - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- - -# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will -# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base -# or super classes. Setting the tag to NO turns the diagrams off. Note that -# this option also works with HAVE_DOT disabled, but it is recommended to -# install and use dot, since it yields more powerful graphs. - -CLASS_DIAGRAMS = NO - -# You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see -# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the -# documentation. The MSCGEN_PATH tag allows you to specify the directory where -# the mscgen tool resides. If left empty the tool is assumed to be found in the -# default search path. - -MSCGEN_PATH = - -# If set to YES, the inheritance and collaboration graphs will hide -# inheritance and usage relations if the target is undocumented -# or is not a class. - -HIDE_UNDOC_RELATIONS = YES - -# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is -# available from the path. This tool is part of Graphviz, a graph visualization -# toolkit from AT&T and Lucent Bell Labs. The other options in this section -# have no effect if this option is set to NO (the default) - -HAVE_DOT = YES - -# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is -# allowed to run in parallel. When set to 0 (the default) doxygen will -# base this on the number of processors available in the system. You can set it -# explicitly to a value larger than 0 to get control over the balance -# between CPU load and processing speed. - -DOT_NUM_THREADS = 0 - -# By default doxygen will use the Helvetica font for all dot files that -# doxygen generates. When you want a differently looking font you can specify -# the font name using DOT_FONTNAME. You need to make sure dot is able to find -# the font, which can be done by putting it in a standard location or by setting -# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the -# directory containing the font. - -DOT_FONTNAME = Helvetica - -# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. -# The default size is 10pt. - -DOT_FONTSIZE = 10 - -# By default doxygen will tell dot to use the Helvetica font. -# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to -# set the path where dot can find it. - -DOT_FONTPATH = - -# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect inheritance relations. Setting this tag to YES will force the -# CLASS_DIAGRAMS tag to NO. - -CLASS_GRAPH = YES - -# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect implementation dependencies (inheritance, containment, and -# class references variables) of the class with other documented classes. - -COLLABORATION_GRAPH = YES - -# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for groups, showing the direct groups dependencies - -GROUP_GRAPHS = YES - -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and -# collaboration diagrams in a style similar to the OMG's Unified Modeling -# Language. - -UML_LOOK = NO - -# If the UML_LOOK tag is enabled, the fields and methods are shown inside -# the class node. If there are many fields or methods and many nodes the -# graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS -# threshold limits the number of items for each type to make the size more -# managable. Set this to 0 for no limit. Note that the threshold may be -# exceeded by 50% before the limit is enforced. - -UML_LIMIT_NUM_FIELDS = 10 - -# If set to YES, the inheritance and collaboration graphs will show the -# relations between templates and their instances. - -TEMPLATE_RELATIONS = NO - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT -# tags are set to YES then doxygen will generate a graph for each documented -# file showing the direct and indirect include dependencies of the file with -# other documented files. - -INCLUDE_GRAPH = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and -# HAVE_DOT tags are set to YES then doxygen will generate a graph for each -# documented header file showing the documented files that directly or -# indirectly include this file. - -INCLUDED_BY_GRAPH = YES - -# If the CALL_GRAPH and HAVE_DOT options are set to YES then -# doxygen will generate a call dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable call graphs -# for selected functions only using the \callgraph command. - -CALL_GRAPH = YES - -# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then -# doxygen will generate a caller dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable caller -# graphs for selected functions only using the \callergraph command. - -CALLER_GRAPH = YES - -# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen -# will generate a graphical hierarchy of all classes instead of a textual one. - -GRAPHICAL_HIERARCHY = YES - -# If the DIRECTORY_GRAPH and HAVE_DOT tags are set to YES -# then doxygen will show the dependencies a directory has on other directories -# in a graphical way. The dependency relations are determined by the #include -# relations between the files in the directories. - -DIRECTORY_GRAPH = YES - -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. Possible values are svg, png, jpg, or gif. -# If left blank png will be used. If you choose svg you need to set -# HTML_FILE_EXTENSION to xhtml in order to make the SVG files -# visible in IE 9+ (other browsers do not have this requirement). - -DOT_IMAGE_FORMAT = png - -# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to -# enable generation of interactive SVG images that allow zooming and panning. -# Note that this requires a modern browser other than Internet Explorer. -# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you -# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files -# visible. Older versions of IE do not have SVG support. - -INTERACTIVE_SVG = NO - -# The tag DOT_PATH can be used to specify the path where the dot tool can be -# found. If left blank, it is assumed the dot tool can be found in the path. - -DOT_PATH = - -# The DOTFILE_DIRS tag can be used to specify one or more directories that -# contain dot files that are included in the documentation (see the -# \dotfile command). - -DOTFILE_DIRS = - -# The MSCFILE_DIRS tag can be used to specify one or more directories that -# contain msc files that are included in the documentation (see the -# \mscfile command). - -MSCFILE_DIRS = - -# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of -# nodes that will be shown in the graph. If the number of nodes in a graph -# becomes larger than this value, doxygen will truncate the graph, which is -# visualized by representing a node as a red box. Note that doxygen if the -# number of direct children of the root node in a graph is already larger than -# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note -# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. - -DOT_GRAPH_MAX_NODES = 50 - -# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the -# graphs generated by dot. A depth value of 3 means that only nodes reachable -# from the root by following a path via at most 3 edges will be shown. Nodes -# that lay further from the root node will be omitted. Note that setting this -# option to 1 or 2 may greatly reduce the computation time needed for large -# code bases. Also note that the size of a graph can be further restricted by -# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. - -MAX_DOT_GRAPH_DEPTH = 0 - -# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent -# background. This is disabled by default, because dot on Windows does not -# seem to support this out of the box. Warning: Depending on the platform used, -# enabling this option may lead to badly anti-aliased labels on the edges of -# a graph (i.e. they become hard to read). - -DOT_TRANSPARENT = NO - -# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output -# files in one run (i.e. multiple -o and -T options on the command line). This -# makes dot run faster, but since only newer versions of dot (>1.8.10) -# support this, this feature is disabled by default. - -DOT_MULTI_TARGETS = NO - -# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will -# generate a legend page explaining the meaning of the various boxes and -# arrows in the dot generated graphs. - -GENERATE_LEGEND = YES - -# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will -# remove the intermediate dot files that are used to generate -# the various graphs. - -DOT_CLEANUP = YES diff --git a/cmake/Doxygen.extra.css.in b/cmake/Doxygen.extra.css.in deleted file mode 100644 index 022974fac..000000000 --- a/cmake/Doxygen.extra.css.in +++ /dev/null @@ -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; -} -*/ diff --git a/cmake/FindLibunbound.cmake b/cmake/FindLibunbound.cmake new file mode 100644 index 000000000..dc08a8b51 --- /dev/null +++ b/cmake/FindLibunbound.cmake @@ -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) diff --git a/cmake/FindUnbound.cmake b/cmake/FindUnbound.cmake deleted file mode 100644 index 611b047ab..000000000 --- a/cmake/FindUnbound.cmake +++ /dev/null @@ -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) diff --git a/cmake/FindZMQ.cmake b/cmake/FindZMQ.cmake new file mode 100644 index 000000000..11319098c --- /dev/null +++ b/cmake/FindZMQ.cmake @@ -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 ) \ No newline at end of file diff --git a/cmake/Findsodium.cmake b/cmake/Findsodium.cmake new file mode 100644 index 000000000..3792815b9 --- /dev/null +++ b/cmake/Findsodium.cmake @@ -0,0 +1,291 @@ +# Written in 2016 by Henrik Steffen Gaßmann +# +# 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() \ No newline at end of file diff --git a/cmake/MoneroConfig.cmake.in b/cmake/MoneroConfig.cmake.in new file mode 100644 index 000000000..2fb7a8313 --- /dev/null +++ b/cmake/MoneroConfig.cmake.in @@ -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) \ No newline at end of file diff --git a/cmake/SetClangTidy.cmake b/cmake/SetClangTidy.cmake deleted file mode 100644 index 88dfe4be2..000000000 --- a/cmake/SetClangTidy.cmake +++ /dev/null @@ -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() - diff --git a/cmake/functions.cmake b/cmake/functions.cmake new file mode 100644 index 000000000..09ede1af8 --- /dev/null +++ b/cmake/functions.cmake @@ -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() \ No newline at end of file diff --git a/cmake/test-libusb-version.c b/cmake/test-libusb-version.c deleted file mode 100644 index 9f22416b8..000000000 --- a/cmake/test-libusb-version.c +++ /dev/null @@ -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 - -#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); -} diff --git a/cmake/test-protobuf.cpp b/cmake/test-protobuf.cpp deleted file mode 100644 index f1665969e..000000000 --- a/cmake/test-protobuf.cpp +++ /dev/null @@ -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 -#include -#include -#include -#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; -} diff --git a/cmake/test-protobuf.proto b/cmake/test-protobuf.proto deleted file mode 100644 index 5300aea35..000000000 --- a/cmake/test-protobuf.proto +++ /dev/null @@ -1,7 +0,0 @@ -syntax = "proto2"; - -import "google/protobuf/descriptor.proto"; - -message Success { - optional string message = 1; -} diff --git a/cmake/test-static-assert.c b/cmake/test-static-assert.c deleted file mode 100644 index 1697bfeb9..000000000 --- a/cmake/test-static-assert.c +++ /dev/null @@ -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 - -static_assert(1, "FAIL"); -int main(int argc, char *argv[]) { - return 0; -} diff --git a/cmake/test-static-assert.cpp b/cmake/test-static-assert.cpp deleted file mode 100644 index 1697bfeb9..000000000 --- a/cmake/test-static-assert.cpp +++ /dev/null @@ -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 - -static_assert(1, "FAIL"); -int main(int argc, char *argv[]) { - return 0; -} diff --git a/contrib/CMakeLists.txt b/contrib/CMakeLists.txt index 10296514c..384175344 100644 --- a/contrib/CMakeLists.txt +++ b/contrib/CMakeLists.txt @@ -26,6 +26,5 @@ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -monero_enable_coverage() add_subdirectory(epee) diff --git a/contrib/epee/src/CMakeLists.txt b/contrib/epee/src/CMakeLists.txt index 808b9f09e..23b6002e6 100644 --- a/contrib/epee/src/CMakeLists.txt +++ b/contrib/epee/src/CMakeLists.txt @@ -27,64 +27,38 @@ # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. set(EPEE_INCLUDE_DIR_BASE "${CMAKE_CURRENT_SOURCE_DIR}/../include") +file(GLOB EPEE_HEADERS_PUBLIC "${EPEE_INCLUDE_DIR_BASE}/*.h") -# Add headers to the file list, to be able to search for them and autosave in IDEs. -monero_find_all_headers(EPEE_HEADERS_PUBLIC "${EPEE_INCLUDE_DIR_BASE}") - -monero_add_library(epee byte_slice.cpp byte_stream.cpp hex.cpp abstract_http_client.cpp http_auth.cpp mlog.cpp net_helper.cpp net_utils_base.cpp string_tools.cpp parserse_base_utils.cpp - wipeable_string.cpp levin_base.cpp memwipe.c connection_basic.cpp network_throttle.cpp network_throttle-detail.cpp mlocker.cpp buffer.cpp net_ssl.cpp - int-util.cpp portable_storage.cpp - misc_language.cpp - file_io_utils.cpp - net_parse_helpers.cpp - http_base.cpp - ${EPEE_HEADERS_PUBLIC} +file(GLOB EPEE_SOURCES + "${CMAKE_CURRENT_SOURCE_DIR}/*.c" + "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp" ) -if (USE_READLINE AND (GNU_READLINE_FOUND OR (DEPENDS AND NOT MINGW))) - monero_add_library(epee_readline readline_buffer.cpp) -endif() +add_library(epee) +target_sources(epee + 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) -# Build and install libepee if we're building for GUI -if (BUILD_GUI_DEPS) - if(IOS) - set(lib_folder lib-${ARCH}) - else() - set(lib_folder lib) - endif() - install(TARGETS epee - ARCHIVE DESTINATION ${lib_folder}) - if (USE_READLINE AND GNU_READLINE_FOUND) - install(TARGETS epee_readline - ARCHIVE DESTINATION ${lib_folder}) - endif() -endif() - target_link_libraries(epee PUBLIC easylogging - ${Boost_CHRONO_LIBRARY} - ${Boost_FILESYSTEM_LIBRARY} - ${Boost_THREAD_LIBRARY} - ${Boost_REGEX_LIBRARY} - ${Boost_SYSTEM_LIBRARY} - ${OPENSSL_LIBRARIES} - PRIVATE - ${EXTRA_LIBRARIES}) - -if (USE_READLINE AND (GNU_READLINE_FOUND OR (DEPENDS AND NOT MINGW))) - target_link_libraries(epee_readline - PUBLIC - easylogging - ${Boost_SYSTEM_LIBRARY} - PRIVATE - ${GNU_READLINE_LIBRARY}) -endif() + Boost::chrono + Boost::filesystem + Boost::thread + Boost::regex + Boost::system + OpenSSL::SSL) target_include_directories(epee - PUBLIC - "${EPEE_INCLUDE_DIR_BASE}" - "${OPENSSL_INCLUDE_DIR}") + PUBLIC $ + PUBLIC $) +monero_install_library(epee "${CMAKE_INSTALL_INCLUDEDIR}/monero/epee/") \ No newline at end of file diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index 29aed0cc6..d61049aec 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -28,45 +28,8 @@ # # Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers - -# This is broken up into two parts: first we check for miniupnp, compile it if we can't -# find it, and thereafter we check for libunbound, and compile it if we can't find it. -# We always compile if we are building statically to reduce static dependency issues... -# ...except for FreeBSD, because FreeBSD is a special case that doesn't play well with -# others. - -find_package(Miniupnpc REQUIRED) - -message(STATUS "Using in-tree miniupnpc") -set(UPNPC_NO_INSTALL TRUE CACHE BOOL "Disable miniupnp installation" FORCE) -add_subdirectory(miniupnp/miniupnpc) -set_property(TARGET libminiupnpc-static PROPERTY FOLDER "external") -set_property(TARGET libminiupnpc-static PROPERTY POSITION_INDEPENDENT_CODE ON) -if(MSVC) - set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -wd4244 -wd4267") -elseif(NOT MSVC) - set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-undef -Wno-unused-result -Wno-unused-value") -endif() -if(CMAKE_SYSTEM_NAME MATCHES "NetBSD") - set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -D_NETBSD_SOURCE") -endif() - -set(UPNP_LIBRARIES "libminiupnpc-static" PARENT_SCOPE) - -find_package(Unbound) - -if(NOT UNBOUND_INCLUDE_DIR) - die("Could not find libunbound") -else() - message(STATUS "Found libunbound include (unbound.h) in ${UNBOUND_INCLUDE_DIR}") - if(UNBOUND_LIBRARIES) - message(STATUS "Found libunbound library") - else() - die("Found libunbound includes, but could not find libunbound library. Please make sure you have installed libunbound or libunbound-dev or the equivalent") - endif() -endif() - add_subdirectory(db_drivers) add_subdirectory(easylogging++) add_subdirectory(qrcodegen) -add_subdirectory(randomwow EXCLUDE_FROM_ALL) +add_subdirectory(randomwow) +add_subdirectory(supercop) \ No newline at end of file diff --git a/external/db_drivers/liblmdb/CMakeLists.txt b/external/db_drivers/liblmdb/CMakeLists.txt index 562ebb1eb..71cbb17a7 100644 --- a/external/db_drivers/liblmdb/CMakeLists.txt +++ b/external/db_drivers/liblmdb/CMakeLists.txt @@ -26,40 +26,37 @@ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +set(lmdb_sources + mdb.c + midl.c) + +add_library(lmdb) +target_sources(lmdb PRIVATE ${lmdb_sources}) + +target_include_directories(lmdb + PUBLIC $ + PUBLIC $ + ) + +target_link_libraries(lmdb PRIVATE Threads::Threads) + if(FREEBSD) - add_definitions(-DMDB_DSYNC=O_SYNC) + target_compile_definitions(lmdb PUBLIC MDB_DSYNC=O_SYNC) endif() if(ANDROID) - add_definitions("-DANDROID=1") + target_compile_definitions(lmdb PUBLIC ANDROID=1) endif() - -set (lmdb_sources -mdb.c -midl.c) - -include_directories("${CMAKE_CURRENT_SOURCE_DIR}") - -add_library(lmdb - ${lmdb_sources}) -target_link_libraries(lmdb - PRIVATE - ${CMAKE_THREAD_LIBS_INIT}) if(${ARCH_WIDTH} EQUAL 32) - target_compile_definitions(lmdb - PUBLIC -DMDB_VL32) + target_compile_definitions(lmdb PUBLIC MDB_VL32=1) endif() -# GUI/libwallet install target -if (BUILD_GUI_DEPS) - if(IOS) - set(lib_folder lib-${ARCH}) - else() - set(lib_folder lib) - endif() - install(TARGETS lmdb - ARCHIVE DESTINATION ${lib_folder} - LIBRARY DESTINATION ${lib_folder}) -endif() -set_property(TARGET lmdb APPEND PROPERTY COMPILE_FLAGS "-fPIC") +set_target_properties(lmdb PROPERTIES + POSITION_INDEPENDENT_CODE ON + CXX_STANDARD 11 + CXX_STANDARD_REQUIRED ON + ) + +monero_install_library(lmdb) diff --git a/external/easylogging++/CMakeLists.txt b/external/easylogging++/CMakeLists.txt index 462f774bf..fa108ee72 100644 --- a/external/easylogging++/CMakeLists.txt +++ b/external/easylogging++/CMakeLists.txt @@ -26,43 +26,29 @@ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -cmake_minimum_required(VERSION 3.5) +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 + ) + +target_compile_definitions(easylogging PUBLIC + AUTO_INITIALIZE_EASYLOGGINGPP + ) + +target_include_directories(easylogging + PUBLIC $ + PUBLIC $ + ) -project(easylogging CXX) - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_CXX_EXTENSIONS OFF) - -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 - PRIVATE - ${CMAKE_THREAD_LIBS_INIT} - ${Backtrace_LIBRARIES}) - -# GUI/libwallet install target -if (BUILD_GUI_DEPS) - if(IOS) - set(lib_folder lib-${ARCH}) - else() - set(lib_folder lib) - endif() - install(TARGETS easylogging - ARCHIVE DESTINATION ${lib_folder} - LIBRARY DESTINATION ${lib_folder}) -endif() -set_property(TARGET easylogging APPEND PROPERTY COMPILE_FLAGS "-fPIC") + PRIVATE + Threads::Threads + ${Backtrace_LIBRARIES}) +monero_install_library(easylogging) diff --git a/external/miniupnp b/external/miniupnp deleted file mode 160000 index 544e6fcc7..000000000 --- a/external/miniupnp +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 544e6fcc73c5ad9af48a8985c94f0f1d742ef2e0 diff --git a/external/qrcodegen/CMakeLists.txt b/external/qrcodegen/CMakeLists.txt index 094b49760..98b164b14 100644 --- a/external/qrcodegen/CMakeLists.txt +++ b/external/qrcodegen/CMakeLists.txt @@ -1,8 +1,18 @@ -project(libqrcodegen) +add_library(qrcodegen) -add_library(qrcodegen STATIC QrCode.cpp) -set_target_properties(qrcodegen PROPERTIES POSITION_INDEPENDENT_CODE ON) -set_target_properties(qrcodegen PROPERTIES CXX_STANDARD 11) +target_sources(qrcodegen + PUBLIC + 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 - ${CMAKE_CURRENT_SOURCE_DIR}) +target_include_directories(qrcodegen + PUBLIC $ + PUBLIC $ + ) + +monero_install_library(qrcodegen) diff --git a/external/randomwow b/external/randomwow index 27b099b6d..bb4ed329c 160000 --- a/external/randomwow +++ b/external/randomwow @@ -1 +1 @@ -Subproject commit 27b099b6dd6fef6e17f58c6dfe00009e9c5df587 +Subproject commit bb4ed329c76493cc07a5c5bfae041b28434d9caf diff --git a/external/rapidjson b/external/rapidjson deleted file mode 160000 index 129d19ba7..000000000 --- a/external/rapidjson +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 129d19ba7f496df5e33658527a7158c79b99c21c diff --git a/external/supercop b/external/supercop index 633500ad8..036511a8b 160000 --- a/external/supercop +++ b/external/supercop @@ -1 +1 @@ -Subproject commit 633500ad8c8759995049ccd022107d1fa8a1bbc9 +Subproject commit 036511a8bdc0883059d107aeb2910b54ee0a061b diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9216bcaa5..3efd8128f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -28,60 +28,25 @@ # # 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}" +include(Version) +add_library(version) +target_sources(version + PUBLIC + FILE_SET HEADERS + BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR} + FILES + ${CMAKE_CURRENT_SOURCE_DIR}/version.h 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 () + ${CMAKE_BINARY_DIR}/version.cpp + ) -include(Version) -monero_add_library(version SOURCES ${CMAKE_BINARY_DIR}/version.cpp DEPENDS genversion) +target_include_directories(version + PUBLIC $ + PUBLIC $ + PUBLIC $ + ) + +monero_install_library(version) add_subdirectory(common) add_subdirectory(crypto) @@ -96,6 +61,7 @@ add_subdirectory(hardforks) add_subdirectory(blockchain_db) add_subdirectory(mnemonics) add_subdirectory(rpc) +#add_subdirectory(test) if(NOT IOS) add_subdirectory(serialization) endif() @@ -110,16 +76,8 @@ if(NOT IOS) add_subdirectory(daemon) endif() -if(BUILD_DEBUG_UTILITIES) - add_subdirectory(debug_utilities) - add_subdirectory(blockchain_utilities) - add_subdirectory(gen_multisig) - add_subdirectory(gen_ssl_cert) -endif() - if(PER_BLOCK_CHECKPOINT) add_subdirectory(blocks) endif() -add_subdirectory(device) -add_subdirectory(device_trezor) +add_subdirectory(device) \ No newline at end of file diff --git a/src/blockchain_db/CMakeLists.txt b/src/blockchain_db/CMakeLists.txt index 14ed76295..ccc3ce7a8 100644 --- a/src/blockchain_db/CMakeLists.txt +++ b/src/blockchain_db/CMakeLists.txt @@ -26,28 +26,35 @@ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -set(blockchain_db_sources - blockchain_db.cpp - lmdb/db_lmdb.cpp - ) +file(GLOB BCDB_HEADERS *.h) +file(GLOB BCDB_SOURCES *.cpp *.c *.cc) -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}") - -monero_private_headers(blockchain_db - ${crypto_private_headers}) -monero_add_library(blockchain_db - ${blockchain_db_sources} - ${blockchain_db_headers} - ${blockchain_db_private_headers}) +add_library(blockchain_db) +target_sources(blockchain_db + PUBLIC + FILE_SET HEADERS + BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../ + FILES + ${BCDB_HEADERS} + PRIVATE + ${BCDB_SOURCES} + ) target_link_libraries(blockchain_db PUBLIC common cncrypto ringct - ${LMDB_LIBRARY} - ${Boost_FILESYSTEM_LIBRARY} - ${Boost_THREAD_LIBRARY} - PRIVATE - ${EXTRA_LIBRARIES}) + lmdb + Boost::filesystem + Boost::thread) + +target_include_directories(blockchain_db + PUBLIC $ + PUBLIC $ + PUBLIC $ + ) + +monero_install_library(blockchain_db "${CMAKE_INSTALL_INCLUDEDIR}/monero/blockchain_db/") diff --git a/src/blockchain_utilities/CMakeLists.txt b/src/blockchain_utilities/CMakeLists.txt index 3d7e29317..bedf95620 100644 --- a/src/blockchain_utilities/CMakeLists.txt +++ b/src/blockchain_utilities/CMakeLists.txt @@ -158,7 +158,7 @@ endif() set_property(TARGET blockchain_import PROPERTY OUTPUT_NAME "wownero-blockchain-import") -install(TARGETS blockchain_import DESTINATION bin) +install(TARGETS blockchain_import DESTINATION ${CMAKE_INSTALL_BINDIR}) monero_add_executable(blockchain_export ${blockchain_export_sources} @@ -179,7 +179,7 @@ target_link_libraries(blockchain_export set_property(TARGET blockchain_export PROPERTY OUTPUT_NAME "wownero-blockchain-export") -install(TARGETS blockchain_export DESTINATION bin) +install(TARGETS blockchain_export DESTINATION ${CMAKE_INSTALL_BINDIR}) monero_add_executable(blockchain_blackball ${blockchain_blackball_sources} @@ -201,7 +201,7 @@ target_link_libraries(blockchain_blackball set_property(TARGET blockchain_blackball PROPERTY OUTPUT_NAME "wownero-blockchain-mark-spent-outputs") -install(TARGETS blockchain_blackball DESTINATION bin) +install(TARGETS blockchain_blackball DESTINATION ${CMAKE_INSTALL_BINDIR}) monero_add_executable(blockchain_usage @@ -223,7 +223,7 @@ target_link_libraries(blockchain_usage set_property(TARGET blockchain_usage PROPERTY OUTPUT_NAME "wownero-blockchain-usage") -install(TARGETS blockchain_usage DESTINATION bin) +install(TARGETS blockchain_usage DESTINATION ${CMAKE_INSTALL_BINDIR}) monero_add_executable(blockchain_ancestry ${blockchain_ancestry_sources} @@ -244,7 +244,7 @@ target_link_libraries(blockchain_ancestry set_property(TARGET blockchain_ancestry PROPERTY OUTPUT_NAME "wownero-blockchain-ancestry") -install(TARGETS blockchain_ancestry DESTINATION bin) +install(TARGETS blockchain_ancestry DESTINATION ${CMAKE_INSTALL_BINDIR}) monero_add_executable(blockchain_depth ${blockchain_depth_sources} @@ -265,7 +265,7 @@ target_link_libraries(blockchain_depth set_property(TARGET blockchain_depth PROPERTY OUTPUT_NAME "wownero-blockchain-depth") -install(TARGETS blockchain_depth DESTINATION bin) +install(TARGETS blockchain_depth DESTINATION ${CMAKE_INSTALL_BINDIR}) monero_add_executable(blockchain_stats ${blockchain_stats_sources} @@ -286,7 +286,7 @@ target_link_libraries(blockchain_stats set_property(TARGET blockchain_stats PROPERTY OUTPUT_NAME "wownero-blockchain-stats") -install(TARGETS blockchain_stats DESTINATION bin) +install(TARGETS blockchain_stats DESTINATION ${CMAKE_INSTALL_BINDIR}) monero_add_executable(blockchain_prune_known_spent_data ${blockchain_prune_known_spent_data_sources} @@ -308,7 +308,7 @@ target_link_libraries(blockchain_prune_known_spent_data set_property(TARGET blockchain_prune_known_spent_data PROPERTY OUTPUT_NAME "wownero-blockchain-prune-known-spent-data") -install(TARGETS blockchain_prune_known_spent_data DESTINATION bin) +install(TARGETS blockchain_prune_known_spent_data DESTINATION ${CMAKE_INSTALL_BINDIR}) monero_add_executable(blockchain_prune ${blockchain_prune_sources} @@ -317,7 +317,7 @@ monero_add_executable(blockchain_prune set_property(TARGET blockchain_prune PROPERTY OUTPUT_NAME "wownero-blockchain-prune") -install(TARGETS blockchain_prune DESTINATION bin) +install(TARGETS blockchain_prune DESTINATION ${CMAKE_INSTALL_BINDIR}) target_link_libraries(blockchain_prune PRIVATE diff --git a/src/blocks/CMakeLists.txt b/src/blocks/CMakeLists.txt index bab121617..5e8cdaee3 100644 --- a/src/blocks/CMakeLists.txt +++ b/src/blocks/CMakeLists.txt @@ -57,4 +57,22 @@ foreach(BLOB_NAME checkpoints) ) 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 $ + PUBLIC $ + PUBLIC $ + ) + +monero_install_library(blocks "${CMAKE_INSTALL_INCLUDEDIR}/monero/blocks/") \ No newline at end of file diff --git a/src/checkpoints/CMakeLists.txt b/src/checkpoints/CMakeLists.txt index 665441f62..345f06fee 100644 --- a/src/checkpoints/CMakeLists.txt +++ b/src/checkpoints/CMakeLists.txt @@ -26,38 +26,30 @@ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -if(APPLE) - if(DEPENDS) - list(APPEND EXTRA_LIBRARIES "-framework Foundation -framework ApplicationServices -framework AppKit -framework IOKit") - else() - find_library(IOKIT_LIBRARY IOKit) - mark_as_advanced(IOKIT_LIBRARY) - list(APPEND EXTRA_LIBRARIES ${IOKIT_LIBRARY}) - endif() -endif() +add_library(checkpoints) +target_sources(checkpoints + PUBLIC + FILE_SET HEADERS + BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR} + FILES + ${CMAKE_CURRENT_SOURCE_DIR}/checkpoints.h + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/checkpoints.cpp + ) -set(checkpoints_sources - checkpoints.cpp) - -set(checkpoints_headers) - -monero_find_all_headers(checkpoints_private_headers "${CMAKE_CURRENT_SOURCE_DIR}") - -monero_private_headers(checkpoints - ${checkpoints_private_headers}) -monero_add_library(checkpoints - ${checkpoints_sources} - ${checkpoints_headers} - ${checkpoints_private_headers}) -target_link_libraries(checkpoints - PUBLIC +target_link_libraries(checkpoints PUBLIC common cncrypto - ${Boost_DATE_TIME_LIBRARY} - ${Boost_PROGRAM_OPTIONS_LIBRARY} - ${Boost_SERIALIZATION_LIBRARY} - ${Boost_FILESYSTEM_LIBRARY} - ${Boost_SYSTEM_LIBRARY} - ${Boost_THREAD_LIBRARY} - PRIVATE - ${EXTRA_LIBRARIES}) + Boost::date_time + Boost::program_options + Boost::serialization + Boost::filesystem + Boost::system + Boost::thread) + +target_include_directories(checkpoints + PUBLIC $ + PUBLIC $ + ) + +monero_install_library(checkpoints "${CMAKE_INSTALL_INCLUDEDIR}/monero/checkpoints/") \ No newline at end of file diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index b712ee6b1..27ae24509 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -26,61 +26,47 @@ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -include_directories(SYSTEM ${OPENSSL_INCLUDE_DIR}) +file(GLOB COMMON_SOURCES "*.cpp" "*.c") +file(GLOB COMMON_HEADERS "*.h") -set(common_sources - base58.cpp - command_line.cpp - dns_utils.cpp - download.cpp - error.cpp - expect.cpp - util.cpp - i18n.cpp - notify.cpp - password.cpp - perf_timer.cpp - pruning.cpp - spawn.cpp - threadpool.cpp - updates.cpp - aligned.c - timings.cc - combinator.cpp) +add_library(common) -if (STACK_TRACE) - list(APPEND common_sources stack_trace.cpp) -endif() - -if (BACKCOMPAT) - list(APPEND common_sources compat/glibc_compat.cpp) -endif() - -set(common_headers) - -monero_find_all_headers(common_private_headers "${CMAKE_CURRENT_SOURCE_DIR}") +target_sources(common + PUBLIC + FILE_SET HEADERS + BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR} + FILES + ${COMMON_HEADERS} + PRIVATE + ${COMMON_SOURCES} + ) -monero_private_headers(common - ${common_private_headers}) -monero_add_library(common - ${common_sources} - ${common_headers} - ${common_private_headers} - DEPENDS generate_translations_header) target_link_libraries(common PUBLIC cncrypto - ${UNBOUND_LIBRARIES} - ${LIBUNWIND_LIBRARIES} - ${Boost_DATE_TIME_LIBRARY} - ${Boost_FILESYSTEM_LIBRARY} - ${Boost_SYSTEM_LIBRARY} - ${Boost_THREAD_LIBRARY} - ${Boost_REGEX_LIBRARY} - ${Boost_CHRONO_LIBRARY} + easylogging + Libunbound::Libunbound + Boost::chrono + Boost::date_time + Boost::filesystem + Boost::thread + Boost::regex + Boost::system PRIVATE - ${OPENSSL_LIBRARIES} - ${EXTRA_LIBRARIES}) + OpenSSL::SSL + OpenSSL::Crypto) + +target_include_directories(common + PRIVATE ${LIBUNBOUND_INCLUDE_DIR} + PUBLIC $ + PRIVATE $ + PUBLIC $ + ) + +if(STATIC) + target_compile_definitions(common PUBLIC STATICLIB=1) +endif() + +add_dependencies(common generate_translations_header) -#monero_install_headers(common -# ${common_headers}) +monero_install_library(common "${CMAKE_INSTALL_INCLUDEDIR}/monero/common/") \ No newline at end of file diff --git a/src/common/compat/glibc_compat.cpp b/src/common/compat/glibc_compat.cpp deleted file mode 100644 index 435e7930f..000000000 --- a/src/common/compat/glibc_compat.cpp +++ /dev/null @@ -1,98 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -#if defined(HAVE_SYS_SELECT_H) -#include -#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); -} - diff --git a/src/common/stack_trace.cpp b/src/common/stack_trace.cpp index 130ba4d81..805d64865 100644 --- a/src/common/stack_trace.cpp +++ b/src/common/stack_trace.cpp @@ -31,7 +31,7 @@ #else #define ELPP_FEATURE_CRASH_LOG 1 #endif -#include "easylogging++/easylogging++.h" +#include "easylogging++.h" #include #ifdef USE_UNWIND diff --git a/src/crypto/CMakeLists.txt b/src/crypto/CMakeLists.txt index 595c7f966..a98ee2950 100644 --- a/src/crypto/CMakeLists.txt +++ b/src/crypto/CMakeLists.txt @@ -27,76 +27,79 @@ # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. set(crypto_sources - aesb.c - blake256.c - chacha.c - crypto-ops-data.c - crypto-ops.c - crypto.cpp - groestl.c - hash-extra-blake.c - hash-extra-groestl.c - hash-extra-jh.c - hash-extra-skein.c - hash.c - hmac-keccak.c - jh.c - keccak.c - oaes_lib.c - random.c - skein.c - slow-hash.c - rx-slow-hash.c - CryptonightR_JIT.c - tree-hash.c) + aesb.c + blake256.c + chacha.c + crypto-ops-data.c + crypto-ops.c + crypto.cpp + groestl.c + hash-extra-blake.c + hash-extra-groestl.c + hash-extra-jh.c + hash-extra-skein.c + hash.c + hmac-keccak.c + jh.c + keccak.c + oaes_lib.c + random.c + skein.c + slow-hash.c + rx-slow-hash.c + CryptonightR_JIT.c + tree-hash.c) +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") -list(APPEND crypto_sources CryptonightR_template.S) +if(NOT ARM) + list(APPEND crypto_sources CryptonightR_template.S) 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 PUBLIC epee randomx - ${Boost_SYSTEM_LIBRARY} - ${SODIUM_LIBRARY} + Boost::system + ${sodium_LIBRARY_RELEASE} PRIVATE - ${EXTRA_LIBRARIES}) + OpenSSL::SSL + OpenSSL::Crypto) -if (ARM) - option(NO_OPTIMIZED_MULTIPLY_ON_ARM - "Compute multiply using generic C implementation instead of ARM ASM" OFF) - if(NO_OPTIMIZED_MULTIPLY_ON_ARM) - message(STATUS "Using generic C implementation for multiply") - set_property(SOURCE slow-hash.c - PROPERTY COMPILE_DEFINITIONS "NO_OPTIMIZED_MULTIPLY_ON_ARM") - endif() +target_include_directories(cncrypto + PUBLIC $ + PUBLIC $ + PUBLIC ${sodium_INCLUDE_DIR} + ) + +if (ARM AND NO_OPTIMIZED_MULTIPLY_ON_ARM) + message(STATUS "Using generic C implementation for multiply") + set_property(SOURCE slow-hash.c + PROPERTY COMPILE_DEFINITIONS "NO_OPTIMIZED_MULTIPLY_ON_ARM") endif() # Because of the way Qt works on android with JNI, the code does not live in the main android thread # So this code runs with a 1 MB default stack size. # This will force the use of the heap for the allocation of the scratchpad if (ANDROID OR IOS) - if( BUILD_GUI_DEPS ) add_definitions(-DFORCE_USE_HEAP=1) - endif() endif() # cheat because cmake and ccache hate each other -set_property(SOURCE CryptonightR_template.S PROPERTY LANGUAGE C) +set_property(SOURCE CryptonightR_template.S PROPERTY LANGUAGE ASM) set_property(SOURCE CryptonightR_template.S PROPERTY XCODE_EXPLICIT_FILE_TYPE sourcecode.asm) # Must be done last, because it references libraries in this directory add_subdirectory(wallet) + +monero_install_library(cncrypto "${CMAKE_INSTALL_INCLUDEDIR}/monero/crypto/") \ No newline at end of file diff --git a/src/crypto/random.c b/src/crypto/random.c index cfb637fb4..f089871e1 100644 --- a/src/crypto/random.c +++ b/src/crypto/random.c @@ -61,11 +61,11 @@ static void generate_system_random_bytes(size_t n, void *result) { #include #include -#include #include #include #include #include +#include static void generate_system_random_bytes(size_t n, void *result) { int fd; diff --git a/src/crypto/wallet/CMakeLists.txt b/src/crypto/wallet/CMakeLists.txt index ac1bdf7fd..bd746e924 100644 --- a/src/crypto/wallet/CMakeLists.txt +++ b/src/crypto/wallet/CMakeLists.txt @@ -27,37 +27,23 @@ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Possibly user defined values. -# -set(MONERO_WALLET_CRYPTO_LIBRARY "auto" CACHE STRING "Select a wallet crypto library") +include(CheckLanguage) +check_language(ASM-ATT) -# -# If the user specified "auto", detect best library defaulting to internal. -# -if (${MONERO_WALLET_CRYPTO_LIBRARY} STREQUAL "auto") - monero_crypto_autodetect(AVAILABLE BEST) - if (DEFINED BEST) - message("Wallet crypto is using ${BEST} backend") - set(MONERO_WALLET_CRYPTO_LIBRARY ${BEST}) - else () - message("Defaulting to internal crypto library for wallet") - set(MONERO_WALLET_CRYPTO_LIBRARY "cn") - endif () -endif () - -# -# 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_link_libraries(wallet-crypto cncrypto) -endif () +add_library(wallet-crypto crypto.h) +target_sources(wallet-crypto + PUBLIC + FILE_SET HEADERS + BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR} + FILES + ${CMAKE_CURRENT_SOURCE_DIR}/crypto.h + ) +target_include_directories(wallet-crypto + PUBLIC $ + PUBLIC $ + PUBLIC $ + ) +target_link_libraries(wallet-crypto PUBLIC cncrypto) +monero_install_library(wallet-crypto "${CMAKE_INSTALL_INCLUDEDIR}/monero/wallet-crypto/") diff --git a/src/cryptonote_basic/CMakeLists.txt b/src/cryptonote_basic/CMakeLists.txt index 1414be1b2..6ab987bf7 100644 --- a/src/cryptonote_basic/CMakeLists.txt +++ b/src/cryptonote_basic/CMakeLists.txt @@ -26,56 +26,51 @@ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -if(APPLE) - if(DEPENDS) - list(APPEND EXTRA_LIBRARIES "-framework Foundation -framework ApplicationServices -framework AppKit -framework IOKit") - else() - find_library(IOKIT_LIBRARY IOKit) - mark_as_advanced(IOKIT_LIBRARY) - list(APPEND EXTRA_LIBRARIES ${IOKIT_LIBRARY}) - endif() -endif() +file(GLOB CN_BASIC_HEADERS *.h) +file(GLOB CN_BASIC_SOURCES *.cpp *.c *.cc) -monero_add_library(cryptonote_format_utils_basic - cryptonote_format_utils_basic.cpp -) -target_link_libraries(cryptonote_format_utils_basic - PUBLIC - cncrypto -) - -set(cryptonote_basic_sources - account.cpp - connection_context.cpp - cryptonote_basic_impl.cpp - cryptonote_format_utils.cpp - difficulty.cpp - hardfork.cpp - merge_mining.cpp - miner.cpp) +# cryptonote_format_utils_basic +add_library(cryptonote_format_utils_basic) +target_sources(cryptonote_format_utils_basic + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/cryptonote_format_utils_basic.cpp + ) -set(cryptonote_basic_headers) +target_link_libraries(cryptonote_format_utils_basic PUBLIC cncrypto) +target_include_directories(cryptonote_format_utils_basic + PUBLIC $ + PUBLIC $ + ) -monero_find_all_headers(cryptonote_basic_private_headers "${CMAKE_CURRENT_SOURCE_DIR}") +# 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_private_headers(cryptonote_basic - ${cryptonote_basic_private_headers}) -monero_add_library(cryptonote_basic - ${cryptonote_basic_sources} - ${cryptonote_basic_headers} - ${cryptonote_basic_private_headers}) target_link_libraries(cryptonote_basic PUBLIC common cncrypto checkpoints - cryptonote_format_utils_basic device - ${Boost_DATE_TIME_LIBRARY} - ${Boost_PROGRAM_OPTIONS_LIBRARY} - ${Boost_SERIALIZATION_LIBRARY} - ${Boost_FILESYSTEM_LIBRARY} - ${Boost_SYSTEM_LIBRARY} - ${Boost_THREAD_LIBRARY} - PRIVATE - ${EXTRA_LIBRARIES}) + Boost::date_time + Boost::program_options + Boost::serialization + Boost::filesystem + Boost::system + Boost::thread) + +target_include_directories(cryptonote_basic + PUBLIC $ + PUBLIC $ + ) + +monero_install_library(cryptonote_format_utils_basic "${CMAKE_INSTALL_INCLUDEDIR}/monero/cryptonote_basic/") +monero_install_library(cryptonote_basic "${CMAKE_INSTALL_INCLUDEDIR}/monero/cryptonote_basic/") \ No newline at end of file diff --git a/src/cryptonote_core/CMakeLists.txt b/src/cryptonote_core/CMakeLists.txt index beead6217..74ad2d0ac 100644 --- a/src/cryptonote_core/CMakeLists.txt +++ b/src/cryptonote_core/CMakeLists.txt @@ -26,25 +26,10 @@ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -set(cryptonote_core_sources - blockchain.cpp - cryptonote_core.cpp - tx_pool.cpp - tx_sanity_check.cpp - cryptonote_tx_utils.cpp - tx_verification_utils.cpp -) +file(GLOB CN_CORE_HEADERS *.h) +file(GLOB CN_CORE_SOURCES *.cpp *.c *.cc) -set(cryptonote_core_headers) - -monero_find_all_headers(cryptonote_core_private_headers "${CMAKE_CURRENT_SOURCE_DIR}") - -monero_private_headers(cryptonote_core - ${cryptonote_core_private_headers}) -monero_add_library(cryptonote_core - ${cryptonote_core_sources} - ${cryptonote_core_headers} - ${cryptonote_core_private_headers}) +add_library(cryptonote_core ${CN_CORE_SOURCES}) target_link_libraries(cryptonote_core PUBLIC version @@ -54,11 +39,35 @@ target_link_libraries(cryptonote_core ringct device hardforks - ${Boost_DATE_TIME_LIBRARY} - ${Boost_PROGRAM_OPTIONS_LIBRARY} - ${Boost_SERIALIZATION_LIBRARY} - ${Boost_FILESYSTEM_LIBRARY} - ${Boost_SYSTEM_LIBRARY} - ${Boost_THREAD_LIBRARY} - PRIVATE - ${EXTRA_LIBRARIES}) + Boost::date_time + Boost::program_options + Boost::serialization + Boost::filesystem + Boost::system + Boost::thread) + +target_include_directories(cryptonote_core PRIVATE + PUBLIC $ + PUBLIC $ + ) + +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 $ + PUBLIC $ + ) + +monero_install_library(cryptonote_core "${CMAKE_INSTALL_INCLUDEDIR}/monero/cryptonote_core/") diff --git a/src/cryptonote_protocol/CMakeLists.txt b/src/cryptonote_protocol/CMakeLists.txt index b516e17e9..934d289b3 100644 --- a/src/cryptonote_protocol/CMakeLists.txt +++ b/src/cryptonote_protocol/CMakeLists.txt @@ -26,16 +26,26 @@ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -cmake_minimum_required (VERSION 3.5) -project (monero CXX) +file(GLOB CN_PROT_HEADERS *.h) +file(GLOB CN_PROT_SOURCES *.cpp *.c *.cc) -file(GLOB CRYPTONOTE_PROTOCOL *) -source_group(cryptonote_protocol FILES ${CRYPTONOTE_PROTOCOL}) +add_library(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}) -monero_add_library(cryptonote_protocol ${CRYPTONOTE_PROTOCOL}) -target_link_libraries(cryptonote_protocol - PUBLIC - p2p - PRIVATE - ${EXTRA_LIBRARIES}) +target_link_libraries(cryptonote_protocol PUBLIC p2p) + +target_include_directories(cryptonote_protocol + PUBLIC $ + PUBLIC $ + PRIVATE ${OPENSSL_INCLUDE_DIR} + ) + +monero_install_library(cryptonote_protocol "${CMAKE_INSTALL_INCLUDEDIR}/monero/cryptonote_protocol/") \ No newline at end of file diff --git a/src/daemon/CMakeLists.txt b/src/daemon/CMakeLists.txt index d13d6e565..942130607 100644 --- a/src/daemon/CMakeLists.txt +++ b/src/daemon/CMakeLists.txt @@ -26,25 +26,14 @@ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -set(daemon_sources - command_parser_executor.cpp - command_server.cpp - daemon.cpp - executor.cpp - main.cpp - rpc_command_executor.cpp -) +file(GLOB DAEMON_SOURCES + *.cpp + *.c + *.cc + *.h) -set(daemon_headers) +add_executable(daemon ${DAEMON_SOURCES}) -monero_find_all_headers(daemon_private_headers "${CMAKE_CURRENT_SOURCE_DIR}") - -monero_private_headers(daemon - ${daemon_private_headers}) -monero_add_executable(daemon - ${daemon_sources} - ${daemon_headers} - ${daemon_private_headers}) target_link_libraries(daemon PRIVATE rpc @@ -57,19 +46,27 @@ target_link_libraries(daemon daemonizer serialization daemon_rpc_server - ${EPEE_READLINE} version - ${Boost_CHRONO_LIBRARY} - ${Boost_FILESYSTEM_LIBRARY} - ${Boost_PROGRAM_OPTIONS_LIBRARY} - ${Boost_REGEX_LIBRARY} - ${Boost_SYSTEM_LIBRARY} - ${CMAKE_THREAD_LIBS_INIT} - ${ZMQ_LIB} - ${GNU_READLINE_LIBRARY} - ${EXTRA_LIBRARIES} - ${Blocks}) + Boost::chrono + Boost::program_options + Boost::filesystem + Boost::system + Boost::thread + Boost::regex + Threads::Threads + ${ZMQ_LIBRARIES} + blocks) + +target_include_directories(daemon + PRIVATE ${ZMQ_INCLUDE_DIRS} + PRIVATE ${OPENSSL_INCLUDE_DIR}) + +if(PER_BLOCK_CHECKPOINT) + target_compile_definitions(daemon PUBLIC PER_BLOCK_CHECKPOINT=1) +endif() + set_property(TARGET daemon PROPERTY OUTPUT_NAME "wownerod") -install(TARGETS daemon DESTINATION bin) + +install(TARGETS daemon DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/src/daemonizer/CMakeLists.txt b/src/daemonizer/CMakeLists.txt index 61999b3a5..ba7a9278d 100644 --- a/src/daemonizer/CMakeLists.txt +++ b/src/daemonizer/CMakeLists.txt @@ -58,17 +58,17 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug") add_definitions(-DDEBUG_TMPDIR_LOG=1) endif() -monero_private_headers(daemonizer - ${daemonizer_private_headers}) -monero_add_library(daemonizer +add_library(daemonizer ${daemonizer_sources} ${daemonizer_headers} ${daemonizer_private_headers}) + target_link_libraries(daemonizer PUBLIC common - ${Boost_CHRONO_LIBRARY} - ${Boost_FILESYSTEM_LIBRARY} - ${Boost_PROGRAM_OPTIONS_LIBRARY} - PRIVATE - ${EXTRA_LIBRARIES}) + Boost::chrono + Boost::filesystem + Boost::program_options) + +target_include_directories(daemonizer PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR}/../) \ No newline at end of file diff --git a/src/device/CMakeLists.txt b/src/device/CMakeLists.txt index e4f1159b5..6840b05a8 100644 --- a/src/device/CMakeLists.txt +++ b/src/device/CMakeLists.txt @@ -26,57 +26,40 @@ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -set(device_sources - device.cpp - device_default.cpp - log.cpp - ) - -if(HIDAPI_FOUND) - set(device_sources - ${device_sources} - device_ledger.cpp - device_io_hid.cpp +add_library(device) +target_sources(device + PUBLIC + FILE_SET HEADERS + BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../ + FILES + ${CMAKE_CURRENT_SOURCE_DIR}/device.hpp + ${CMAKE_CURRENT_SOURCE_DIR}/device_io.hpp + ${CMAKE_CURRENT_SOURCE_DIR}/device_default.hpp + ${CMAKE_CURRENT_SOURCE_DIR}/device_cold.hpp + ${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 PUBLIC - ${HIDAPI_LIBRARIES} cncrypto cryptonote_format_utils_basic ringct_basic wallet-crypto - ${OPENSSL_CRYPTO_LIBRARIES} - ${Boost_SERIALIZATION_LIBRARY} + monero-crypto-amd64-64-24k + OpenSSL::Crypto + Boost::serialization PRIVATE version - ${Blocks} - ${EXTRA_LIBRARIES}) + blocks) + +target_include_directories(device + PUBLIC $ + PUBLIC $ + PUBLIC $ + ) + +monero_install_library(device "${CMAKE_INSTALL_INCLUDEDIR}/monero/device/") \ No newline at end of file diff --git a/src/gen_multisig/CMakeLists.txt b/src/gen_multisig/CMakeLists.txt index 9b6687260..cfcc9c9f7 100644 --- a/src/gen_multisig/CMakeLists.txt +++ b/src/gen_multisig/CMakeLists.txt @@ -51,4 +51,4 @@ add_dependencies(gen_multisig set_property(TARGET gen_multisig PROPERTY OUTPUT_NAME "wownero-gen-trusted-multisig") -install(TARGETS gen_multisig DESTINATION bin) +install(TARGETS gen_multisig DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/src/gen_ssl_cert/CMakeLists.txt b/src/gen_ssl_cert/CMakeLists.txt index 42b179464..1e02bf1d0 100644 --- a/src/gen_ssl_cert/CMakeLists.txt +++ b/src/gen_ssl_cert/CMakeLists.txt @@ -46,4 +46,4 @@ add_dependencies(gen_ssl_cert set_property(TARGET gen_ssl_cert PROPERTY OUTPUT_NAME "wownero-gen-ssl-cert") -install(TARGETS gen_ssl_cert DESTINATION bin) +install(TARGETS gen_ssl_cert DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/src/hardforks/CMakeLists.txt b/src/hardforks/CMakeLists.txt index 81a3d694b..d6aeb064b 100644 --- a/src/hardforks/CMakeLists.txt +++ b/src/hardforks/CMakeLists.txt @@ -26,21 +26,17 @@ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -set(hardforks_sources - hardforks.cpp) +add_library(hardforks) +target_sources(hardforks + 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_private_headers(hardforks - ${hardforks_private_headers}) -monero_add_library(hardforks - ${hardforks_sources} - ${hardforks_headers} - ${hardforks_private_headers}) -target_link_libraries(hardforks - PUBLIC - version - PRIVATE - ${EXTRA_LIBRARIES}) +monero_install_library(hardforks "${CMAKE_INSTALL_INCLUDEDIR}/monero/hardforks/") diff --git a/src/lmdb/CMakeLists.txt b/src/lmdb/CMakeLists.txt index a26c48ad5..b3ca25d4f 100644 --- a/src/lmdb/CMakeLists.txt +++ b/src/lmdb/CMakeLists.txt @@ -26,8 +26,22 @@ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -set(lmdb_sources database.cpp error.cpp table.cpp value_stream.cpp) -monero_find_all_headers(lmdb_headers "${CMAKE_CURRENT_SOURCE_DIR}") +file(GLOB LMDB_HEADERS *.h) +file(GLOB LMDB_SOURCES *.cpp *.c *.cc) -monero_add_library(lmdb_lib ${lmdb_sources} ${lmdb_headers}) -target_link_libraries(lmdb_lib common ${LMDB_LIBRARY}) +add_library(lmdb_lib ${LMDB_SOURCES}) +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/") \ No newline at end of file diff --git a/src/mnemonics/CMakeLists.txt b/src/mnemonics/CMakeLists.txt index 738633ef5..0d9b8f098 100644 --- a/src/mnemonics/CMakeLists.txt +++ b/src/mnemonics/CMakeLists.txt @@ -26,23 +26,29 @@ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -set(mnemonics_sources - electrum-words.cpp) +file(GLOB MN_HEADERS *.h) +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 PUBLIC epee easylogging - ${Boost_SYSTEM_LIBRARY} - PRIVATE - ${EXTRA_LIBRARIES}) + Boost::system) + +target_include_directories(mnemonics + PUBLIC $ + PUBLIC $ + ) + +monero_install_library(mnemonics "${CMAKE_INSTALL_INCLUDEDIR}/monero/mnemonics/") \ No newline at end of file diff --git a/src/multisig/CMakeLists.txt b/src/multisig/CMakeLists.txt index 61e658a39..eeb2172aa 100644 --- a/src/multisig/CMakeLists.txt +++ b/src/multisig/CMakeLists.txt @@ -25,26 +25,22 @@ # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +file(GLOB MULTISIG_HEADERS *.h) +file(GLOB MULTISIG_SOURCES + *.cpp + *.c + *.cc) -set(multisig_sources - multisig.cpp - multisig_account.cpp - multisig_account_kex_impl.cpp - multisig_clsag_context.cpp - multisig_kex_msg.cpp - multisig_tx_builder_ringct.cpp) - -set(multisig_headers) - -monero_find_all_headers(multisig_private_headers "${CMAKE_CURRENT_SOURCE_DIR}") - -monero_private_headers(multisig - ${multisig_private_headers}) - -monero_add_library(multisig - ${multisig_sources} - ${multisig_headers} - ${multisig_private_headers}) +add_library(multisig) +target_sources(multisig + PUBLIC + FILE_SET HEADERS + BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR} + FILES + ${MULTISIG_HEADERS} + PRIVATE + ${MULTISIG_SOURCES} + ) target_link_libraries(multisig PUBLIC @@ -52,6 +48,11 @@ target_link_libraries(multisig cryptonote_basic cryptonote_core common - cncrypto - PRIVATE - ${EXTRA_LIBRARIES}) + cncrypto) + +target_include_directories(multisig + PUBLIC $ + PUBLIC $ + ) + +monero_install_library(multisig "${CMAKE_INSTALL_INCLUDEDIR}/monero/multisig/") diff --git a/src/net/CMakeLists.txt b/src/net/CMakeLists.txt index a4d31eedf..e446bb88c 100644 --- a/src/net/CMakeLists.txt +++ b/src/net/CMakeLists.txt @@ -27,10 +27,31 @@ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -set(net_sources dandelionpp.cpp error.cpp http.cpp i2p_address.cpp parse.cpp resolve.cpp - socks.cpp socks_connect.cpp tor_address.cpp zmq.cpp) -monero_find_all_headers(net_headers "${CMAKE_CURRENT_SOURCE_DIR}") +file(GLOB NET_HEADERS *.h) +file(GLOB NET_SOURCES *.cpp *.c *.cc) -monero_add_library(net ${net_sources} ${net_headers}) -target_link_libraries(net common epee ${ZMQ_LIB} ${Boost_ASIO_LIBRARY}) +add_library(net) +target_sources(net + 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 $ + PUBLIC $ + PRIVATE ${ZMQ_INCLUDE_DIRS} + PRIVATE ${OPENSSL_INCLUDE_DIR} + ) + +monero_install_library(net "${CMAKE_INSTALL_INCLUDEDIR}/monero/net/") \ No newline at end of file diff --git a/src/p2p/CMakeLists.txt b/src/p2p/CMakeLists.txt index af58d2bb0..ef571e40d 100644 --- a/src/p2p/CMakeLists.txt +++ b/src/p2p/CMakeLists.txt @@ -26,27 +26,38 @@ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -cmake_minimum_required (VERSION 3.5) -project (monero CXX) +file(GLOB P2P_HEADERS *.h) +file(GLOB P2P_SOURCES *.cpp *.c *.cc) -file(GLOB P2P *) -source_group(p2p FILES ${P2P}) +add_library(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 PUBLIC version cryptonote_core net - ${UPNP_LIBRARIES} - ${Boost_CHRONO_LIBRARY} - ${Boost_PROGRAM_OPTIONS_LIBRARY} - ${Boost_FILESYSTEM_LIBRARY} - ${Boost_SYSTEM_LIBRARY} - ${Boost_THREAD_LIBRARY} - ${Boost_SERIALIZATION_LIBRARY} - PRIVATE - ${EXTRA_LIBRARIES}) + miniupnpc::miniupnpc + Boost::chrono + Boost::program_options + Boost::filesystem + Boost::system + Boost::thread + Boost::serialization) + +target_include_directories(p2p + PUBLIC $ + PUBLIC $ + PUBLIC $ + PRIVATE ${OPENSSL_INCLUDE_DIR} + ) + +monero_install_library(p2p "${CMAKE_INSTALL_INCLUDEDIR}/monero/p2p/") \ No newline at end of file diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl index f6bbedc3d..55544e562 100644 --- a/src/p2p/net_node.inl +++ b/src/p2p/net_node.inl @@ -60,9 +60,9 @@ #include "cryptonote_core/cryptonote_core.h" #include "net/parse.h" -#include -#include -#include +#include +#include +#include #undef MONERO_DEFAULT_LOG_CATEGORY #define MONERO_DEFAULT_LOG_CATEGORY "net.p2p" diff --git a/src/platform/mingw/alloca.h b/src/platform/mingw/alloca.h deleted file mode 100644 index 10a9db198..000000000 --- a/src/platform/mingw/alloca.h +++ /dev/null @@ -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 diff --git a/src/platform/msc/alloca.h b/src/platform/msc/alloca.h deleted file mode 100644 index 3b197bf6d..000000000 --- a/src/platform/msc/alloca.h +++ /dev/null @@ -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) diff --git a/src/platform/msc/inline_c.h b/src/platform/msc/inline_c.h deleted file mode 100644 index 36d3d0026..000000000 --- a/src/platform/msc/inline_c.h +++ /dev/null @@ -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 diff --git a/src/platform/msc/stdbool.h b/src/platform/msc/stdbool.h deleted file mode 100644 index d4932e8f8..000000000 --- a/src/platform/msc/stdbool.h +++ /dev/null @@ -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 diff --git a/src/platform/msc/sys/param.h b/src/platform/msc/sys/param.h deleted file mode 100644 index 61002e1a1..000000000 --- a/src/platform/msc/sys/param.h +++ /dev/null @@ -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 diff --git a/src/ringct/CMakeLists.txt b/src/ringct/CMakeLists.txt index 02ec7da35..e7c19f3ff 100644 --- a/src/ringct/CMakeLists.txt +++ b/src/ringct/CMakeLists.txt @@ -27,45 +27,59 @@ # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. set(ringct_basic_sources - rctOps.cpp - rctTypes.cpp - rctCryptoOps.c - multiexp.cc - bulletproofs.cc - bulletproofs2.cc - bulletproofs_plus.cc) + rctOps.cpp + rctTypes.cpp + rctCryptoOps.c + multiexp.cc + bulletproofs.cc + bulletproofs2.cc + bulletproofs_plus.cc) -monero_find_all_headers(ringct_basic_private_headers "${CMAKE_CURRENT_SOURCE_DIR}") +set(ringct_basic_headers + rctOps.h + rctTypes.h + rctCryptoOps.h + multiexp.h + bulletproofs.h + bulletproofs_plus.h) + + +add_library(ringct_basic) +target_sources(ringct_basic + 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 PUBLIC common cncrypto PRIVATE - ${OPENSSL_LIBRARIES} - ${EXTRA_LIBRARIES}) - -set(ringct_sources - rctSigs.cpp -) + OpenSSL::SSL + OpenSSL::Crypto) -set(ringct_headers) +target_include_directories(ringct_basic + PUBLIC $ + PUBLIC $ + PRIVATE ${OPENSSL_INCLUDE_DIR} + ) -set(ringct_private_headers - rctSigs.h -) +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 + ) -monero_private_headers(ringct - ${crypto_private_headers}) -monero_add_library(ringct - ${ringct_sources} - ${ringct_headers} - ${ringct_private_headers}) target_link_libraries(ringct PUBLIC common @@ -73,5 +87,13 @@ target_link_libraries(ringct cryptonote_basic device PRIVATE - ${OPENSSL_LIBRARIES} - ${EXTRA_LIBRARIES}) + OpenSSL::SSL) + +target_include_directories(ringct + PUBLIC $ + PUBLIC $ + PRIVATE ${OPENSSL_INCLUDE_DIR} + ) + +monero_install_library(ringct_basic "${CMAKE_INSTALL_INCLUDEDIR}/monero/ringct/") +monero_install_library(ringct "${CMAKE_INSTALL_INCLUDEDIR}/monero/ringct/") diff --git a/src/rpc/CMakeLists.txt b/src/rpc/CMakeLists.txt index edfc70067..620f3b45e 100644 --- a/src/rpc/CMakeLists.txt +++ b/src/rpc/CMakeLists.txt @@ -26,108 +26,64 @@ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -include_directories(SYSTEM ${ZMQ_INCLUDE_PATH}) - -set(rpc_base_sources - rpc_args.cpp - rpc_payment_signature.cpp - rpc_handler.cpp) - -set(rpc_sources - bootstrap_daemon.cpp - bootstrap_node_selector.cpp - core_rpc_server.cpp - rpc_payment.cpp - rpc_version_str.cpp - instanciations.cpp) - -set(daemon_messages_sources - message.cpp - daemon_messages.cpp) - -set(rpc_pub_sources zmq_pub.cpp) - -set(daemon_rpc_server_sources - daemon_handler.cpp - zmq_pub.cpp - zmq_server.cpp) - - -set(rpc_base_headers - rpc_args.h - rpc_payment_signature.h - rpc_handler.h) - -set(rpc_headers - rpc_version_str.h - rpc_handler.h) - -set(rpc_pub_headers zmq_pub.h) - -set(daemon_rpc_server_headers) - -set(rpc_private_headers - bootstrap_daemon.h - core_rpc_server.h - rpc_payment.h - core_rpc_server_commands_defs.h - core_rpc_server_error_codes.h) - -set(daemon_messages_private_headers - message.h - daemon_messages.h) - -set(daemon_rpc_server_private_headers - message.h - daemon_messages.h - daemon_handler.h - zmq_server.h) - - -monero_private_headers(rpc - ${rpc_private_headers}) - -set(rpc_pub_private_headers) - -monero_private_headers(daemon_rpc_server - ${daemon_rpc_server_private_headers}) - - -monero_add_library(rpc_base - ${rpc_base_sources} - ${rpc_base_headers} - ${rpc_base_private_headers}) - -monero_add_library(rpc - ${rpc_sources} - ${rpc_headers} - ${rpc_private_headers}) - -monero_add_library(rpc_pub - ${rpc_pub_sources} - ${rpc_pub_headers} - ${rpc_pub_private_headers}) - -monero_add_library(daemon_messages - ${daemon_messages_sources} - ${daemon_messages_headers} - ${daemon_messages_private_headers}) - -monero_add_library(daemon_rpc_server - ${daemon_rpc_server_sources} - ${daemon_rpc_server_headers} - ${daemon_rpc_server_private_headers}) - +# rpc base + +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 PUBLIC common epee - ${Boost_REGEX_LIBRARY} - ${Boost_THREAD_LIBRARY} - ${Boost_PROGRAM_OPTIONS_LIBRARY} - PRIVATE - ${EXTRA_LIBRARIES}) + Boost::regex + Boost::thread + Boost::program_options) + +target_include_directories(rpc_base + PUBLIC $ + PUBLIC $ + 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 PUBLIC @@ -137,10 +93,30 @@ target_link_libraries(rpc cryptonote_protocol net version - ${Boost_REGEX_LIBRARY} - ${Boost_THREAD_LIBRARY} - PRIVATE - ${EXTRA_LIBRARIES}) + Boost::regex + Boost::thread) + +target_include_directories(rpc + PUBLIC $ + PUBLIC $ + 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 PUBLIC @@ -148,15 +124,42 @@ target_link_libraries(rpc_pub net cryptonote_basic serialization - ${Boost_THREAD_LIBRARY}) + Boost::thread) + +target_include_directories(rpc_pub + PUBLIC $ + PUBLIC $ + 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 LINK_PRIVATE cryptonote_core cryptonote_protocol version - serialization - ${EXTRA_LIBRARIES}) + serialization) + +# daemon rpc server + +add_library(daemon_rpc_server + daemon_handler.cpp + zmq_pub.cpp + zmq_server.cpp + message.h + daemon_messages.h + daemon_handler.h + zmq_server.h) target_link_libraries(daemon_rpc_server LINK_PRIVATE @@ -167,11 +170,13 @@ target_link_libraries(daemon_rpc_server version daemon_messages serialization - ${Boost_CHRONO_LIBRARY} - ${Boost_REGEX_LIBRARY} - ${Boost_SYSTEM_LIBRARY} - ${Boost_THREAD_LIBRARY} - ${ZMQ_LIB} - ${EXTRA_LIBRARIES}) -target_include_directories(daemon_rpc_server PUBLIC ${ZMQ_INCLUDE_PATH}) -target_include_directories(obj_daemon_rpc_server PUBLIC ${ZMQ_INCLUDE_PATH}) + Boost::chrono + Boost::regex + Boost::system + Boost::thread + ${ZMQ_LIBRARIES}) + +target_include_directories(daemon_rpc_server + PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../ + PRIVATE ${ZMQ_INCLUDE_DIRS} + PRIVATE ${OPENSSL_INCLUDE_DIR}) diff --git a/src/serialization/CMakeLists.txt b/src/serialization/CMakeLists.txt index d3b9e57ca..d133f593e 100644 --- a/src/serialization/CMakeLists.txt +++ b/src/serialization/CMakeLists.txt @@ -26,30 +26,36 @@ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -set(serialization_sources - json_object.cpp) +file(GLOB SER_HEADERS *.h) +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 LINK_PRIVATE cryptonote_basic cryptonote_core cryptonote_protocol epee - ${Boost_CHRONO_LIBRARY} - ${Boost_REGEX_LIBRARY} - ${Boost_SYSTEM_LIBRARY} - ${Boost_THREAD_LIBRARY} - ${EXTRA_LIBRARIES}) -add_dependencies(serialization - version) + Boost::chrono + Boost::regex + Boost::system + Boost::thread) + +add_dependencies(serialization version) + +target_include_directories(serialization + PUBLIC $ + PUBLIC $ + ) +monero_install_library(serialization "${CMAKE_INSTALL_INCLUDEDIR}/monero/serialization/") \ No newline at end of file diff --git a/src/simplewallet/CMakeLists.txt b/src/simplewallet/CMakeLists.txt index 1261ea04c..76be19c55 100644 --- a/src/simplewallet/CMakeLists.txt +++ b/src/simplewallet/CMakeLists.txt @@ -26,19 +26,13 @@ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -set(simplewallet_sources - simplewallet.cpp) +file(GLOB SW_SOURCES + *.cpp + *.c + *.cc + *.h) -set(simplewallet_headers) - -monero_find_all_headers(simplewallet_private_headers "${CMAKE_CURRENT_SOURCE_DIR}") - -monero_private_headers(simplewallet - ${simplewallet_private_headers}) -monero_add_executable(simplewallet - ${simplewallet_sources} - ${simplewallet_headers} - ${simplewallet_private_headers}) +add_executable(simplewallet ${SW_SOURCES}) target_link_libraries(simplewallet PRIVATE wallet @@ -50,16 +44,23 @@ target_link_libraries(simplewallet ${EPEE_READLINE} qrcodegen version - ${Boost_CHRONO_LIBRARY} - ${Boost_PROGRAM_OPTIONS_LIBRARY} - ${Boost_FILESYSTEM_LIBRARY} - ${Boost_LOCALE_LIBRARY} + + Boost::chrono + Boost::program_options + Boost::filesystem + Boost::system + Boost::thread + Boost::serialization + Boost::locale ${ICU_LIBRARIES} - ${Boost_THREAD_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} - ${GNU_READLINE_LIBRARY} - ${EXTRA_LIBRARIES}) + ${GNU_READLINE_LIBRARY}) + +target_include_directories(simplewallet + PRIVATE ${OPENSSL_INCLUDE_DIR}) + set_property(TARGET simplewallet PROPERTY OUTPUT_NAME "wownero-wallet-cli") -install(TARGETS simplewallet DESTINATION bin) + + diff --git a/src/wallet/CMakeLists.txt b/src/wallet/CMakeLists.txt index fdf3f2f5d..9d2d28633 100644 --- a/src/wallet/CMakeLists.txt +++ b/src/wallet/CMakeLists.txt @@ -26,27 +26,55 @@ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# include (${PROJECT_SOURCE_DIR}/cmake/libutils.cmake) +set(wallet_sources + wallet2.cpp + wallet_args.cpp + ringdb.cpp + node_rpc_proxy.cpp + message_store.cpp + message_transporter.cpp + wallet_rpc_payments.cpp) -set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) +set(wallet_headers + api/pending_transaction.h + api/pending_transaction_info.h + api/wallet.h + api/wallet2_api.h + wallet2.h) -set(wallet_sources - wallet2.cpp - wallet_args.cpp - ringdb.cpp - node_rpc_proxy.cpp - message_store.cpp - message_transporter.cpp - wallet_rpc_payments.cpp -) +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) -monero_find_all_headers(wallet_private_headers "${CMAKE_CURRENT_SOURCE_DIR}") +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 PUBLIC rpc_base @@ -54,54 +82,62 @@ target_link_libraries(wallet common cryptonote_core mnemonics - device_trezor net - ${LMDB_LIBRARY} - ${Boost_CHRONO_LIBRARY} - ${Boost_SERIALIZATION_LIBRARY} - ${Boost_FILESYSTEM_LIBRARY} - ${Boost_SYSTEM_LIBRARY} - ${Boost_THREAD_LIBRARY} - ${Boost_REGEX_LIBRARY} + lmdb + Boost::chrono + Boost::serialization + Boost::filesystem + Boost::system + Boost::thread + Boost::regex PRIVATE - ${EXTRA_LIBRARIES}) + OpenSSL::SSL) + +target_include_directories(wallet + PUBLIC $ + PUBLIC $ + PUBLIC $ + PRIVATE ${OPENSSL_INCLUDE_DIR} + ) + +monero_install_library(wallet "${CMAKE_INSTALL_INCLUDEDIR}/monero/wallet/") -if(NOT IOS) - set(wallet_rpc_sources - wallet_rpc_server.cpp) +# == rpc server - set(wallet_rpc_headers) +add_executable(wallet_rpc_server wallet_rpc_server.cpp) +target_link_libraries(wallet_rpc_server + PRIVATE + wallet + rpc_base + cryptonote_core + cncrypto + common + version + daemonizer + Boost::chrono + Boost::program_options + Boost::filesystem + Boost::thread + Threads::Threads + OpenSSL::SSL + OpenSSL::Crypto) - set(wallet_rpc_private_headers - wallet_rpc_server.h) +target_include_directories(wallet_rpc_server + PUBLIC $ + PUBLIC $ + PUBLIC $ + PRIVATE ${OPENSSL_INCLUDE_DIR} + ) - monero_private_headers(wallet_rpc_server - ${wallet_rpc_private_headers}) - monero_add_executable(wallet_rpc_server - ${wallet_rpc_sources} - ${wallet_rpc_headers} - ${wallet_rpc_private_headers}) +set_property(TARGET wallet_rpc_server PROPERTY OUTPUT_NAME "wownero-wallet-rpc") - target_link_libraries(wallet_rpc_server - PRIVATE - wallet - rpc_base - cryptonote_core - cncrypto - common - version - daemonizer - ${EPEE_READLINE} - ${Boost_CHRONO_LIBRARY} - ${Boost_PROGRAM_OPTIONS_LIBRARY} - ${Boost_FILESYSTEM_LIBRARY} - ${Boost_THREAD_LIBRARY} - ${CMAKE_THREAD_LIBS_INIT} - ${EXTRA_LIBRARIES}) - set_property(TARGET wallet_rpc_server - PROPERTY - OUTPUT_NAME "wownero-wallet-rpc") - install(TARGETS wallet_rpc_server DESTINATION bin) -endif() +install(TARGETS wallet_rpc_server + EXPORT walletRpcServerTargets + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/monero/ + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/monero/ + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/monero/ + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/monero/ + ) add_subdirectory(api) diff --git a/src/wallet/api/CMakeLists.txt b/src/wallet/api/CMakeLists.txt index 630557aaf..3a19cca38 100644 --- a/src/wallet/api/CMakeLists.txt +++ b/src/wallet/api/CMakeLists.txt @@ -28,8 +28,6 @@ # include (${PROJECT_SOURCE_DIR}/cmake/libutils.cmake) -set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) - set(wallet_api_sources wallet.cpp wallet_manager.cpp @@ -46,8 +44,7 @@ set(wallet_api_sources coins.cpp coins_info.cpp) -set(wallet_api_headers - wallet2_api.h) +set(wallet_api_headers wallet2_api.h) set(wallet_api_private_headers wallet.h @@ -65,39 +62,33 @@ set(wallet_api_private_headers coins.h coins_info.h) -monero_private_headers(wallet_api - ${wallet_api_private_headers}) -monero_add_library(wallet_api - ${wallet_api_sources} - ${wallet_api_headers} - ${wallet_api_private_headers}) +add_library(wallet_api) + target_link_libraries(wallet_api PUBLIC wallet common cryptonote_core mnemonics - ${LMDB_LIBRARY} - ${Boost_CHRONO_LIBRARY} - ${Boost_LOCALE_LIBRARY} - ${ICU_LIBRARIES} - ${Boost_SERIALIZATION_LIBRARY} - ${Boost_FILESYSTEM_LIBRARY} - ${Boost_SYSTEM_LIBRARY} - ${Boost_THREAD_LIBRARY} - ${CMAKE_THREAD_LIBS_INIT} - ${Boost_REGEX_LIBRARY} - PRIVATE - ${EXTRA_LIBRARIES}) + lmdb + Boost::chrono + Boost::program_options + Boost::filesystem + Boost::thread + Boost::locale + Boost::serialization + Boost::system + Boost::regex + ${ICU_LIBRARIES}) -set_property(TARGET wallet_api PROPERTY EXCLUDE_FROM_ALL TRUE) -set_property(TARGET obj_wallet_api PROPERTY EXCLUDE_FROM_ALL TRUE) +target_include_directories(wallet_api + PRIVATE ${OPENSSL_INCLUDE_DIR}) -if(IOS) - set(lib_folder lib-${ARCH}) -else() - set(lib_folder lib) -endif() +target_sources(wallet_api + PRIVATE + ${wallet_api_private_headers} + ${wallet_api_sources} + PUBLIC + FILE_SET HEADERS BASE_DIRS ${PROJECT_SOURCE_DIR}/src FILES ${wallet_api_headers}) -install(FILES ${wallet_api_headers} - DESTINATION include/wallet/api) +monero_install_library(wallet_api "${CMAKE_INSTALL_INCLUDEDIR}/monero/wallet/api/") diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index bacc68335..0d8a3b7e0 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -90,7 +90,6 @@ using namespace epee; #include "ringct/rctSigs.h" #include "ringdb.h" #include "device/device_cold.hpp" -#include "device_trezor/device_trezor.hpp" #include "net/socks_connect.h" extern "C" @@ -8671,9 +8670,7 @@ crypto::chacha_key wallet2::get_ringdb_key() return *m_ringdb_key; } -void wallet2::register_devices(){ - hw::trezor::register_all(); -} +void wallet2::register_devices(){} hw::device& wallet2::lookup_device(const std::string & device_descriptor){ if (!m_devices_registered){ diff --git a/src/wallet/wallet_rpc_server_commands_defs.h b/src/wallet/wallet_rpc_server_commands_defs.h index d5c6bfd6b..46c01a8eb 100644 --- a/src/wallet/wallet_rpc_server_commands_defs.h +++ b/src/wallet/wallet_rpc_server_commands_defs.h @@ -530,6 +530,17 @@ namespace wallet_rpc END_KV_SERIALIZE_MAP() }; + struct amounts_list + { + std::list amounts; + + bool operator==(const amounts_list& other) const { return amounts == other.amounts; } + + BEGIN_KV_SERIALIZE_MAP() + KV_SERIALIZE(amounts) + END_KV_SERIALIZE_MAP() + }; + struct single_transfer_response { std::string tx_hash; diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index e074ceed6..01466f088 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -91,10 +91,6 @@ else () add_subdirectory(net_load_tests) endif() -if (BUILD_GUI_DEPS) - add_subdirectory(libwallet_api_tests) -endif() - if (TREZOR_DEBUG) add_subdirectory(trezor) endif() diff --git a/tests/trezor/CMakeLists.txt b/tests/trezor/CMakeLists.txt index 7c8cdf776..b2585dcd4 100644 --- a/tests/trezor/CMakeLists.txt +++ b/tests/trezor/CMakeLists.txt @@ -52,7 +52,6 @@ target_link_libraries(trezor_tests version epee device - device_trezor wallet wallet_api rpc