-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update build instructions for Visual Studio 2019 #4394
Closed
drlongle
wants to merge
4
commits into
XRPLF:develop
from
drlongle:build-on-windows-using-conan-and-cmake
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,14 @@ We do not recommend Windows for rippled production use at this time. Currently, | |
the Ubuntu platform has received the highest level of quality assurance, | ||
testing, and support. Additionally, 32-bit Windows versions are not supported. | ||
|
||
While there are several options for building `rippled` on Windows, we recommend | ||
using [Chocolatey, Conan, CMake and Visual | ||
Studio](README.md#build-using-chocolatey-conan-cmake-and-visual-studio). | ||
If using this option, you can skip the section [Install | ||
Software](README.md#install-software) because Conan automatically installs all | ||
dependencies for `rippled`. | ||
|
||
|
||
## Prerequisites | ||
|
||
To clone the source code repository, create branches for inspection or | ||
|
@@ -20,7 +28,8 @@ need these software components | |
| [Boost library](README.md#build-boost) | 1.70.0 | | ||
| [CMake for Windows](README.md#optional-install-cmake-for-windows)* | 3.12 | | ||
|
||
\* Only needed if not using the integrated CMake in VS 2019 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 | ||
|
||
|
@@ -233,6 +242,64 @@ or | |
``` | ||
These paths are relative to your cloned git repository. | ||
|
||
# Build using Chocolatey, Conan, CMake and Visual Studio | ||
|
||
Open a PowerShell as Administrator and execute a | ||
[setup script](https://gist.github.com/ximinez/1678229f97831c602a9a42a1ea03c9c4). | ||
Alternatively, [install Chocolatey](https://chocolatey.org/install) and run the following commands | ||
in a PowerShell as Administrator: | ||
|
||
```powershell | ||
choco install -y git conan | ||
choco install -y cmake.install --installargs '"ADD_CMAKE_TO_PATH=System"' | ||
choco install -y visualstudio2019-workload-vctools | ||
choco install -y visualstudio2019community | ||
choco install -y visualstudio2019-workload-nativedesktop | ||
|
||
``` | ||
|
||
|
||
If you do not have a Conan profile already, create a default profile: | ||
|
||
```powershell | ||
conan profile new default --detect | ||
``` | ||
|
||
Set Conan options to compile in the C++20 dialect and for the x64 architecture: | ||
|
||
```powershell | ||
conan profile update settings.compiler.cppstd=20 default | ||
conan profile update settings.arch=x86_64 default | ||
``` | ||
|
||
Clone the `rippled` repository: | ||
```powershell | ||
git clone [email protected]:XRPLF/rippled.git | ||
cd rippled | ||
``` | ||
|
||
Run the following commands to create a release build: | ||
```powershell | ||
conan export external/rocksdb | ||
mkdir .build | ||
cd .build | ||
conan install .. --output-folder . --build missing --settings build_type=Release --settings compiler.runtime=MT | ||
cmake -DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake .. | ||
cmake --build . --config Release | ||
./Release/rippled --unittest | ||
``` | ||
|
||
Alternatively, run the following commands to create a debug build: | ||
```powershell | ||
conan export external/rocksdb | ||
mkdir .build | ||
cd .build | ||
conan install .. --output-folder . --build missing --settings build_type=Debug --settings compiler.runtime=MTd | ||
cmake -DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake .. | ||
cmake --build . --config Debug | ||
./Debug/rippled --unittest | ||
``` | ||
|
||
# Unity/No-Unity Builds | ||
|
||
The rippled build system defaults to using | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
## To run these commands as a script, execution policy must be relaxed: | ||
#set-executionpolicy remotesigned | ||
## If running in admin powershell simply run: | ||
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) | ||
choco install -y python3 | ||
choco install -y git conan | ||
choco install -y cmake.install --installargs '"ADD_CMAKE_TO_PATH=System"' | ||
|
||
## These workloads depend on and will install visualstudio<year>buildtools | ||
choco install -y visualstudio2022-workload-vctools visualstudio2019-workload-vctools | ||
## and for the IDEs *Be prepared to wait!* | ||
choco install -y visualstudio2019community | ||
choco install -y visualstudio2019-workload-nativedesktop | ||
choco install -y visualstudio2022community | ||
choco install -y visualstudio2022-workload-nativedesktop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This command is already in the crash course. This section assumes the person has installed and configured Python, Conan, and CMake.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does not seem too bad to repeat that command. However, I'll be happy to remove it if you prefer. Please let me know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally, I think it is good to repeat the command. Obviously, there is a balance (we wouldn't want to repeat it 5 times). But this looks ok to me.