Skip to content
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.

Commit

Permalink
NO-KEP Fix mac build
Browse files Browse the repository at this point in the history
  • Loading branch information
ebruck committed Sep 26, 2018
1 parent ea7382b commit 204b45e
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -41,7 +41,7 @@ matrix:
- os: osx
osx_image: xcode10
env:
- MATRIX_EVAL="brew update && brew unlink python && brew install protobuf && brew install snappy && brew install openssl && brew install cmake"
- MATRIX_EVAL="brew update && brew unlink python && brew install protobuf && brew install snappy && brew install lz4 && brew install openssl && brew install cmake"
- CMAKE_URL="https://cmake.org/files/v3.12/cmake-3.12.1-Darwin-x86_64.tar.gz"
- CMAKE_COMMAND="cmake -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl"

Expand Down
4 changes: 4 additions & 0 deletions CMakeLists.txt
Expand Up @@ -41,6 +41,10 @@ set(CMAKE_C_FLAGS ${warnings})
# find packages
include(cmake/add_gmock_test.cmake)

include(FindProtobuf)
find_package(Protobuf REQUIRED)
include_directories(SYSTEM ${PROTOBUF_INCLUDE_DIR})

set(REQUIRED_BOOST "1.68.0")
set(Boost_USE_STATIC_LIBS on)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -40,7 +40,7 @@ This will result in a custom Boost install at `~/myboost/1_68_0/`that will not c
**Other dependencies \(Protobuf, CMake\)**

```text
$ brew update && brew install protobuf && brew install snappy && brew upgrade cmake
$ brew update && brew install protobuf && brew install snappy && brew install lz4 && brew upgrade cmake
```

**ccache \(Optional\)**
Expand Down
2 changes: 1 addition & 1 deletion audit/test/CMakeLists.txt
@@ -1,4 +1,4 @@
set(test_srcs audit_test.cpp)
set(test_libs audit proto protobuf.a)
set(test_libs audit proto ${Protobuf_LIBRARIES})

add_gmock_test(audit)
12 changes: 12 additions & 0 deletions cmake/rocksdb.cmake
Expand Up @@ -86,3 +86,15 @@ ExternalProject_Get_Property(rocksdb binary_dir)
link_directories(${binary_dir}/)

set(ROCKSDB_LIBRARIES ${binary_dir}/librocksdb.a ${SNAPPY_LIBRARIES} ${ZLIB_LIBRARIES} ${BZIP2_LIBRARIES})

if (APPLE)
find_library(LZ4_LIBRARY NAMES liblz4.a)
message(STATUS ${LZ4_LIBRARY})
list(APPEND ROCKSDB_LIBRARIES ${LZ4_LIBRARY})

# rocksdb may of found this library?
find_library(ZSTD_LIBRARY NAMES libzstd.a)
if (ZSTD_LIBRARY)
list(APPEND ROCKSDB_LIBRARIES ${ZSTD_LIBRARY})
endif()
endif()
2 changes: 1 addition & 1 deletion crud/test/CMakeLists.txt
@@ -1,4 +1,4 @@
set(test_srcs crud_test.cpp subscription_manager_test.cpp)
set(test_libs crud node storage bootstrap raft proto protobuf.a)
set(test_libs crud node storage bootstrap raft proto ${Protobuf_LIBRARIES})

add_gmock_test(crud)
2 changes: 1 addition & 1 deletion http/test/CMakeLists.txt
@@ -1,4 +1,4 @@
set(test_srcs server_test.cpp connection_test.cpp)
set(test_libs http proto protobuf.a)
set(test_libs http proto ${Protobuf_LIBRARIES})

add_gmock_test(http)
2 changes: 1 addition & 1 deletion node/test/CMakeLists.txt
@@ -1,4 +1,4 @@
set(test_srcs node_test.cpp session_test.cpp)
set(test_libs node proto protobuf.a)
set(test_libs node proto ${Protobuf_LIBRARIES})

add_gmock_test(node)
2 changes: 1 addition & 1 deletion pbft/test/CMakeLists.txt
@@ -1,5 +1,5 @@
set(test_srcs pbft_test.cpp pbft_operation_test.cpp pbft_failure_detector_test.cpp pbft_audit_test.cpp pbft_test_common.cpp pbft_checkpoint_tests.cpp)
set(test_libs pbft protobuf.a bootstrap)
set(test_libs pbft ${Protobuf_LIBRARIES} bootstrap)

add_gmock_test(pbft)

3 changes: 0 additions & 3 deletions proto/CMakeLists.txt
@@ -1,6 +1,3 @@
include(FindProtobuf)
find_package(Protobuf REQUIRED)
include_directories(${PROTOBUF_INCLUDE_DIR})
protobuf_generate_cpp(PROTO_SRC PROTO_HEADER bluzelle.proto database.proto pbft.proto audit.proto)
add_library(proto ${PROTO_HEADER} ${PROTO_SRC})
set_target_properties(proto PROPERTIES COMPILE_FLAGS "-Wno-unused")
Expand Down
2 changes: 1 addition & 1 deletion raft/test/CMakeLists.txt
@@ -1,4 +1,4 @@
set(test_srcs raft_test.cpp raft_log_test.cpp)
set(test_libs raft storage bootstrap proto protobuf)
set(test_libs raft storage bootstrap proto ${Protobuf_LIBRARIES})

add_gmock_test(raft)
6 changes: 3 additions & 3 deletions swarm/CMakeLists.txt
@@ -1,4 +1,4 @@
add_executable(swarm main.cpp)
add_dependencies(swarm jsoncpp) # rocksdb
target_include_directories(swarm PRIVATE ${JSONCPP_INCLUDE_DIRS})
target_link_libraries(swarm node http raft pbft audit crud options ethereum bootstrap storage proto protobuf.a status ${Boost_LIBRARIES} ${JSONCPP_LIBRARIES} pthread)
add_dependencies(swarm jsoncpp rocksdb)
target_include_directories(swarm PRIVATE ${JSONCPP_INCLUDE_DIRS} ${ROCKSDB_INCLUDE_DIRS})
target_link_libraries(swarm node http raft pbft audit crud options ethereum bootstrap storage proto ${Protobuf_LIBRARIES} status ${ROCKSDB_LIBRARIES} ${Boost_LIBRARIES} ${JSONCPP_LIBRARIES} pthread)

0 comments on commit 204b45e

Please sign in to comment.