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
12 changes: 12 additions & 0 deletions src/rmq/rmqio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,18 @@ target_link_libraries(rmqio PUBLIC
Boost::boost
)

# boost::asio::chrono maps to boost::chrono on platforms without std::chrono
# (e.g. Solaris/C++03, IBM XL). Use header-only mode to avoid needing
# libboost_chrono, and fall back to linking it if available elsewhere.
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "SunPro" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "XL")
target_compile_definitions(rmqio PUBLIC BOOST_CHRONO_HEADER_ONLY)
else()
find_library(Boost_CHRONO_LIBRARY NAMES boost_chrono)
if(Boost_CHRONO_LIBRARY)
target_link_libraries(rmqio PUBLIC ${Boost_CHRONO_LIBRARY})
endif()
endif()

if( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "SunPro" )
# _RWSTD_ALLOCATOR tells the solaris <memory> header to define a std::allocator
# which conforms better to the C++ standard, which is expected by Boost. Without
Expand Down
16 changes: 6 additions & 10 deletions src/rmq/rmqio/rmqio_asiotimer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,9 @@

#include <rmqio_asiotimer.h>

namespace {
void instantiateTemplates()
{
// Instantiate the templates to ensure that they compile.
BloombergLP::rmqio::AsioEventLoop eventLoop;
BloombergLP::rmqio::AsioTimerFactory timerFactory(eventLoop);
BloombergLP::rmqio::AsioTimer timer(eventLoop.context(),
BloombergLP::bsls::TimeInterval(1));
}
} // namespace
namespace BloombergLP {
namespace rmqio {
template class basic_AsioTimer<DefaultClockType>;
template class basic_AsioTimerFactory<DefaultClockType>;
} // namespace rmqio
} // namespace BloombergLP
3 changes: 3 additions & 0 deletions src/tests/integration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ if (NOT DEFINED ENV{PYTHON_BINARY})
execute_process (COMMAND "${Python3_EXECUTABLE}" -m venv ${CMAKE_CURRENT_BINARY_DIR}/.venv)
set (ENV{VIRTUAL_ENV} ${CMAKE_CURRENT_BINARY_DIR}/.venv)
execute_process(COMMAND ${CMAKE_CURRENT_BINARY_DIR}/.venv/bin/pip install -r ${CMAKE_CURRENT_LIST_DIR}/requirements.txt)
if(NOT CMAKE_SYSTEM_NAME STREQUAL "SunOS")
execute_process(COMMAND ${CMAKE_CURRENT_BINARY_DIR}/.venv/bin/pip install telnetlib3)
endif()
set(PYTHON_BINARY ${CMAKE_CURRENT_BINARY_DIR}/.venv/bin/python)
else()
set(PYTHON_BINARY $ENV{PYTHON_BINARY})
Expand Down
1 change: 0 additions & 1 deletion src/tests/integration/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
requests
pytest
telnetlib3
5 changes: 4 additions & 1 deletion src/tests/integration/rmqapitests/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
import requests
from requests.auth import HTTPBasicAuth
from typing import Any
from telnetlib3 import Telnet
try:
from telnetlib import Telnet
except ImportError:
from telnetlib3 import Telnet
from contextlib import contextmanager
import logging
import re
Expand Down
Loading