Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Merge pull request #100 from mitza-oci/master
Browse files Browse the repository at this point in the history
Build on Travis CI
  • Loading branch information
bytemaster authored Jul 28, 2017
2 parents b434f23 + 49b7eef commit 6ebcbc3
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 17 deletions.
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
*.a
*.sw*
*.cmake
*.dylib
*.ll
*.bc
Expand All @@ -12,6 +11,7 @@

CMakeCache.txt
CMakeFiles
cmake_install.cmake
Makefile
compile_commands.json
moc_*
Expand All @@ -32,11 +32,17 @@ libraries/wallet/Doxyfile
libraries/wallet/api_documentation.cpp
libraries/wallet/doxygen

libraries/wasm-jit/Source/Programs/Assemble
libraries/wasm-jit/Source/Programs/Disassemble
libraries/wasm-jit/Source/Programs/Test
libraries/wasm-jit/Source/Programs/wavm

programs/cli_wallet/cli_wallet
programs/js_operation_serializer/js_operation_serializer
programs/witness_node/witness_node
programs/data-dir
programs/eosd/eosd
programs/eosc/eosc

tests/app_test
tests/chain_bench
Expand Down
28 changes: 28 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
sudo: false
dist: trusty
language: cpp
compiler: clang
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-4.0
packages:
- llvm-4.0-dev
- clang-4.0
- g++-6
- ninja-build
before_install:
- mkdir ext && cd ext
- wget https://dl.bintray.com/boostorg/release/1.64.0/source/boost_1_64_0.tar.bz2 && tar xjf boost_1_64_0.tar.bz2
- "cd boost_1_64_0 && ./bootstrap.sh --prefix=$TRAVIS_BUILD_DIR/ext && echo 'using clang : 4.0 : clang++-4.0 ;' >> project-config.jam && ./b2 -d0 -j4 --with-thread --with-date_time --with-system --with-filesystem --with-program_options --with-signals --with-serialization --with-chrono --with-test --with-context --with-locale --with-coroutine toolset=clang link=static install"
- cd $TRAVIS_BUILD_DIR/ext && git clone --depth=1 --single-branch git://github.com/cryptonomex/secp256k1-zkp
- cd secp256k1-zkp && ./autogen.sh && ./configure --prefix=$TRAVIS_BUILD_DIR/ext CC=clang-4.0 CXX=clang++-4.0 && make && make install
- cd $TRAVIS_BUILD_DIR/ext && wget https://cmake.org/files/v3.9/cmake-3.9.0-Linux-x86_64.tar.gz && tar xzf cmake-3.9.0-Linux-x86_64.tar.gz
- cd $TRAVIS_BUILD_DIR/ext && git clone --depth=1 --single-branch git://github.com/oci-labs/clang-WebAssembly wasm-compiler
- cd $TRAVIS_BUILD_DIR
script:
- WASM_LLVM_CONFIG=$TRAVIS_BUILD_DIR/ext/wasm-compiler/bin/llvm-config ext/cmake-3.9.0-Linux-x86_64/bin/cmake -G Ninja -DCMAKE_CXX_COMPILER=clang++-4.0 -DCMAKE_C_COMPILER=clang-4.0 -DBOOST_ROOT=$TRAVIS_BUILD_DIR/ext -DSecp256k1_ROOT_DIR=$TRAVIS_BUILD_DIR/ext
- ninja -j4
- tests/chain_test
- tests/slow_test
20 changes: 5 additions & 15 deletions libraries/fc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,20 @@ SET( CMAKE_DEBUG_POSTFIX _debug )
SET( BUILD_SHARED_LIBS NO )
SET( ECC_IMPL secp256k1 CACHE STRING "secp256k1 or openssl or mixed" )


IF(NOT "$ENV{SECP256K1_ROOT_DIR}" STREQUAL "")
set(SECP256K1_ROOT_DIR $ENV{SECP256K1_ROOT_DIR} )
set(SECP256K1_INCLUDE_DIR ${SECP256K1_ROOT_DIR}/include)
ELSE()
SET( SECP256K1_INCLUDE_DIR /usr/local/include )
SET( SECP256K1_ROOT_DIR /usr/local )
ENDIF()

