-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
131 lines (96 loc) · 3 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
cmake_minimum_required(VERSION 3.1.0)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/extras/divvy-libpp/extras/divvyd/Builds/CMake")
include(CMakeFuncs)
set(openssl_min 1.0.1)
parse_target()
if (nonunity)
set(target "" CACHE STRING "Build target. Nounity not supported" FORCE)
message(FATAL_ERROR "Nonunity builds not supported")
endif()
setup_build_cache()
project(validator-keys)
############################################################
determine_build_type()
check_gcc4_abi()
############################################################
include_directories(
src/
SYSTEM
extras/divvy-libpp/extras/divvyd/src
extras/divvy-libpp/extras/divvyd/src/beast/include
extras/divvy-libpp/extras/divvyd/src/beast/extras)
special_build_flags()
############################################################
use_boost(
filesystem
program_options
regex
system
thread)
use_pthread()
use_openssl(${openssl_min})
setup_build_boilerplate()
############################################################
add_with_props(lib_src extras/divvy-libpp/src/unity/divvy-libpp.cpp
-I"${CMAKE_SOURCE_DIR}/"extras/divvy-libpp/extras/divvyd/src/secp256k1
${no_unused_w}
)
add_with_props(lib_src extras/divvy-libpp/extras/divvyd/src/divvy/unity/ed25519_donna.c
-I"${CMAKE_SOURCE_DIR}/"extras/divvy-libpp/extras/divvyd/src/ed25519-donna)
############################################################
prepend(app_src
src/
ValidatorKeys.cpp
ValidatorKeysTool.cpp
test/ValidatorKeys_test.cpp
test/ValidatorKeysTool_test.cpp)
############################################################
if (WIN32 OR is_xcode)
# Divvyd sources
foreach(curdir
beast/core
beast/hash
beast/utility
basics
core
crypto
json
protocol)
file(GLOB_RECURSE cursrcs extras/divvy-libpp/extras/divvyd/src/divvy/${curdir}/*.h
extras/divvy-libpp/extras/divvyd/src/divvy/${curdir}/*.cpp)
list(APPEND divvyd_src "${cursrcs}")
list(APPEND non_unity_srcs "${cursrcs}")
endforeach()
file(GLOB_RECURSE all_headers src/*.hpp extras/*.hpp src/*.h extras/*.h)
list(APPEND divvyd_src "${all_headers}")
# Properties
set_property(
SOURCE ${non_unity_srcs}
APPEND
PROPERTY HEADER_FILE_ONLY
true)
set_property(
SOURCE ${all_headers}
APPEND
PROPERTY HEADER_FILE_ONLY
true)
# Doesn't work
# $<OR:$<CONFIG:Debug>,$<CONFIG:Release>>)
endif()
############################################################
if (NOT is_msvc)
set(no_unused_w -Wno-unused-function)
else()
unset(no_unused_w)
endif()
############################################################
if (WIN32 OR is_xcode)
group_sources(src)
group_sources(extras/divvy-libpp/extras/divvyd/src)
endif()
add_library(divvylibpp OBJECT ${lib_src} ${divvyd_src})
add_executable(validator-keys ${app_src} $<TARGET_OBJECTS:divvylibpp> ${divvyd_src})
set_startup_project(validator-keys)
target_link_libraries(validator-keys
${OPENSSL_LIBRARIES} ${SANITIZER_LIBRARIES})
link_common_libraries(validator-keys)