forked from pyth-network/pyth-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
109 lines (93 loc) · 2.62 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
cmake_minimum_required( VERSION 3.13 )
# project pyth-client
project( pyth-client )
# default build convention
if( NOT CMAKE_BUILD_TYPE )
set( CMAKE_BUILD_TYPE Release )
endif()
# use root directory as include
set( CMAKE_INCLUDE_CURRENT_DIR ON )
# find oracle header files
include_directories( program/src/ )
# gcc compiler/linker flags
add_compile_options( -ggdb -Wall -Wextra -Werror -std=c++11 -m64 )
set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread")
#
# pyth client API library
#
set( PC_SRC
pc/attr_id.cpp;
pc/capture.cpp;
pc/key_pair.cpp;
pc/key_store.cpp;
pc/jtree.cpp;
pc/log.cpp;
pc/manager.cpp;
pc/mem_map.cpp;
pc/misc.cpp;
pc/net_socket.cpp;
pc/pub_stats.cpp;
pc/replay.cpp;
pc/request.cpp;
pc/rpc_client.cpp;
pc/user.cpp;
)
set( PC_HDR
pc/attr_id.hpp;
pc/capture.hpp;
pc/dbl_list.hpp;
pc/error.hpp;
pc/jtree.hpp;
pc/key_pair.hpp;
pc/key_store.hpp;
pc/hash_map.hpp;
pc/log.hpp;
pc/manager.hpp;
pc/mem_map.hpp;
pc/misc.hpp;
pc/net_socket.hpp;
pc/replay.hpp;
pc/request.hpp;
pc/rpc_client.hpp
pc/user.hpp )
add_library( pc STATIC ${PC_SRC} )
# dependencies
set( PC_DEP pc ssl crypto z zstd )
#
# applications
#
add_executable( pythd pcapps/pythd.cpp )
target_link_libraries( pythd ${PC_DEP} )
add_executable( pyth pcapps/pyth.cpp )
target_link_libraries( pyth ${PC_DEP} )
add_executable( pyth_admin pcapps/admin_rpc_client.cpp pcapps/admin_request.cpp pcapps/pyth_admin.cpp )
target_link_libraries( pyth_admin ${PC_DEP} )
add_executable( pyth_csv pcapps/pyth_csv.cpp )
target_link_libraries( pyth_csv ${PC_DEP} )
add_executable( pyth_tx pcapps/tx_rpc_client.cpp pcapps/tx_svr.cpp pcapps/pyth_tx.cpp )
target_link_libraries( pyth_tx ${PC_DEP} )
#
# install
#
install( TARGETS pc DESTINATION lib )
install( TARGETS pyth pyth_admin pythd pyth_csv pyth_tx DESTINATION bin )
install( FILES ${PC_HDR} DESTINATION include/pc )
install( FILES program/src/oracle/oracle.h DESTINATION include/oracle )
#
# test programs
#
enable_testing()
add_executable( test_unit pctest/test_unit.cpp )
target_link_libraries( test_unit ${PC_DEP} )
add_executable( test_net pctest/test_net.cpp )
target_link_libraries( test_net ${PC_DEP} )
add_executable( test_publish pctest/test_publish.cpp )
target_link_libraries( test_publish ${PC_DEP} )
add_executable( test_qset pctest/test_qset.cpp )
target_link_libraries( test_qset ${PC_DEP} )
add_executable( test_twap pctest/test_twap.cpp )
target_link_libraries( test_twap ${PC_DEP} )
add_executable( leader_stats pctest/leader_stats.cpp )
target_link_libraries( leader_stats ${PC_DEP} )
add_test( test_unit test_unit )
add_test( test_net test_net )