message(STATUS "Setting up SECP256K1 root and include vars to ${SECP256K1_ROOT_DIR}, ${SECP256K1_INCLUDE_DIR}")

set(platformBitness 32)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(platformBitness 64)
endif()

SET (ORIGINAL_LIB_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})

find_package(Secp256k1 REQUIRED)
find_package(GMP REQUIRED)

IF( ECC_IMPL STREQUAL openssl )
SET( ECC_REST src/crypto/elliptic_impl_pub.cpp )
ELSE( ECC_IMPL STREQUAL openssl )
SET( ECC_LIB secp256k1 )
SET( ECC_LIB ${Secp256k1_LIBRARY} ${GMP_LIBRARIES} )
IF( ECC_IMPL STREQUAL mixed )
SET( ECC_REST src/crypto/elliptic_impl_priv.cpp src/crypto/elliptic_impl_pub.cpp )
ELSE( ECC_IMPL STREQUAL mixed )
Expand All @@ -57,8 +49,6 @@ ENDIF()

find_package(OpenSSL REQUIRED)

find_package(Secp256k1 REQUIRED)

set( CMAKE_FIND_LIBRARY_SUFFIXES ${ORIGINAL_LIB_SUFFIXES} )

set( fc_sources
Expand Down Expand Up @@ -158,7 +148,7 @@ target_include_directories(fc
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include
${Boost_INCLUDE_DIR}
${OPENSSL_INCLUDE_DIR}
${SECP256K1_INCLUDE_DIR}
${Secp256k1_INCLUDE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/vendor/websocketpp

PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
Expand Down
52 changes: 52 additions & 0 deletions libraries/fc/CMakeModules/FindGMP.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# This module defines:
# GMP_FOUND - system has GMP lib
# GMP_INCLUDE_DIR - the GMP include directory
# GMP_LIBRARIES_DIR - directory where the GMP libraries are located
# GMP_LIBRARIES - Link these to use GMP
# GMP_IN_CGAL_AUXILIARY - TRUE if the GMP found is the one distributed with CGAL in the auxiliary folder

include(FindPackageHandleStandardArgs)

if(GMP_INCLUDE_DIR)
set(GMP_in_cache TRUE)
else()
set(GMP_in_cache FALSE)
endif()
if(NOT GMP_LIBRARIES)
set(GMP_in_cache FALSE)
endif()

# Is it already configured?
if (GMP_in_cache)

set(GMP_FOUND TRUE)

else()

find_path(GMP_INCLUDE_DIR
NAMES gmp.h
HINTS ENV GMP_INC_DIR
ENV GMP_DIR
PATH_SUFFIXES include
DOC "The directory containing the GMP header files"
)

find_library(GMP_LIBRARIES NAMES libgmp.a gmp.lib gmp libgmp-10 mpir
HINTS ENV GMP_LIB_DIR
ENV GMP_DIR
PATH_SUFFIXES lib
DOC "Path to the GMP library"
)

if ( GMP_LIBRARIES )
get_filename_component(GMP_LIBRARIES_DIR ${GMP_LIBRARIES} PATH CACHE )
endif()

# Attempt to load a user-defined configuration for GMP if couldn't be found
if ( NOT GMP_INCLUDE_DIR OR NOT GMP_LIBRARIES_DIR )
include( GMPConfig OPTIONAL )
endif()

find_package_handle_standard_args(GMP "DEFAULT_MSG" GMP_LIBRARIES GMP_INCLUDE_DIR)

endif()
2 changes: 1 addition & 1 deletion libraries/fc/CMakeModules/FindSecp256k1.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ find_path(Secp256k1_INCLUDE_DIR
)

find_library(Secp256k1_LIBRARY
NAMES secp256k1
NAMES libsecp256k1.a secp256k1.lib secp256k1
HINTS ${Secp256k1_ROOT_DIR}/lib
)

Expand Down

0 comments on commit 6ebcbc3

Please sign in to comment.