C++ standard and Boost requirements are connected:
1. With C++11 onward, we require Boost system component, with
C++03 we need chrono and random components too
2. When building against boost 1.66 and newer, C++11 is required.
Closes#3011, partially closes#2966.
CMake build scripts improved to simplify configuring and building of
project and tests.
Better use of compile definitions by replacing add_definitions with
target_compile_definitions. Use INTERFACE, PUBLIC and PRIVATE keywords
to separate scope of TORRENT_BUILDING_SHARED and TORRENT_LINKING_SHARED
definitions.
* Move tests to the separate file - test/CmakeLists.txt
* Fix use of compile definitions
* Remove redundant tailqueue.cpp
It's not a test as such, since it's got its own main() that takes
arguments, doesn't return a result that can be directly compared
against expected results, and doesn't make use of the test_common
infrastructure.
The CMake build attempts to build all files named test_*.cpp with
test_common, whose main() and load_file() symbols clash with those
that the benchmark provides. Instead of making an exception, let's
rename it to something that doesn't start with "test_". Its usage
message even claims it's called bdecode_benchmark, so we use that.
Also, complete the file listing for test_common in CMake and use
an OBJECT pseudo-library there instead of STATIC. It's just as good
and jives better with having symbols provided by the executable.
(Follow-up patch in the works to provide Asio symbols that way.)
test_natpmp is a proper test but doesn't currently build,
so exclude it from the build for now.
The session_handle class exposes the same public interface to session_impl as
the session class. The difference being that session_handle does not own the
underlying session_impl so multiple session_handle instances can be created
and copied about as needed.
The intent is to chenge the plugin API to pass an instance of session_handle
instead of a pointer to session_impl. This change will be made in a separate
patch.
To maintain ABI compatibilty, the type signature of session was not changed.
The relevent functions have been modified to forward to session_handle and
all enums have been left in session.