Skip to content

Commit

Permalink
Merge commit 'cd2d0394d671515ba1e74c7fbcda272b8e8b91ec' into topic-2020
Browse files Browse the repository at this point in the history
  • Loading branch information
mosu-forge committed Feb 21, 2020
2 parents 6c8b7b4 + cd2d039 commit 9376655
Show file tree
Hide file tree
Showing 462 changed files with 19,295 additions and 16,869 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,6 @@ local.properties

# VS Code
.vscode

# Document
doc
36 changes: 25 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ cache:
apt: true

os: linux
dist: trusty

addons:
apt:
Expand Down Expand Up @@ -86,6 +87,17 @@ matrix:
env:
- COMPILERS="CC=gcc-7 CXX=g++-7"
- COMPILE=main
- name: g++-7 daemon DISABLE x86 64bit elliptic curve
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-7
env:
- COMPILERS="CC=gcc-7 CXX=g++-7"
- DEF_CMAKE_OPTIONS="CMAKE_OPTIONS=-DUSE_EC_64=OFF"
- COMPILE=main
- name: g++-7 test
addons:
apt:
Expand Down Expand Up @@ -176,6 +188,7 @@ install:
sudo apt-get install -y libldns-dev;
sudo apt-get install -y libgtest-dev;
sudo apt-get install -y libunwind8-dev;
sudo apt-get install -y nasm;
fi
# clang 5.0 ships libunwind in own lib folder
- if [ "$CC" == "clang-5.0" ] ; then
Expand All @@ -184,14 +197,15 @@ install:

script:
- eval "${COMPILERS}"
- eval "${DEF_CMAKE_OPTIONS}"
- cd $HOME
- |
if [ "$COMPILE" == "main" ] ; then
mkdir linux-x64-build
cd linux-x64-build
cmake -DCMAKE_INSTALL_PREFIX=$HOME/ryo-linux-x64-release -DARCH="x86-64" -DBUILD_64=ON -DCMAKE_BUILD_TYPE=Debug -DBUILD_TAG="linux-x64-release" $TRAVIS_BUILD_DIR
make -j "$NUMBER_OF_CPUS"
make install
mkdir linux-x64-build &&
cd linux-x64-build &&
cmake -DCMAKE_INSTALL_PREFIX=$HOME/ryo-linux-x64-release -DARCH="x86-64" -DBUILD_64=ON -DCMAKE_BUILD_TYPE=Debug -DBUILD_TAG="linux-x64-release" $CMAKE_OPTIONS $TRAVIS_BUILD_DIR &&
make -j "$NUMBER_OF_CPUS" &&
make install &&
cd bin
# runtime tests are currently disabled because the help is exiting with error code 1
#for prog in $(find . -type f -executable)
Expand All @@ -201,14 +215,14 @@ script:
#done
elif [ "$COMPILE" == "tests" ] ; then
# compile tests
cd $HOME
mkdir linux-x64-tests-build
cd linux-x64-tests-build
cmake -DBUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Debug $TRAVIS_BUILD_DIR
cd $HOME &&
mkdir linux-x64-tests-build &&
cd linux-x64-tests-build &&
cmake -DBUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Debug $CMAKE_OPTIONS $TRAVIS_BUILD_DIR &&
# build all tests
make -j "$NUMBER_OF_CPUS"
make -j "$NUMBER_OF_CPUS" &&
# run unit tests
cd tests
cd tests &&
ctest -V
else
echo "not supported compile option '$COMPILE'"
Expand Down
86 changes: 70 additions & 16 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2018, Ryo Currency Project
# Copyright (c) 2019, Ryo Currency Project
# Copyright (c) 2014-2018, The Monero Project
#
# All rights reserved.
Expand Down Expand Up @@ -29,7 +29,7 @@
# Authors and copyright holders agree that:
#
# 8. This licence expires and the work covered by it is released into the
# public domain on 1st of February 2019
# public domain on 1st of February 2020
#
# 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
Expand Down Expand Up @@ -58,6 +58,65 @@ cmake_minimum_required(VERSION 3.1.0)

project(ryo)

# enforce C++11
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD 11)

# enforce C11
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS OFF)
set(CMAKE_C_STANDARD 11)

# helper function to generate options
function(ryo_option name description default)
set(USE_${name} ${default} CACHE STRING "${description}")
set_property(CACHE USE_${name} PROPERTY
STRINGS "ON;TRUE;AUTO;OFF;FALSE")
if(HAVE_${name})
set(HAVE_${name} TRUE PARENT_SCOPE)
else()
set(HAVE_${name} PARENT_SCOPE)
endif()
endfunction()

# detect 64bit x86 architecture and set ARCH_X86_64
if (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
set(ARCH_X86_64 TRUE)
elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "amd64")
set(ARCH_X86_64 TRUE)
elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "AMD64")
# cmake reports AMD64 on Windows, but we might be building for 32-bit.
if (CMAKE_CL_64)
set(ARCH_X86_64 TRUE)
endif()
endif()

