File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,6 +32,18 @@ target_link_libraries(rmqio PUBLIC
3232 Boost::boost
3333)
3434
35+ # boost::asio::chrono maps to boost::chrono on platforms without std::chrono
36+ # (e.g. Solaris/C++03, IBM XL). Use header-only mode to avoid needing
37+ # libboost_chrono, and fall back to linking it if available elsewhere.
38+ if ("${CMAKE_CXX_COMPILER_ID} " STREQUAL "SunPro" OR "${CMAKE_CXX_COMPILER_ID} " STREQUAL "XL" )
39+ target_compile_definitions (rmqio PUBLIC BOOST_CHRONO_HEADER_ONLY )
40+ else ()
41+ find_library (Boost_CHRONO_LIBRARY NAMES boost_chrono )
42+ if (Boost_CHRONO_LIBRARY)
43+ target_link_libraries (rmqio PUBLIC ${Boost_CHRONO_LIBRARY} )
44+ endif ()
45+ endif ()
46+
3547if ( "${CMAKE_CXX_COMPILER_ID} " STREQUAL "SunPro" )
3648 # _RWSTD_ALLOCATOR tells the solaris <memory> header to define a std::allocator
3749 # which conforms better to the C++ standard, which is expected by Boost. Without
Original file line number Diff line number Diff line change 1515
1616#include < rmqio_asiotimer.h>
1717
18- namespace {
19- void instantiateTemplates ()
20- {
21- // Instantiate the templates to ensure that they compile.
22- BloombergLP::rmqio::AsioEventLoop eventLoop;
23- BloombergLP::rmqio::AsioTimerFactory timerFactory (eventLoop);
24- BloombergLP::rmqio::AsioTimer timer (eventLoop.context (),
25- BloombergLP::bsls::TimeInterval (1 ));
26- }
27- } // namespace
18+ namespace BloombergLP {
19+ namespace rmqio {
20+ template class basic_AsioTimer <DefaultClockType>;
21+ template class basic_AsioTimerFactory <DefaultClockType>;
22+ } // namespace rmqio
23+ } // namespace BloombergLP
Original file line number Diff line number Diff line change @@ -16,6 +16,9 @@ if (NOT DEFINED ENV{PYTHON_BINARY})
1616 execute_process (COMMAND "${Python3_EXECUTABLE} " -m venv ${CMAKE_CURRENT_BINARY_DIR} /.venv )
1717 set (ENV{VIRTUAL_ENV} ${CMAKE_CURRENT_BINARY_DIR} /.venv)
1818 execute_process (COMMAND ${CMAKE_CURRENT_BINARY_DIR} /.venv/bin/pip install -r ${CMAKE_CURRENT_LIST_DIR} /requirements.txt )
19+ if (NOT CMAKE_SYSTEM_NAME STREQUAL "SunOS" )
20+ execute_process (COMMAND ${CMAKE_CURRENT_BINARY_DIR} /.venv/bin/pip install telnetlib3 )
21+ endif ()
1922 set (PYTHON_BINARY ${CMAKE_CURRENT_BINARY_DIR} /.venv/bin/python)
2023else ()
2124 set (PYTHON_BINARY $ENV{PYTHON_BINARY} )
Original file line number Diff line number Diff line change 11requests
22pytest
3- telnetlib3
Original file line number Diff line number Diff line change 1919import requests
2020from requests .auth import HTTPBasicAuth
2121from typing import Any
22- from telnetlib3 import Telnet
22+ try :
23+ from telnetlib import Telnet
24+ except ImportError :
25+ from telnetlib3 import Telnet
2326from contextlib import contextmanager
2427import logging
2528import re
You can’t perform that action at this time.
0 commit comments