Support for boost 1.80.0:

Boost intrusive renamed the `comp()` function -> `get_comp()`
This commit is contained in:
seelabs
2022-09-17 22:25:05 -04:00
committed by manojsdoshi
parent d33df35378
commit 04ef885108
3 changed files with 42 additions and 27 deletions

View File

@@ -3,7 +3,7 @@
"configurations": [ "configurations": [
{ {
"name": "x64-Debug", "name": "x64-Debug",
"generator": "Visual Studio 15 2017 Win64", "generator": "Visual Studio 16 2019",
"configurationType": "Debug", "configurationType": "Debug",
"inheritEnvironments": [ "msvc_x64_x64" ], "inheritEnvironments": [ "msvc_x64_x64" ],
"buildRoot": "${thisFileDir}\\build\\${name}", "buildRoot": "${thisFileDir}\\build\\${name}",
@@ -23,7 +23,7 @@
}, },
{ {
"name": "x64-Release", "name": "x64-Release",
"generator": "Visual Studio 15 2017 Win64", "generator": "Visual Studio 16 2019",
"configurationType": "Release", "configurationType": "Release",
"inheritEnvironments": [ "msvc_x64_x64" ], "inheritEnvironments": [ "msvc_x64_x64" ],
"buildRoot": "${thisFileDir}\\build\\${name}", "buildRoot": "${thisFileDir}\\build\\${name}",

View File

@@ -1,4 +1,4 @@
# Visual Studio 2017 Build Instructions # Visual Studio 2019 Build Instructions
## Important ## Important
@@ -14,26 +14,26 @@ need these software components
| Component | Minimum Recommended Version | | Component | Minimum Recommended Version |
|-----------|-----------------------| |-----------|-----------------------|
| [Visual Studio 2017](README.md#install-visual-studio-2017)| 15.5.4 | | [Visual Studio 2019](README.md#install-visual-studio-2019)| 15.5.4 |
| [Git for Windows](README.md#install-git-for-windows)| 2.16.1 | | [Git for Windows](README.md#install-git-for-windows)| 2.16.1 |
| [OpenSSL Library](README.md#install-openssl) | 1.1.1L | | [OpenSSL Library](README.md#install-openssl) | 1.1.1L |
| [Boost library](README.md#build-boost) | 1.70.0 | | [Boost library](README.md#build-boost) | 1.70.0 |
| [CMake for Windows](README.md#optional-install-cmake-for-windows)* | 3.12 | | [CMake for Windows](README.md#optional-install-cmake-for-windows)* | 3.12 |
\* Only needed if not using the integrated CMake in VS 2017 and prefer generating dedicated project/solution files. \* Only needed if not using the integrated CMake in VS 2019 and prefer generating dedicated project/solution files.
## Install Software ## Install Software
### Install Visual Studio 2017 ### Install Visual Studio 2019
If not already installed on your system, download your choice of installer from If not already installed on your system, download your choice of installer from
the [Visual Studio 2017 the [Visual Studio 2019
Download](https://www.visualstudio.com/downloads/download-visual-studio-vs) Download](https://www.visualstudio.com/downloads/download-visual-studio-vs)
page, run the installer, and follow the directions. **You may need to choose the page, run the installer, and follow the directions. **You may need to choose the
`Desktop development with C++` workload to install all necessary C++ features.** `Desktop development with C++` workload to install all necessary C++ features.**
Any version of Visual Studio 2017 may be used to build rippled. The **Visual Any version of Visual Studio 2019 may be used to build rippled. The **Visual
Studio 2017 Community** edition is available free of charge (see [the product Studio 2019 Community** edition is available free of charge (see [the product
page](https://www.visualstudio.com/products/visual-studio-community-vs) for page](https://www.visualstudio.com/products/visual-studio-community-vs) for
licensing details), while paid editions may be used for an initial free-trial licensing details), while paid editions may be used for an initial free-trial
period. period.
@@ -55,7 +55,7 @@ OpenSSL.](http://slproweb.com/products/Win32OpenSSL.html) There will
several `Win64` bit variants available, you want the non-light several `Win64` bit variants available, you want the non-light
`v1.1` line. As of this writing, you **should** select `v1.1` line. As of this writing, you **should** select
* Win64 OpenSSL v1.1.1L * Win64 OpenSSL v1.1.1q
and should **not** select and should **not** select
@@ -82,11 +82,11 @@ to get the correct 32-/64-bit variant.
Boost 1.70 or later is required. Boost 1.70 or later is required.
After [downloading boost](http://www.boost.org/users/download/) and unpacking it [Download boost](http://www.boost.org/users/download/) and unpack it
to `c:\lib`. As of this writing, the most recent version of boost is 1.70.0, to `c:\lib`. As of this writing, the most recent version of boost is 1.80.0,
which will unpack into a directory named `boost_1_70_0`. We recommended either which will unpack into a directory named `boost_1_80_0`. We recommended either
renaming this directory to `boost`, or creating a junction link `mklink /J boost renaming this directory to `boost`, or creating a junction link `mklink /J boost
boost_1_70_0`, so that you can more easily switch between versions. boost_1_80_0`, so that you can more easily switch between versions.
Next, open **Developer Command Prompt** and type the following commands Next, open **Developer Command Prompt** and type the following commands
@@ -101,11 +101,11 @@ is not affected by changes in outside files. Therefore, it is necessary to build
the required boost static libraries using this command: the required boost static libraries using this command:
```powershell ```powershell
bjam -j<Num Parallel> --toolset=msvc-14.1 address-model=64 architecture=x86 link=static threading=multi runtime-link=shared,static stage b2 -j<Num Parallel> --toolset=msvc-14.2 address-model=64 architecture=x86 link=static threading=multi runtime-link=shared,static stage
``` ```
where you should replace `<Num Parallel>` with the number of parallel where you should replace `<Num Parallel>` with the number of parallel
invocations to use build, e.g. `bjam -j4 ...` would use up to 4 concurrent build invocations to use build, e.g. `bjam -j8 ...` would use up to 8 concurrent build
shell commands for the build. shell commands for the build.
Building the boost libraries may take considerable time. When the build process Building the boost libraries may take considerable time. When the build process
@@ -115,7 +115,7 @@ library paths as they will be required later.
### (Optional) Install CMake for Windows ### (Optional) Install CMake for Windows
[CMake](http://cmake.org) is a cross platform build system generator. Visual [CMake](http://cmake.org) is a cross platform build system generator. Visual
Studio 2017 includes an integrated version of CMake that avoids having to Studio 2019 includes an integrated version of CMake that avoids having to
manually run CMake, but it is undergoing continuous improvement. Users that manually run CMake, but it is undergoing continuous improvement. Users that
prefer to use standard Visual Studio project and solution files need to install prefer to use standard Visual Studio project and solution files need to install
a dedicated version of CMake to generate them. The latest version can be found a dedicated version of CMake to generate them. The latest version can be found
@@ -141,7 +141,7 @@ repository and optionally switch to the *master* branch. Type the following at
the bash prompt: the bash prompt:
```powershell ```powershell
git clone git@github.com:ripple/rippled.git git clone git@github.com:XRPLF/rippled.git
cd rippled cd rippled
``` ```
If you receive an error about not having the "correct access rights" make sure If you receive an error about not having the "correct access rights" make sure
@@ -160,7 +160,7 @@ To test the latest release candidate, choose the `release` branch.
git checkout release git checkout release
``` ```
If you are doing development work and want the latest set of untested features, If you are doing development work and want the latest set of beta features,
you can consider using the `develop` branch instead. you can consider using the `develop` branch instead.
``` ```
@@ -177,14 +177,14 @@ To begin, simply:
cloned rippled folder. cloned rippled folder.
2. Right-click on `CMakeLists.txt` in the **Solution Explorer - Folder View** to 2. Right-click on `CMakeLists.txt` in the **Solution Explorer - Folder View** to
generate a `CMakeSettings.json` file. A sample settings file is provided generate a `CMakeSettings.json` file. A sample settings file is provided
[here](/Builds/VisualStudio2017/CMakeSettings-example.json). Customize the [here](/Builds/VisualStudio2019/CMakeSettings-example.json). Customize the
settings for `BOOST_ROOT`, `OPENSSL_ROOT` to match the install paths if they settings for `BOOST_ROOT`, `OPENSSL_ROOT` to match the install paths if they
differ from those in the file. differ from those in the file.
4. Select either the `x64-Release` or `x64-Debug` configuration from the 4. Select either the `x64-Release` or `x64-Debug` configuration from the
**Project Setings** drop-down. This should invoke the built-in CMake project **Project Settings** drop-down. This should invoke the built-in CMake project
generator. If not, you can right-click on the `CMakeLists.txt` file and generator. If not, you can right-click on the `CMakeLists.txt` file and
choose **Cache | Generate Cache**. choose **Configure rippled**.
5. Select either the `rippled.exe` (unity) or `rippled_classic.exe` (non-unity) 5. Select the `rippled.exe`
option in the **Select Startup Item** drop-down. This will be the target option in the **Select Startup Item** drop-down. This will be the target
built when you press F7. Alternatively, you can choose a target to build from built when you press F7. Alternatively, you can choose a target to build from
the top-level **CMake | Build** menu. Note that at this time, there are other the top-level **CMake | Build** menu. Note that at this time, there are other
@@ -216,9 +216,9 @@ execute the following commands within your `rippled` cloned repository:
``` ```
mkdir build\cmake mkdir build\cmake
cd build\cmake cd build\cmake
cmake ..\.. -G"Visual Studio 15 2017 Win64" -DBOOST_ROOT="C:\lib\boost_1_70_0" -DOPENSSL_ROOT="C:\lib\OpenSSL-Win64" -DCMAKE_GENERATOR_TOOLSET=host=x64 cmake ..\.. -G"Visual Studio 16 2019" -Ax64 -DBOOST_ROOT="C:\lib\boost" -DOPENSSL_ROOT="C:\lib\OpenSSL-Win64" -DCMAKE_GENERATOR_TOOLSET=host=x64
``` ```
Now launch Visual Studio 2017 and select **File | Open | Project/Solution**. Now launch Visual Studio 2019 and select **File | Open | Project/Solution**.
Navigate to the `build\cmake` folder created above and select the `rippled.sln` Navigate to the `build\cmake` folder created above and select the `rippled.sln`
file. You can then choose whether to build the `Debug` or `Release` solution file. You can then choose whether to build the `Debug` or `Release` solution
configuration. configuration.

View File

@@ -1432,7 +1432,12 @@ template <
class Allocator> class Allocator>
aged_ordered_container<IsMulti, IsMap, Key, T, Clock, Compare, Allocator>:: aged_ordered_container<IsMulti, IsMap, Key, T, Clock, Compare, Allocator>::
aged_ordered_container(aged_ordered_container const& other) aged_ordered_container(aged_ordered_container const& other)
: m_config(other.m_config), m_cont(other.m_cont.comp()) : m_config(other.m_config)
#if BOOST_VERSION >= 108000
, m_cont(other.m_cont.get_comp())
#else
, m_cont(other.m_cont.comp())
#endif
{ {
insert(other.cbegin(), other.cend()); insert(other.cbegin(), other.cend());
} }
@@ -1449,7 +1454,12 @@ aged_ordered_container<IsMulti, IsMap, Key, T, Clock, Compare, Allocator>::
aged_ordered_container( aged_ordered_container(
aged_ordered_container const& other, aged_ordered_container const& other,
Allocator const& alloc) Allocator const& alloc)
: m_config(other.m_config, alloc), m_cont(other.m_cont.comp()) : m_config(other.m_config, alloc)
#if BOOST_VERSION >= 108000
, m_cont(other.m_cont.get_comp())
#else
, m_cont(other.m_cont.comp())
#endif
{ {
insert(other.cbegin(), other.cend()); insert(other.cbegin(), other.cend());
} }
@@ -1482,7 +1492,12 @@ aged_ordered_container<IsMulti, IsMap, Key, T, Clock, Compare, Allocator>::
aged_ordered_container&& other, aged_ordered_container&& other,
Allocator const& alloc) Allocator const& alloc)
: m_config(std::move(other.m_config), alloc) : m_config(std::move(other.m_config), alloc)
#if BOOST_VERSION >= 108000
, m_cont(std::move(other.m_cont.get_comp()))
#else
, m_cont(std::move(other.m_cont.comp())) , m_cont(std::move(other.m_cont.comp()))
#endif
{ {
insert(other.cbegin(), other.cend()); insert(other.cbegin(), other.cend());
other.clear(); other.clear();