From 21e5efc7fbdbf599bef37c51ad9f5984368aa2a5 Mon Sep 17 00:00:00 2001 From: Anatoly Kalin Date: Mon, 4 Sep 2023 17:32:22 +0300 Subject: [PATCH] [EN-7412] Implement DXFeedConnect sample --- CMakeLists.txt | 110 ++++++++++++++++-------------------- src/internal/CMakeLists.txt | 52 ----------------- 2 files changed, 48 insertions(+), 114 deletions(-) delete mode 100644 src/internal/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 3dabc7a2..7e4d3200 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -93,50 +93,48 @@ add_subdirectory(third_party/fmt-10.0.0) # find_package(utf8cpp) # find_package(fmt) -#set(dxFeedNativeAPIInternalSources -# src/internal/CEntryPointErrors.cpp -# src/internal/Isolate.cpp -# src/internal/JavaObjectHandler.cpp -# src/internal/EventClassList.cpp -# src/internal/SymbolList.cpp -# src/internal/Common.cpp -#) -# -#set(dxFeedNativeAPIInternalUtilsSources -# src/internal/utils/StringUtils.cpp -# src/internal/utils/EnumUtils.cpp -# src/internal/utils/CmdArgsUtils.cpp -#) -# -#set(dxFeedNativeAPIInternalUtilsDebugSources -# src/internal/utils/debug/Debug.cpp -#) - -add_subdirectory(src/internal) - -set(dxFeedNativeAPIAPISources +set(dxFeedGraalCxxApi_Internal_Sources + src/internal/CEntryPointErrors.cpp + src/internal/Isolate.cpp + src/internal/JavaObjectHandler.cpp + src/internal/EventClassList.cpp + src/internal/SymbolList.cpp + src/internal/Common.cpp +) + +set(dxFeedGraalCxxApi_InternalUtils_Sources + src/internal/utils/StringUtils.cpp + src/internal/utils/EnumUtils.cpp + src/internal/utils/CmdArgsUtils.cpp +) + +set(dxFeedGraalCxxApi_InternalUtilsDebug_Sources + src/internal/utils/debug/Debug.cpp +) + +set(dxFeedGraalCxxApi_API_Sources src/api/DXEndpoint.cpp src/api/DXFeed.cpp src/api/DXFeedSubscription.cpp src/api/DXPublisher.cpp ) -set(dxFeedNativeAPIAPIOsubSources +set(dxFeedGraalCxxApi_APIOsub_Sources src/api/osub/WildcardSymbol.cpp src/api/osub/TimeSeriesSubscriptionSymbol.cpp src/api/osub/IndexedEventSubscriptionSymbol.cpp ) -set(dxFeedNativeAPISymbolsSources +set(dxFeedGraalCxxApi_Symbols_Sources src/symbols/StringSymbol.cpp src/symbols/SymbolWrapper.cpp ) -set(dxFeedNativeAPISystemSources +set(dxFeedGraalCxxApi_System_Sources src/system/System.cpp ) -set(dxFeedNativeAPIEventSources +set(dxFeedGraalCxxApi_Event_Sources src/event/EventTypeEnum.cpp src/event/IndexedEventSource.cpp src/event/EventFlag.cpp @@ -144,7 +142,7 @@ set(dxFeedNativeAPIEventSources src/event/EventMapper.cpp ) -set(dxFeedNativeAPIEventCandleSources +set(dxFeedGraalCxxApi_EventCandle_Sources src/event/candle/Candle.cpp src/event/candle/CandleAlignment.cpp src/event/candle/CandleExchange.cpp @@ -156,7 +154,7 @@ set(dxFeedNativeAPIEventCandleSources src/event/candle/CandleSymbol.cpp ) -set(dxFeedNativeAPIEventMarketSources +set(dxFeedGraalCxxApi_EventMarket_Sources src/event/market/AnalyticOrder.cpp src/event/market/Direction.cpp src/event/market/IcebergType.cpp @@ -182,18 +180,34 @@ set(dxFeedNativeAPIEventMarketSources src/event/market/TradingStatus.cpp ) -set(dxFeedNativeAPIEventOptionSources +set(dxFeedGraalCxxApi_EventOption_Sources src/event/option/Greeks.cpp src/event/option/Underlying.cpp src/event/option/TheoPrice.cpp src/event/option/Series.cpp ) -set(dxFeedNativeAPIScheduleSources +set(dxFeedGraalCxxApi_Schedule_Sources src/schedule/SessionFilter.cpp src/schedule/SessionType.cpp ) +set(dxFeedGraalCxxApi_Sources + ${dxFeedGraalCxxApi_Internal_Sources} + ${dxFeedGraalCxxApi_InternalUtils_Sources} + ${dxFeedGraalCxxApi_InternalUtilsDebug_Sources} + ${dxFeedGraalCxxApi_API_Sources} + ${dxFeedGraalCxxApi_APIOsub_Sources} + ${dxFeedGraalCxxApi_Symbols_Sources} + ${dxFeedGraalCxxApi_System_Sources} + ${dxFeedGraalCxxApi_Event_Sources} + ${dxFeedGraalCxxApi_EventCandle_Sources} + ${dxFeedGraalCxxApi_EventMarket_Sources} + ${dxFeedGraalCxxApi_EventOption_Sources} + ${dxFeedGraalCxxApi_EventOption_Sources} + ${dxFeedGraalCxxApi_Schedule_Sources} +) + if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set(CMAKE_MACOSX_RPATH ON) set(CMAKE_SKIP_BUILD_RPATH ON) @@ -210,40 +224,12 @@ elseif (UNIX) endif () add_library(${PROJECT_NAME}_static STATIC -# ${dxFeedNativeAPIInternalSources} -# ${dxFeedNativeAPIInternalUtilsSources} -# ${dxFeedNativeAPIInternalUtilsDebugSources} - -# $ - - ${dxFeedNativeAPIAPISources} - ${dxFeedNativeAPIAPIOsubSources} - ${dxFeedNativeAPISymbolsSources} - ${dxFeedNativeAPISystemSources} - ${dxFeedNativeAPIEventSources} - ${dxFeedNativeAPIEventCandleSources} - ${dxFeedNativeAPIEventMarketSources} - ${dxFeedNativeAPIEventOptionSources} - ${dxFeedNativeAPIScheduleSources} + ${dxFeedGraalCxxApi_Sources} src/api.cpp ) add_library(${PROJECT_NAME} SHARED -# ${dxFeedNativeAPIInternalSources} -# ${dxFeedNativeAPIInternalUtilsSources} -# ${dxFeedNativeAPIInternalUtilsDebugSources} - -# $ - - ${dxFeedNativeAPIAPISources} - ${dxFeedNativeAPIAPIOsubSources} - ${dxFeedNativeAPISymbolsSources} - ${dxFeedNativeAPISystemSources} - ${dxFeedNativeAPIEventSources} - ${dxFeedNativeAPIEventCandleSources} - ${dxFeedNativeAPIEventMarketSources} - ${dxFeedNativeAPIEventOptionSources} - ${dxFeedNativeAPIScheduleSources} + ${dxFeedGraalCxxApi_Sources} src/api.cpp ) @@ -313,8 +299,8 @@ if (DXFCXX_USE_PRECOMPILED_HEADERS) target_precompile_headers(${PROJECT_NAME}_static PRIVATE include/dxfeed_graal_cpp_api/internal/PrecompiledHeaders.hpp) endif () -target_link_libraries(${PROJECT_NAME}_static PUBLIC DxFeedGraalNativeSdk dxfcxx::internal utf8cpp fmt::fmt-header-only) -target_link_libraries(${PROJECT_NAME} PUBLIC DxFeedGraalNativeSdk dxfcxx::internal utf8cpp fmt::fmt-header-only) +target_link_libraries(${PROJECT_NAME}_static PUBLIC DxFeedGraalNativeSdk utf8cpp fmt::fmt-header-only) +target_link_libraries(${PROJECT_NAME} PUBLIC DxFeedGraalNativeSdk utf8cpp fmt::fmt-header-only) if (DXFCXX_ENABLE_ASAN_UBSAN) target_compile_options(${PROJECT_NAME} PRIVATE "-fsanitize=address" "-fsanitize=undefined") diff --git a/src/internal/CMakeLists.txt b/src/internal/CMakeLists.txt deleted file mode 100644 index a36efea4..00000000 --- a/src/internal/CMakeLists.txt +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright (c) 2023 Devexperts LLC. -# SPDX-License-Identifier: MPL-2.0 - -cmake_minimum_required(VERSION 3.21) - -project(dxFeedGraalCxxApi_Internal) - -if (POLICY CMP0092) - cmake_policy(SET CMP0092 NEW) -endif () - -if (POLICY CMP0135) - cmake_policy(SET CMP0135 NEW) -endif () - -set(CMAKE_CXX_STANDARD 20) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_C_STANDARD 11) -set(CMAKE_C_STANDARD_REQUIRED ON) -set(CXX_EXTENSIONS OFF) -set(C_EXTENSIONS OFF) - -set(dxFeedGraalCxxApi_Internal_Sources - CEntryPointErrors.cpp - Isolate.cpp - JavaObjectHandler.cpp - EventClassList.cpp - SymbolList.cpp - Common.cpp -) - -set(dxFeedGraalCxxApi_Internal_Utils_Sources - utils/StringUtils.cpp - utils/EnumUtils.cpp - utils/CmdArgsUtils.cpp -) - -set(dxFeedGraalCxxApi_Internal_UtilsDebug_Sources - utils/debug/Debug.cpp -) - - -add_library(dxFeedGraalCxxApi_Internal OBJECT - ${dxFeedGraalCxxApi_Internal_Sources} - ${dxFeedGraalCxxApi_Internal_Utils_Sources} - ${dxFeedGraalCxxApi_Internal_UtilsDebug_Sources} -) - -add_library(dxfcxx::internal ALIAS dxFeedGraalCxxApi_Internal) - -target_include_directories(dxFeedGraalCxxApi_Internal PRIVATE ../../include ../../third_party/range-v3-0.12/include) -target_link_libraries(dxFeedGraalCxxApi_Internal PRIVATE DxFeedGraalNativeSdk utf8cpp fmt::fmt-header-only) \ No newline at end of file