From 9b2d4a6709011410840b85182fdc378ef4be9e39 Mon Sep 17 00:00:00 2001 From: clemahieu Date: Fri, 13 Jan 2023 12:37:09 +0000 Subject: [PATCH] Adding boost as a submodule rather than requiring it to be provided externally. The boost libs are now statically linked to the nano targets so dynamic linking related functionality has been removed. Adding several target link references that were missing but not apparent when using the unified boost install directories Linking to boost stacktrace basic as this is the main functionality we use. Windows Event Log support has been disabled as there is a compatibility issue with GitHub builders Windows cryptopp ASM has been disabled since CMake isn't assembling .asm files for unknown reasons. Added boost_checkout_lite.sh script which can be used to do a minimal clone of the boost submodule after it's been added but not yet initialized. --- .gitmodules | 3 + CMakeLists.txt | 193 +++++++++++++++------------- boost | 1 + boost_checkout_lite.sh | 19 +++ ci/actions/windows/build.bat | 2 +- ci/actions/windows/build.ps1 | 9 +- ci/actions/windows/configure.bat | 7 +- ci/actions/windows/install_deps.ps1 | 15 +-- nano/lib/CMakeLists.txt | 13 +- nano/lib/utility.cpp | 29 +---- nano/load_test/CMakeLists.txt | 9 +- nano/nano_node/CMakeLists.txt | 13 +- nano/nano_node/entry.cpp | 25 +--- nano/node/CMakeLists.txt | 6 +- nano/node/lmdb/lmdb_txn.cpp | 20 +-- nano/node/logging.cpp | 15 --- nano/rpc/CMakeLists.txt | 2 +- nano/secure/CMakeLists.txt | 1 + nano/secure/common.hpp | 1 + 19 files changed, 171 insertions(+), 212 deletions(-) create mode 160000 boost create mode 100755 boost_checkout_lite.sh diff --git a/.gitmodules b/.gitmodules index 900d962a80..697ecde59f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -26,3 +26,6 @@ [submodule "diskhash"] path = diskhash url = https://github.com/nanocurrency/diskhash.git +[submodule "boost"] + path = boost + url = https://github.com/boostorg/boost.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 00d089d68c..eb9bfa4602 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,11 +9,6 @@ if(CMAKE_VERSION VERSION_GREATER 3.13 OR CMAKE_VERSION VERSION_EQUAL 3.13) cmake_policy(SET CMP0077 NEW) endif() -if(CMAKE_VERSION VERSION_LESS 3.13) - # compatibility for boost import targets use bundled 3.13 FindBoost.cmake - list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/legacyModules") -endif() - # compatibility for osx sierra and on needs to be set before project set(CMAKE_OSX_DEPLOYMENT_TARGET 10.14 @@ -65,8 +60,7 @@ else() endif() if(APPLE) - set(CMAKE_INSTALL_RPATH - "@executable_path/../Frameworks;@executable_path/../boost/lib") + set(CMAKE_INSTALL_RPATH "@executable_path/../Frameworks") else() set(CMAKE_INSTALL_RPATH "$ORIGIN/../lib") endif() @@ -129,16 +123,6 @@ set(NANO_ROCKSDB_TOOLS OFF CACHE BOOL "") -option(NANO_STACKTRACE_BACKTRACE - "Use BOOST_STACKTRACE_USE_BACKTRACE in stacktraces, for POSIX" OFF) -if(NANO_STACKTRACE_BACKTRACE) - add_definitions(-DNANO_STACKTRACE_BACKTRACE=1) - if(BACKTRACE_INCLUDE) - add_definitions( - -DBOOST_STACKTRACE_BACKTRACE_INCLUDE_FILE=${BACKTRACE_INCLUDE}) - endif() -endif() - if(${NANO_TIMED_LOCKS} GREATER 0) add_definitions(-DNANO_TIMED_LOCKS=${NANO_TIMED_LOCKS}) add_definitions(-DNANO_TIMED_LOCKS_FILTER=${NANO_TIMED_LOCKS_FILTER}) @@ -360,35 +344,110 @@ else() endif() include_directories(${CMAKE_SOURCE_DIR}) - -if(WIN32 - AND NANO_TEST - AND NANO_SHARED_BOOST) - message( - SEND_ERROR - " Linking errors occur if NANO_SHARED_BOOST is used with tests on Windows" - " Disable NANO_SHARED_BOOST or NANO_TEST on Windows") - set(NANO_SHARED_BOOST) -endif() - -set(NANO_SHARED_BOOST - OFF - CACHE BOOL "Build Nano with shared boost") - -if(NANO_SHARED_BOOST) - set(Boost_USE_STATIC_LIBS OFF) - set(Boost_USE_STATIC_RUNTIME OFF) - set(Boost_NO_BOOST_CMAKE ON) - add_definitions(-DBOOST_ALL_DYN_LINK) -else() - set(Boost_USE_STATIC_LIBS ON) -endif() -set(Boost_USE_MULTITHREADED ON) - list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules") -find_package(Boost 1.81.0 REQUIRED COMPONENTS filesystem log log_setup thread - program_options system) +set(Boost_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/boost/libs/config/include) +set(BOOST_MODULE_LIBS + algorithm + align + any + array + asio + assert + atomic + beast + bind + chrono + circular_buffer + concept_check + config + container + container_hash + context + conversion + core + coroutine + date_time + describe + detail + dll + dynamic_bitset + endian + exception + filesystem + foreach + format + function + function_types + functional + fusion + integer + interprocess + intrusive + io + iostreams + iterator + lexical_cast + property_tree + log + logic + math + move + mp11 + mpl + multi_index + multiprecision + numeric/conversion + optional + parameter + phoenix + pool + predef + preprocessor + process + program_options + proto + random + range + ratio + rational + regex + serialization + smart_ptr + spirit + stacktrace + static_assert + static_string + system + thread + throw_exception + tokenizer + tuple + type_index + type_traits + typeof + unordered + utility + variant + variant2 + winapi) + +add_definitions(-DBOOST_ALL_NO_LIB) # Disable automatic boost linking +foreach(lib IN LISTS BOOST_MODULE_LIBS) + add_subdirectory(boost/libs/${lib} EXCLUDE_FROM_ALL) +endforeach() +include_directories(${BOOST_LIBRARY_INCLUDES}) +add_library(Boost::stacktrace ALIAS boost_stacktrace_basic) +add_definitions(-DBOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED) + +# Workaround for GitHub builders which do not appear to have the Windows Message +# Compiler mc.exe +add_definitions(-DBOOST_LOG_WITHOUT_EVENT_LOG) + +# Workaround for missing reference errata in the boost property_tree module +target_link_libraries(boost_property_tree INTERFACE Boost::any) +target_link_libraries(boost_property_tree INTERFACE Boost::format) +target_link_libraries(boost_property_tree INTERFACE Boost::multi_index) # diskhash if(NOT CMAKE_SYSTEM_NAME STREQUAL "Windows") @@ -457,11 +516,8 @@ set(USE_INTERMEDIATE_OBJECTS_TARGET CACHE BOOL "") set(CRYPTOPP_EXTRA "") if(WIN32) - set(CRYPTOPP_EXTRA crypto/cryptopp/x64dll.asm crypto/cryptopp/x64masm.asm) - enable_language(ASM) - enable_language(ASM_MASM) - # similar to SSE2 settings - add_definitions(-DCRYPTOPP_DISABLE_SSSE3 -DCRYPTOPP_DISABLE_AESNI) + add_definitions(-DCRYPTOPP_DISABLE_ASM -DCRYPTOPP_DISABLE_SSSE3 + -DCRYPTOPP_DISABLE_AESNI) elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" AND (NANO_SIMD_OPTIMIZATIONS OR RAIBLOCKS_SIMD_OPTIMIZATIONS)) set(CRYPTOPP_EXTRA @@ -585,7 +641,6 @@ if(NANO_FUZZER_TEST) endif() if(NANO_TEST OR RAIBLOCKS_TEST) - find_package(Boost 1.81.0 REQUIRED COMPONENTS coroutine context) if(WIN32) if(MSVC_VERSION) if(MSVC_VERSION GREATER_EQUAL 1910) @@ -756,16 +811,6 @@ if(NANO_GUI OR RAIBLOCKS_GUI) DESTINATION ${NANO_OSX_PACKAGE_NAME}.app/Contents/Frameworks) install(FILES "${Qt5_DIR}/../../../plugins/platforms/libqcocoa.dylib" DESTINATION ${NANO_OSX_PACKAGE_NAME}.app/Contents/PlugIns/platforms) - if(NANO_SHARED_BOOST) - foreach(boost_lib IN LISTS Boost_LIBRARIES) - string(REGEX MATCH "(.+/.*boost_[^-]+)" boost_lib_name ${boost_lib}) - set(boost_dll "${CMAKE_MATCH_1}") - if(${boost_dll} MATCHES "boost") - install(FILES ${boost_dll} - DESTINATION ${NANO_OSX_PACKAGE_NAME}.app/Contents/boost/lib) - endif() - endforeach(boost_lib) - endif() install(FILES Nano.icns DESTINATION ${NANO_OSX_PACKAGE_NAME}.app/Contents/Resources) elseif(WIN32) @@ -794,25 +839,6 @@ if(NANO_GUI OR RAIBLOCKS_GUI) get_filename_component(Qt5_bin_DIR ${Qt5_DIR}/../../../bin ABSOLUTE) install(TARGETS nano_wallet DESTINATION .) install(TARGETS nano_wallet_com DESTINATION .) - if(NANO_SHARED_BOOST) - foreach(boost_lib IN LISTS Boost_LIBRARIES) - if(${CMAKE_BUILD_TYPE} MATCHES "Rel") - string(REGEX MATCH "(.+/.*boost_[^-]+-.+-mt-x64.+\)(.lib|a)" - boost_lib_name ${boost_lib}) - set(boost_dll "${CMAKE_MATCH_1}.dll") - if(${boost_dll} MATCHES "boost") - install(FILES ${boost_dll} DESTINATION .) - endif() - else() - string(REGEX MATCH "(.+/.*boost_[^-]+-.+-mt-.+-x64.+\)(.lib|a)" - boost_lib_name ${boost_lib}) - set(boost_dll "${CMAKE_MATCH_1}.dll") - if(${boost_dll} MATCHES "boost") - install(FILES ${boost_dll} DESTINATION .) - endif() - endif() - endforeach(boost_lib) - endif() install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${WIN_REDIST} DESTINATION .) install(FILES ${Qt5_bin_DIR}/libGLESv2.dll DESTINATION .) install(FILES ${Qt5_bin_DIR}/Qt5Core.dll DESTINATION .) @@ -826,15 +852,6 @@ if(NANO_GUI OR RAIBLOCKS_GUI) "qt5-default | qtbase5-dev, qtchooser, qt5-qmake, qtbase5-dev-tools") set(CPACK_DEBIAN_PACKAGE_MAINTAINER "russel@nano.org") install(TARGETS nano_wallet RUNTIME DESTINATION ./bin) - if(NANO_SHARED_BOOST) - foreach(boost_lib IN LISTS Boost_LIBRARIES) - string(REGEX MATCH "(.+/.*boost_[^-]+)" boost_lib_name ${boost_lib}) - set(boost_dll "${CMAKE_MATCH_1}.${Boost_VERSION_STRING}") - if(${boost_dll} MATCHES "boost") - install(FILES ${boost_dll} DESTINATION ./lib) - endif() - endforeach(boost_lib) - endif() set(DEBIAN_POSTINST postinst.in) set(DEBIAN_POSTRM postrm.in) diff --git a/boost b/boost new file mode 160000 index 0000000000..da041154c6 --- /dev/null +++ b/boost @@ -0,0 +1 @@ +Subproject commit da041154c6bac1a4aa98254a7d6819059e8ac0b0 diff --git a/boost_checkout_lite.sh b/boost_checkout_lite.sh new file mode 100755 index 0000000000..6e650ce7ab --- /dev/null +++ b/boost_checkout_lite.sh @@ -0,0 +1,19 @@ +#!/bin/bash +#set -x +#Check out boost submodule with minimum set of modules to reduce size + +# flattened boost libs dependency list +dependencies=("algorithm" "align" "any" "array" "asio" "assert" "atomic" "beast" "bind" "chrono" "circular_buffer" "concept_check" "config" "container" "container_hash" "context" "conversion" "core" "coroutine" "date_time" "describe" "detail" "dll" "dynamic_bitset" "endian" "exception" "filesystem" "foreach" "format" "function" "function_types" "functional" "fusion" "integer" "interprocess" "intrusive" "io" "iostreams" "iterator" "lexical_cast" "log" "logic" "math" "move" "mp11" "mpl" "multi_index" "multiprecision" "numeric_conversion" "optional" "parameter" "phoenix" "pool" "predef" "preprocessor" "process" "program_options" "property_tree" "proto" "random" "range" "ratio" "rational" "regex" "serialization" "smart_ptr" "spirit" "stacktrace" "static_assert" "static_string" "system" "thread" "throw_exception" "tokenizer" "tuple" "type_index" "type_traits" "typeof" "unordered" "utility" "variant" "variant2" "winapi") + +git submodule init boost +cd boost +# deactivate all boost submodules +git submodule foreach 'git config submodule.$sm_path.active false' +# selectivly activate required dependencies +for i in ${dependencies[@]} +do + git config submodule.$i.active true +done +cd .. +# Update all submodules recursivly. Deactivated modules will be skipped by --recursive +git submodule update --jobs 16 --recursive --recommend-shallow --single-branch diff --git a/ci/actions/windows/build.bat b/ci/actions/windows/build.bat index 9cd4e8a3ef..7d3e5bd5d2 100644 --- a/ci/actions/windows/build.bat +++ b/ci/actions/windows/build.bat @@ -26,4 +26,4 @@ set exit_code=%errorlevel% goto exit :exit -exit /B %exit_code% \ No newline at end of file +exit /B %exit_code% diff --git a/ci/actions/windows/build.ps1 b/ci/actions/windows/build.ps1 index 0a3f9cd8ab..6d44ca2f81 100644 --- a/ci/actions/windows/build.ps1 +++ b/ci/actions/windows/build.ps1 @@ -12,7 +12,6 @@ if (${env:artifact} -eq 1) { else { $env:NETWORK_CFG = "live" } - $env:NANO_SHARED_BOOST = "ON" $env:NANO_TEST = "-DNANO_TEST=OFF" $env:CI_TAG = ${env:TAG} if ([string]::IsNullOrEmpty(${env:VERSION_PRE_RELEASE})) { @@ -27,10 +26,9 @@ else { if ( ${env:RELEASE} -eq "true" -or ${env:TEST_USE_ROCKSDB} -eq 1 ) { $env:BUILD_TYPE = "RelWithDebInfo" } - else { + else { $env:BUILD_TYPE = "Debug" } - $env:NANO_SHARED_BOOST = "OFF" $env:NETWORK_CFG = "dev" $env:NANO_TEST = "-DNANO_TEST=ON" $env:CI = '-DCI_TEST="1"' @@ -40,9 +38,6 @@ else { mkdir build Push-Location build -#accessibility of Boost dlls for generating config samples -$ENV:PATH = "$ENV:PATH;$ENV:BOOST_ROOT\lib64-msvc-14.2" - & ..\ci\actions\windows\configure.bat if (${LastExitCode} -ne 0) { throw "Failed to configure" @@ -65,4 +60,4 @@ if (${LastExitCode} -ne 0) { throw "Failed to Pass Test ${env:RUN}" } -Pop-Location \ No newline at end of file +Pop-Location diff --git a/ci/actions/windows/configure.bat b/ci/actions/windows/configure.bat index 7a3f08cbab..5be450a9ca 100644 --- a/ci/actions/windows/configure.bat +++ b/ci/actions/windows/configure.bat @@ -15,13 +15,10 @@ cmake .. ^ -DCMAKE_BUILD_TYPE=%BUILD_TYPE% ^ -DACTIVE_NETWORK=nano_%NETWORK_CFG%_network ^ -DNANO_SIMD_OPTIMIZATIONS=TRUE ^ - -Dgtest_force_shared_crt=on ^ - -DBoost_NO_SYSTEM_PATHS=TRUE ^ - -DBoost_NO_BOOST_CMAKE=TRUE ^ - -DNANO_SHARED_BOOST=%NANO_SHARED_BOOST% + -Dgtest_force_shared_crt=on set exit_code=%errorlevel% if %exit_code% neq 0 goto exit :exit -exit /B %exit_code% \ No newline at end of file +exit /B %exit_code% diff --git a/ci/actions/windows/install_deps.ps1 b/ci/actions/windows/install_deps.ps1 index 81ccbdfa30..4e287488a8 100644 --- a/ci/actions/windows/install_deps.ps1 +++ b/ci/actions/windows/install_deps.ps1 @@ -13,7 +13,7 @@ function Get-RedirectedUri { .NOTES Code from: Redone per issue #2896 in core https://github.com/PowerShell/PowerShell/issues/2896 #> - + [CmdletBinding()] param ( [Parameter(Mandatory = $true)] @@ -31,7 +31,7 @@ function Get-RedirectedUri { # This is for Powershell core $redirectUri = $request.BaseResponse.RequestMessage.RequestUri.AbsoluteUri } - + $retry = $false } catch { @@ -44,12 +44,10 @@ function Get-RedirectedUri { } } } while ($retry) - + $redirectUri } } -$boost_url = Get-RedirectedUri "https://repo.nano.org/artifacts/boost-msvc14.2-1.70-full.zip" -$BOOST_ROOT = "c:\local\boost_1_70_0" $qt5_root = "c:\qt" $qt5base_url = Get-RedirectedUri "https://repo.nano.org/artifacts/5.13.1-0-201909031231qtbase-Windows-Windows_10-MSVC2017-Windows-Windows_10-X86_64.7z" $qt5winextra_url = Get-RedirectedUri "https://repo.nano.org/artifacts/5.13.1-0-201909031231qtwinextras-Windows-Windows_10-MSVC2017-Windows-Windows_10-X86_64.7z" @@ -62,10 +60,3 @@ mkdir $qt5_root Push-Location $qt5_root 7z x "${env:TMP}\qt5*.7z" -aoa Pop-Location - - -mkdir $BOOST_ROOT -Write-Output "BOOST_ROOT=$BOOST_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append -(New-Object System.Net.WebClient).DownloadFile($boost_url, "${env:TMP}\boost-msvc.zip") -Push-Location $BOOST_ROOT -7z x "${env:TMP}\boost-msvc.zip" -aoa \ No newline at end of file diff --git a/nano/lib/CMakeLists.txt b/nano/lib/CMakeLists.txt index 8300f37f0a..091aa642e3 100644 --- a/nano/lib/CMakeLists.txt +++ b/nano/lib/CMakeLists.txt @@ -93,11 +93,14 @@ target_link_libraries( ipc_flatbuffers_lib ${CRYPTOPP_LIBRARY} ${CMAKE_DL_LIBS} - Boost::program_options) - -if(NANO_STACKTRACE_BACKTRACE) - target_link_libraries(nano_lib backtrace) -endif() + Boost::asio + Boost::circular_buffer + Boost::dll + Boost::log_setup + Boost::log + Boost::multiprecision + Boost::program_options + Boost::stacktrace) target_compile_definitions( nano_lib diff --git a/nano/lib/utility.cpp b/nano/lib/utility.cpp index d7ada0b4c9..821e722e10 100644 --- a/nano/lib/utility.cpp +++ b/nano/lib/utility.cpp @@ -4,42 +4,21 @@ #include #include -#include -#include -#include - #ifdef _WIN32 #ifndef NOMINMAX #define NOMINMAX #endif #endif +#include +#include +#include +#include #include #include #include #include -// Some builds (mac) fail due to "Boost.Stacktrace requires `_Unwind_Backtrace` function". -#ifndef _WIN32 -#ifdef NANO_STACKTRACE_BACKTRACE -#define BOOST_STACKTRACE_USE_BACKTRACE -#endif -#ifndef _GNU_SOURCE -#define BEFORE_GNU_SOURCE 0 -#define _GNU_SOURCE -#else -#define BEFORE_GNU_SOURCE 1 -#endif -#endif -// On Windows this include defines min/max macros, so keep below other includes -// to reduce conflicts with other std functions -#include -#ifndef _WIN32 -#if !BEFORE_GNU_SOURCE -#undef _GNU_SOURCE -#endif -#endif - #ifndef _WIN32 #include #endif diff --git a/nano/load_test/CMakeLists.txt b/nano/load_test/CMakeLists.txt index df5558fc99..fee654bba0 100644 --- a/nano/load_test/CMakeLists.txt +++ b/nano/load_test/CMakeLists.txt @@ -1,10 +1,3 @@ add_executable(load_test entry.cpp) -target_link_libraries( - load_test - node - secure - test_common - gtest - Boost::coroutine - Boost::context) +target_link_libraries(load_test node secure test_common gtest) diff --git a/nano/nano_node/CMakeLists.txt b/nano/nano_node/CMakeLists.txt index a5c5962a4a..6d52171e66 100644 --- a/nano/nano_node/CMakeLists.txt +++ b/nano/nano_node/CMakeLists.txt @@ -1,10 +1,13 @@ add_executable(nano_node daemon.cpp daemon.hpp entry.cpp) -target_link_libraries(nano_node node rpc secure argon2 ${PLATFORM_LIBS}) - -if(NANO_STACKTRACE_BACKTRACE) - target_link_libraries(nano_node backtrace) -endif() +target_link_libraries( + nano_node + Boost::process + node + rpc + secure + argon2 + ${PLATFORM_LIBS}) target_compile_definitions( nano_node PRIVATE -DTAG_VERSION_STRING=${TAG_VERSION_STRING} diff --git a/nano/nano_node/entry.cpp b/nano/nano_node/entry.cpp index d614011232..c64a46f1e1 100644 --- a/nano/nano_node/entry.cpp +++ b/nano/nano_node/entry.cpp @@ -15,6 +15,12 @@ #include #include #include +#ifdef _WIN32 +#ifndef NOMINMAX +#define NOMINMAX +#endif +#endif +#include #include #include @@ -23,25 +29,6 @@ #include -// Some builds (mac) fail due to "Boost.Stacktrace requires `_Unwind_Backtrace` function". -#ifndef _WIN32 -#ifdef NANO_STACKTRACE_BACKTRACE -#define BOOST_STACKTRACE_USE_BACKTRACE -#endif -#ifndef _GNU_SOURCE -#define BEFORE_GNU_SOURCE 0 -#define _GNU_SOURCE -#else -#define BEFORE_GNU_SOURCE 1 -#endif -#endif -#include -#ifndef _WIN32 -#if !BEFORE_GNU_SOURCE -#undef _GNU_SOURCE -#endif -#endif - namespace { class uint64_from_hex // For use with boost::lexical_cast to read hexadecimal strings diff --git a/nano/node/CMakeLists.txt b/nano/node/CMakeLists.txt index 5dff4d409d..209f8f9e48 100644 --- a/nano/node/CMakeLists.txt +++ b/nano/node/CMakeLists.txt @@ -234,10 +234,12 @@ target_link_libraries( libminiupnpc-static argon2 lmdb + Boost::beast Boost::filesystem Boost::log_setup Boost::log Boost::program_options + Boost::stacktrace Boost::system Boost::thread rocksdb @@ -245,10 +247,6 @@ target_link_libraries( ${CMAKE_DL_LIBS} ${psapi_lib}) -if(NANO_STACKTRACE_BACKTRACE) - target_link_libraries(node backtrace) -endif() - target_compile_definitions( node PRIVATE -DTAG_VERSION_STRING=${TAG_VERSION_STRING} -DGIT_COMMIT_HASH=${GIT_COMMIT_HASH}) diff --git a/nano/node/lmdb/lmdb_txn.cpp b/nano/node/lmdb/lmdb_txn.cpp index 7a2805ed97..5d577b384a 100644 --- a/nano/node/lmdb/lmdb_txn.cpp +++ b/nano/node/lmdb/lmdb_txn.cpp @@ -8,26 +8,12 @@ #include -// Some builds (mac) fail due to "Boost.Stacktrace requires `_Unwind_Backtrace` function". -#ifndef _WIN32 -#ifdef NANO_STACKTRACE_BACKTRACE -#define BOOST_STACKTRACE_USE_BACKTRACE +#ifdef _WIN32 +#ifndef NOMINMAX +#define NOMINMAX #endif -#ifndef _GNU_SOURCE -#define BEFORE_GNU_SOURCE 0 -#define _GNU_SOURCE -#else -#define BEFORE_GNU_SOURCE 1 #endif -#endif -// On Windows this include defines min/max macros, so keep below other includes -// to reduce conflicts with other std functions #include -#ifndef _WIN32 -#if !BEFORE_GNU_SOURCE -#undef _GNU_SOURCE -#endif -#endif namespace { diff --git a/nano/node/logging.cpp b/nano/node/logging.cpp index d8bde2722d..6a414f0b8b 100644 --- a/nano/node/logging.cpp +++ b/nano/node/logging.cpp @@ -12,7 +12,6 @@ #include #ifdef BOOST_WINDOWS -#include #else #define BOOST_LOG_USE_NATIVE_SYSLOG #include @@ -37,20 +36,6 @@ void nano::logging::init (boost::filesystem::path const & application_path_a) } #ifdef BOOST_WINDOWS - if (nano::event_log_reg_entry_exists () || nano::is_windows_elevated ()) - { - static auto event_sink = boost::make_shared> (boost::log::keywords::log_name = "Nano", boost::log::keywords::log_source = "Nano"); - event_sink->set_formatter (format); - - // Currently only mapping sys log errors - boost::log::sinks::event_log::custom_event_type_mapping mapping ("Severity"); - mapping[nano::severity_level::error] = boost::log::sinks::event_log::error; - event_sink->locked_backend ()->set_event_type_mapper (mapping); - - // Only allow messages or error or greater severity to the event log - event_sink->set_filter (severity >= nano::severity_level::error); - boost::log::core::get ()->add_sink (event_sink); - } #else static auto sys_sink = boost::make_shared> (boost::log::keywords::facility = boost::log::sinks::syslog::user, boost::log::keywords::use_impl = boost::log::sinks::syslog::impl_types::native); sys_sink->set_formatter (format); diff --git a/nano/rpc/CMakeLists.txt b/nano/rpc/CMakeLists.txt index 29e43d7435..8883819b87 100644 --- a/nano/rpc/CMakeLists.txt +++ b/nano/rpc/CMakeLists.txt @@ -15,4 +15,4 @@ add_library( rpc_request_processor.hpp rpc_request_processor.cpp) -target_link_libraries(rpc nano_lib ${OPENSSL_LIBRARIES}) +target_link_libraries(rpc Boost::beast nano_lib ${OPENSSL_LIBRARIES}) diff --git a/nano/secure/CMakeLists.txt b/nano/secure/CMakeLists.txt index 77549fc9f4..050634b4f2 100644 --- a/nano/secure/CMakeLists.txt +++ b/nano/secure/CMakeLists.txt @@ -60,6 +60,7 @@ target_link_libraries( ed25519 crypto_lib lmdb + Boost::iostreams Boost::system Boost::filesystem) diff --git a/nano/secure/common.hpp b/nano/secure/common.hpp index c7409434df..c7704137d2 100644 --- a/nano/secure/common.hpp +++ b/nano/secure/common.hpp @@ -15,6 +15,7 @@ #include #include +#include #include namespace boost