Skip to content

Commit 1244880

Browse files
committed
fix compile
1 parent 66a7b0c commit 1244880

File tree

8 files changed

+43
-36
lines changed

8 files changed

+43
-36
lines changed

CMakeLists.txt

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ if(UNIX) # Darwing or Linux
1919

2020
find_package(Boost REQUIRED COMPONENTS system thread log program_options chrono)
2121
find_package(Threads REQUIRED)
22+
find_package(absl REQUIRED)
23+
2224

2325
# cpprest
2426
find_path(CPPREST_INCLUDE_DIR NAMES cpprest/http_client.h cpprest/http_msg.h)
@@ -57,7 +59,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
5759

5860
message("-- configuring clang options")
5961
# set(CMAKE_CXX_FLAGS "-arch x86_64 -std=c++11 -stdlib=libc++ -DBOOST_LOG_DYN_LINK -Wno-deprecated-declarations")
60-
set(CMAKE_CXX_FLAGS "-arch arm64 -std=c++11 -stdlib=libc++ -DBOOST_LOG_DYN_LINK -Wno-deprecated-declarations")
62+
set(CMAKE_CXX_FLAGS "-arch arm64 -std=c++14 -stdlib=libc++ -DBOOST_LOG_DYN_LINK -Wno-deprecated-declarations")
6163

6264
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
6365

@@ -74,18 +76,17 @@ add_library(${PROJECT_NAME} cpprest/ ${MY_SOURCE_FILES})
7476

7577
# headers search paths ...
7678
#set(HEADER_SEARCH_PATHS ${CPPREST_INCLUDE_DIR} ${Boost_INCLUDE_DIR} ${OPENSSL_INCLUDE_DIR})
77-
set(HEADER_SEARCH_PATHS ${Boost_INCLUDE_DIR} ${OPENSSL_INCLUDE_DIR})
79+
set(HEADER_SEARCH_PATHS ${Boost_INCLUDE_DIR} ${OPENSSL_INCLUDE_DIR} ${Protobuf_INCLUDE_DIRS})
7880

7981
# library search paths ...
80-
if(APPLE)
81-
set(OPENSSL_LIBS "${OPENSSL_LIBRARIES}")
82+
#if(APPLE)
83+
set(OPENSSL_LIBS "${OPENSSL_LIBRARIES}")
8284
# set(ZIP_LIBRARY ZLIB::ZLIB)
83-
84-
set(LIBRARIES_SEARCH_PATHS ${OPENSSL_LIBS} ${Boost_LIBRARIES} ${CPPREST_LIBRARY} ${ZIP_LIBRARY})
85-
else()
86-
set(OPENSSL_LIBS "${OPENSSL_LIBRARIES}")
87-
set(LIBRARIES_SEARCH_PATHS ${CPPREST_LIBRARY} ${OPENSSL_LIBS} ${Boost_LIBRARIES} ${ZIP_LIBRARY})
88-
endif()
85+
set(LIBRARIES_SEARCH_PATHS ${OPENSSL_LIBS} ${Boost_LIBRARIES} ${CPPREST_LIBRARY} ${ZIP_LIBRARY} ${Protobuf_LIBRARIES})
86+
#else()
87+
# set(OPENSSL_LIBS "${OPENSSL_LIBRARIES}")
88+
# set(LIBRARIES_SEARCH_PATHS ${CPPREST_LIBRARY} ${OPENSSL_LIBS} ${Boost_LIBRARIES} ${ZIP_LIBRARY})
89+
#endif()
8990

9091
message(BOOST_LIBS " ${Boost_LIBRARIES}")
9192
message(OPENSSL_LIBS " ${OPENSSL_LIBRARIES}")
@@ -99,6 +100,11 @@ if (APPLE)
99100
target_link_libraries(${PROJECT_NAME} "-framework Security")
100101
target_link_libraries(${PROJECT_NAME} ${LIBRARIES_SEARCH_PATHS})
101102
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-W1, -F/Library/Frameworks ")
103+
target_link_libraries(${PROJECT_NAME}
104+
absl::base
105+
absl::utility
106+
protobuf::libprotobuf
107+
)
102108
else()
103109
target_link_libraries(${PROJECT_NAME} ${LIBRARIES_SEARCH_PATHS})
104110
target_link_libraries(${PROJECT_NAME} OpenSSL::SSL OpenSSL::Crypto)

include/tigerapi/enums.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#include <string>
99
#include <map>
10+
#include "cpprest/details/basic_types.h"
1011

1112
// Quote level prefixes
1213
const std::string HK_QUOTE_LEVEL_PREFIX = "hk";

