Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/ubuntu-smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ jobs:
- name: Run protocol_v1_bridge_smoke
run: ./build-linux/protocol_v1_bridge_smoke --self-test

- name: Build protocol_v1_named_pipe_bridge_smoke
run: cmake --build build-linux --target protocol_v1_named_pipe_bridge_smoke -j

- name: Run protocol_v1_named_pipe_bridge_smoke
run: ./build-linux/protocol_v1_named_pipe_bridge_smoke --self-test

- name: Build market_data_subscription_contract_test
run: cmake --build build-linux --target market_data_subscription_contract_test -j

Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/windows-smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ jobs:
- name: Build Bridge Protocol v1 smoke example
run: cmake --build build-windows --config Debug --target protocol_v1_bridge_smoke

- name: Build Bridge Protocol v1 named-pipe smoke example
run: cmake --build build-windows --config Debug --target protocol_v1_named_pipe_bridge_smoke

- name: Run MetaTrader file tests
shell: pwsh
run: |
Expand All @@ -72,6 +75,7 @@ jobs:
.\build-windows\Debug\bot_binary_command_builder_smoke.exe --self-test
.\build-windows\Debug\named_pipe_bridge_smoke.exe --self-test
.\build-windows\Debug\protocol_v1_bridge_smoke.exe --self-test
.\build-windows\Debug\protocol_v1_named_pipe_bridge_smoke.exe --self-test

- name: Test MetaEditor compile smoke script
shell: pwsh
Expand Down
54 changes: 54 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,60 @@ if(OPTIONX_BUILD_EXAMPLES)
-P "${CMAKE_CURRENT_SOURCE_DIR}/cmake/copy_runtime_dlls.cmake"
)
endif()

add_executable(protocol_v1_named_pipe_bridge_smoke examples/protocol_v1_named_pipe_bridge_smoke.cpp)
target_compile_features(protocol_v1_named_pipe_bridge_smoke PRIVATE cxx_std_17)

target_include_directories(protocol_v1_named_pipe_bridge_smoke PRIVATE
${EXAMPLE_INCLUDE_DIRS}
${EXAMPLE_DEPS_INCLUDE_DIRS}
${CMAKE_CURRENT_SOURCE_DIR}/external/Simple-Web-Server
${CMAKE_CURRENT_SOURCE_DIR}/external/SimpleNamedPipe/include
)

target_link_directories(protocol_v1_named_pipe_bridge_smoke PRIVATE ${EXAMPLE_LIBRARY_DIRS})
target_compile_definitions(
protocol_v1_named_pipe_bridge_smoke PRIVATE
${EXAMPLE_DEFINES}
LOGIT_BASE_PATH="${LOGIT_BASE_PATH_FWD}"
)
if(MINGW)
target_compile_options(protocol_v1_named_pipe_bridge_smoke PRIVATE -Wa,-mbig-obj)
elseif(MSVC)
target_compile_options(protocol_v1_named_pipe_bridge_smoke PRIVATE /bigobj)
endif()
if(OPTIONX_LIGHTWEIGHT_BRIDGE_SMOKE_TESTS)
target_link_libraries(
protocol_v1_named_pipe_bridge_smoke PRIVATE
${EXAMPLE_LIBS}
${OPTIONX_NETWORK_LIBS}
)
if(WIN32)
target_link_libraries(protocol_v1_named_pipe_bridge_smoke PRIVATE ${OPTIONX_WINDOWS_SYSTEM_LIBS})
endif()
else()
target_link_libraries(protocol_v1_named_pipe_bridge_smoke PRIVATE ${EXAMPLE_LIBS} optionx_cpp)
endif()

if(OPTIONX_BUILD_DEPS AND NOT OPTIONX_LIGHTWEIGHT_BRIDGE_SMOKE_TESTS)
add_dependencies(protocol_v1_named_pipe_bridge_smoke mdbx-static AES)
endif()

foreach(dll ${EXAMPLE_DLL_FILES})
add_custom_command(TARGET protocol_v1_named_pipe_bridge_smoke POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${dll}" "$<TARGET_FILE_DIR:protocol_v1_named_pipe_bridge_smoke>"
)
endforeach()

if(WIN32)
add_custom_command(TARGET protocol_v1_named_pipe_bridge_smoke POST_BUILD
COMMAND ${CMAKE_COMMAND}
-DOPTIONX_RUNTIME_DLL_DIR="${EXAMPLE_BUILD_LIBS_DIR}/bin"
-DOPTIONX_RUNTIME_TARGET_DIR="$<TARGET_FILE_DIR:protocol_v1_named_pipe_bridge_smoke>"
-P "${CMAKE_CURRENT_SOURCE_DIR}/cmake/copy_runtime_dlls.cmake"
)
endif()
endif()

if(OPTIONX_BUILD_TESTS)
Expand Down
3 changes: 3 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ Currently maintained examples:
- `protocol_v1_bridge_smoke.cpp` starts the Bridge Protocol v1 HTTP/WebSocket
server bridge and can run `--self-test` to POST a `trade.open` JSON-RPC
command to itself.
- `protocol_v1_named_pipe_bridge_smoke.cpp` starts Bridge Protocol v1 over a
local named pipe and, on Windows, can run `--self-test` with a local pipe
client.
- `metatrader_file_bridge_smoke.cpp` runs the C++ side of the MetaTrader
Common\Files bridge against a temporary command/event layout.
- `metatrader_file_command_writer_smoke.cpp` demonstrates the C++ command-writer
Expand Down
Loading
Loading