################################################################################
### ELLIPTIC CURVE
ryo_option(EC_64 "use optimized x86 64bit elliptic curve implementation" AUTO)
# check if x86_64 elliptic curve implementation can be used
if(USE_EC_64 STREQUAL AUTO)
enable_language(ASM_NASM OPTIONAL)
if(ARCH_X86_64 AND CMAKE_ASM_NASM_COMPILER)
set(HAVE_EC_64 TRUE)
endif()
elseif(USE_EC_64)
enable_language(ASM_NASM)
if(NOT CMAKE_ASM_NASM_COMPILER_LOADED)
message(FATAL_ERROR "Could not load NASM compiler.")
endif()
set(HAVE_EC_64 TRUE)
endif()

if(HAVE_EC_64)
message(STATUS "Using 64bit elliptic curve implementation for x68_64")
add_definitions("-DHAVE_EC_64")
endif()

### ELLIPTIC CURVE
################################################################################

function (die msg)
if (NOT WIN32)
string(ASCII 27 Esc)
Expand Down Expand Up @@ -248,7 +307,7 @@ endif()
# elseif(CMAKE_SYSTEM_NAME MATCHES ".*BSDI.*")
# set(BSDI TRUE)

include_directories(external/rapidjson/include external/easylogging++ src contrib/epee/include external)
include_directories(external/rapidjson/include src contrib/epee/include external)

if(APPLE)
include_directories(SYSTEM /usr/include/malloc)
Expand Down Expand Up @@ -369,10 +428,6 @@ add_definitions("-DBLOCKCHAIN_DB=${BLOCKCHAIN_DB}")
if (APPLE)
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 AND STATIC)
set(DEFAULT_STACK_TRACE OFF)
set(LIBUNWIND_LIBRARIES "")
Expand Down Expand Up @@ -430,8 +485,6 @@ 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)

# Generate header for embedded translations
include(ExternalProject)
ExternalProject_Add(generate_translations_header
Expand All @@ -446,10 +499,6 @@ add_subdirectory(external)
include_directories(${UNBOUND_INCLUDE})
link_directories(${UNBOUND_LIBRARY_DIRS})

# Final setup for easylogging++
include_directories(${EASYLOGGING_INCLUDE})
link_directories(${EASYLOGGING_LIBRARY_DIRS})

# Final setup for liblmdb
include_directories(${LMDB_INCLUDE})

Expand Down Expand Up @@ -621,8 +670,8 @@ else()
message(STATUS "AES support disabled")
endif()

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 -D_GNU_SOURCE ${MINGW_FLAG} ${STATIC_ASSERT_FLAG} ${WARNINGS} ${C_WARNINGS} ${ARCH_FLAG} ${COVERAGE_FLAGS} ${PIC_FLAG} ${C_SECURITY_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -D_GNU_SOURCE ${MINGW_FLAG} ${STATIC_ASSERT_CPP_FLAG} ${WARNINGS} ${CXX_WARNINGS} ${ARCH_FLAG} ${COVERAGE_FLAGS} ${PIC_FLAG} ${CXX_SECURITY_FLAGS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_GNU_SOURCE ${MINGW_FLAG} ${STATIC_ASSERT_FLAG} ${WARNINGS} ${C_WARNINGS} ${ARCH_FLAG} ${COVERAGE_FLAGS} ${PIC_FLAG} ${C_SECURITY_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GNU_SOURCE ${MINGW_FLAG} ${STATIC_ASSERT_CPP_FLAG} ${WARNINGS} ${CXX_WARNINGS} ${ARCH_FLAG} ${COVERAGE_FLAGS} ${PIC_FLAG} ${CXX_SECURITY_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LD_SECURITY_FLAGS}")

# With GCC 6.1.1 the compiled binary malfunctions due to aliasing. Until that
Expand Down Expand Up @@ -786,6 +835,11 @@ if (${BOOST_IGNORE_SYSTEM_PATHS} STREQUAL "ON")
endif()

set(OLD_LIB_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})

if(MINGW)
set(Boost_NO_BOOST_CMAKE ON)
endif()

if(STATIC)
if(MINGW)
set(CMAKE_FIND_LIBRARY_SUFFIXES .a)
Expand All @@ -801,7 +855,7 @@ 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 106200 AND NOT (OPENSSL_VERSION VERSION_LESS 1.1))
if (Boost_VERSION VERSION_LESS 1.62.0 AND NOT (OPENSSL_VERSION VERSION_LESS 1.1))
message(FATAL_ERROR "Boost older than 1.62 is too old to link with OpenSSL 1.1 or newer. "
"Update Boost or install OpenSSL 1.0 and set path to it when running cmake: "
"cmake -DOPENSSL_ROOT_DIR='/usr/include/openssl-1.0;/usr/lib/openssl-1.0'")
Expand Down
2 changes: 1 addition & 1 deletion Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ DOXYFILE_ENCODING = UTF-8
# title of most generated pages and in a few other places.
# The default value is: My Project.

PROJECT_NAME = "Monero"
PROJECT_NAME = "Ryo"

# 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
Expand Down
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2018, Ryo Currency Project
Copyright (c) 2019, Ryo Currency Project

Portions of this software are available under BSD-3 license. Please see ORIGINAL-LICENSE for details

Expand Down Expand Up @@ -30,7 +30,7 @@ As long as the following conditions are met:
Authors and copyright holders agree that:

8. This licence expires and the work covered by it is released into the
public domain on 1st of February 2019
public domain on 1st of February 2020

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
Expand Down
Loading

0 comments on commit 9376655

Please sign in to comment.