include/tigerapi/push_client.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
#define PUSH_CLIENT_H
33
#include <memory>
44
#include <functional>
5-
#include "tigerapi/win32.h"
6-
#include "openapi_pb/pb_source/AssetData.pb.h"
7-
#include "openapi_pb/pb_source/PositionData.pb.h"
8-
#include "openapi_pb/pb_source/OrderStatusData.pb.h"
9-
#include "openapi_pb/pb_source/QuoteData.pb.h"
10-
#include "openapi_pb/pb_source/KlineData.pb.h"
11-
#include "openapi_pb/pb_source/TickData.pb.h"
12-
#include "openapi_pb/pb_source/StockTopData.pb.h"
13-
#include "openapi_pb/pb_source/OptionTopData.pb.h"
14-
#include "openapi_pb/pb_source/QuoteDepthData.pb.h"
5+
#include "../include/tigerapi/win32.h"
6+
#include "../include/openapi_pb/pb_source/AssetData.pb.h"
7+
#include "../include/openapi_pb/pb_source/PositionData.pb.h"
8+
#include "../include/openapi_pb/pb_source/OrderStatusData.pb.h"
9+
#include "../include/openapi_pb/pb_source/QuoteData.pb.h"
10+
#include "../include/openapi_pb/pb_source/KlineData.pb.h"
11+
#include "../include/openapi_pb/pb_source/TickData.pb.h"
12+
#include "../include/openapi_pb/pb_source/StockTopData.pb.h"
13+
#include "../include/openapi_pb/pb_source/OptionTopData.pb.h"
14+
#include "../include/openapi_pb/pb_source/QuoteDepthData.pb.h"
1515

1616

1717
namespace TIGER_API

include/tigerapi/push_socket/push_client_impl.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
#define PUSH_CLIENT_IMPL_H
33

44
#include "boost/asio/io_service.hpp"
5-
#include "tigerapi/push_client.h"
6-
#include "tigerapi/client_config.h"
7-
#include "openapi_pb/pb_source/Request.pb.h"
8-
#include "openapi_pb/pb_source/Response.pb.h"
5+
#include "../include/tigerapi/push_client.h"
6+
#include "../include/tigerapi/client_config.h"
7+
#include "../include/openapi_pb/pb_source/Request.pb.h"
8+
#include "../include/openapi_pb/pb_source/Response.pb.h"
99

1010
namespace TIGER_API
1111
{

include/tigerapi/push_socket/push_socket.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
#include "boost/pool/pool.hpp"
1212
#include "boost/optional.hpp"
1313

14-
#include "tigerapi/client_config.h"
15-
#include "push_frame_serialize.h"
16-
#include "openapi_pb/pb_source/Request.pb.h"
17-
#include "openapi_pb/pb_source/Response.pb.h"
14+
#include "../include/tigerapi/client_config.h"
15+
#include "../include/tigerapi/push_socket/push_frame_serialize.h"
16+
#include "../include/openapi_pb/pb_source/Request.pb.h"
17+
#include "../include/openapi_pb/pb_source/Response.pb.h"
1818

1919
namespace TIGER_API
2020
{

src/push_socket/push_client_impl.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
#include "tigerapi/push_socket/push_client_impl.h"
2-
#include "tigerapi/client_config.h"
3-
#include "tigerapi/push_socket/push_socket.h"
4-
#include "tigerapi/tick_util.h"
5-
#include "openapi_pb\pb_source\PushData.pb.h"
1+
#include "../include/tigerapi/push_socket/push_client_impl.h"
2+
#include "../include/tigerapi/client_config.h"
3+
#include "../include/tigerapi/push_socket/push_socket.h"
4+
#include "../include/tigerapi/tick_util.h"
5+
#include "../include/openapi_pb/pb_source/PushData.pb.h"
66
#include "google/protobuf/util/json_util.h"
77
#include <vector>
88
#include <memory>

src/push_socket/push_frame_serialize.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "tigerapi/push_socket/push_frame_serialize.h"
1+
#include "../include/tigerapi/push_socket/push_frame_serialize.h"
22

33
std::vector<unsigned char> TIGER_API::PushFrameEncoder::encode_frame(const std::string& packed_frame)
44
{

src/push_socket/push_socket.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#include "tigerapi/push_socket/push_socket.h"
2-
#include "tigerapi/version.h"
1+
#include "../include/tigerapi/push_socket/push_socket.h"
2+
#include "../include/tigerapi/version.h"
33
#include <bitset>
44
#include <regex>
55
#include "google/protobuf/util/json_util.h"

0 commit comments

Comments
 (0)