forked from vmware/concord-bft
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
108 lines (93 loc) · 3.37 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
cmake_minimum_required(VERSION 3.24)
project(concord-bft VERSION 0.1.0.0 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# targets with generic names like "format" may already exist in an imported libs
cmake_policy(SET CMP0002 OLD)
set(ALLOW_DUPLICATE_CUSTOM_TARGETS TRUE)
set(MIN_BOOST_VERSION 1.80)
set(YAML_CPP_VERSION 0.7.0)
# Defaults to debug builds
# Release builds can be enabled by running cmake with -DCMAKE_BUILD_TYPE=Release
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Enable debug or release builds" FORCE)
endif()
option(USE_LOG4CPP "Enable LOG4CPP" ON)
option(RUN_APOLLO_TESTS "Enable Apollo tests run" ON)
option(KEEP_APOLLO_LOGS "Retains logs from replicas in separate folder for each test in build/tests/apollo/logs" ON)
option(TXN_SIGNING_ENABLED "Enable External concord client transcattion signing" ON)
# Rocksdb is required for storage now. Consider removing this flag.
option(BUILD_ROCKSDB_STORAGE "Enable building of RocksDB storage library" ON)
option(USE_S3_OBJECT_STORE "Enable S3 Object Store" ON)
option(BUILD_SLOWDOWN "Build Slowdown framework" OFF)
option(USE_FAKE_CLOCK_IN_TIME_SERVICE "BUILD TimeService Using Fake Clock" OFF)
option(USE_OPENTRACING "Enable OpenTracing" ON)
option(USE_PROMETHEUS "Enable Prometheus" ON)
option(USE_JAEGER "Enable Jaeger" ON)
option(USE_JSON "Enable use of JSON library" ON)
option(USE_HTTPLIB "Enable use of httplib" ON)
option(USE_GRPC "Enable GRPC and Protobuf" ON)
option(USE_OPENSSL "Enable use of OpenSSL" ON)
option(BUILD_THIRDPARTY "Whether to build third party libraries or use preinstalled ones" OFF)
option(ENABLE_RESTART_RECOVERY_TESTS "Enable tests for restart recovery" OFF)
option(BUILD_UTT "Build UTT library" ON)
option(BUILD_SHARED_LIBS "whether to create shared libraires" OFF)
if((USE_OPENSSL) AND NOT BUILD_THIRDPARTY)
set(OPENSSL_ROOT_DIR /usr/local/ssl) # not to confuse with system ssl libs
endif()
# include compiler specific options
include(cmake/${CMAKE_CXX_COMPILER_ID}.cmake)
include(cmake/cppcheck.cmake)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
include(cmake/grpc_utils.cmake)
include(CTest)
if(USE_S3_OBJECT_STORE)
add_compile_definitions(USE_S3_OBJECT_STORE=1)
endif()
#
# Subdirectories
#
# TODO [TK] uncomment when dependencies are compiled by this CMake
#set (CMAKE_FIND_USE_CMAKE_SYSTEM_PATH FALSE)
if(BUILD_THIRDPARTY)
include(thirdparty/CMakeLists.txt)
endif()
#link all libraries against logging by default
add_subdirectory(libs/log)
link_libraries(logging)
add_subdirectory(libs)
add_subdirectory(kvbc)
add_subdirectory(performance)
add_subdirectory(bftengine)
add_subdirectory(tools)
add_subdirectory(storage)
add_subdirectory(scripts)
add_subdirectory(client)
if(USE_GRPC)
add_subdirectory(thin-replica-server)
endif()
add_subdirectory(ccron)
if (BUILD_UTT)
add_subdirectory(utt)
add_subdirectory(utt-replica)
endif()
#
# Setup testing
#
if(BUILD_TESTING)
option(OMIT_TEST_OUTPUT "Forwards output stdout and stdin to /dev/null" OFF)
if(OMIT_TEST_OUTPUT)
message("-- OMIT_TEST_OUTPUT Enabled")
endif()
if(KEEP_APOLLO_LOGS)
message("-- KEEP_APOLLO_LOGS Enabled")
endif()
if(RUN_APOLLO_TESTS)
message("-- RUN_APOLLO_TESTS Enabled")
endif()
add_subdirectory(bftengine/tests)
add_subdirectory(tests)
add_subdirectory(messages)
add_subdirectory(examples)
endif()