Skip to content

Commit 35e6444

Browse files
committed
Merge bitcoin#34570: doc: update Windows MSVC build guide to utilize winget to install build requirements
d159b10 doc: update Windows MSVC build guide to utilize WinGet to install apps (janb84) Pull request description: This PR updates the Windows MSVC build guide to bring it more in line with the macOS and Unix build guides. Currently the guide listed requirements but left users to manually do the download/installation. The macOS and the Unix guide utilize package managers to provide concrete installation commands that users can follow. By introducing `winget`, the Windows MSVC build guide now also provides concrete installation commands. The changes/commands can be tested on any windows machine, provided it run a Windows 10 (version 1809 (build 17763)) or later (e.g. Windows 11 / Server 2025). ACKs for top commit: hodlinator: re-ACK d159b10 hebasto: re-ACK d159b10. Tree-SHA512: 9eeee60ba3e50e42362f1a6d8003120868c1f49cf146cc6fe16a6deb53ce29c67e841b8ec80d516fe2e6d6ea4c48d34fb12691151e0fea5568c14377bd3da6fb
2 parents b65ff0e + d159b10 commit 35e6444

File tree

1 file changed

+41
-17
lines changed

1 file changed

+41
-17
lines changed

doc/build-windows-msvc.md

Lines changed: 41 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,49 @@ For cross-compiling options, please see [`build-windows.md`](./build-windows.md)
66

77
## Preparation
88

9-
### 1. Visual Studio
9+
### 1. Install Required Dependencies
10+
11+
The first step is to install the required build applications. The instructions below use WinGet to install the applications.
12+
13+
WinGet is available on all supported Windows versions. The applications mentioned can also be installed manually.
14+
15+
#### Visual Studio
1016

1117
This guide relies on using CMake and vcpkg package manager provided with the Visual Studio installation.
12-
Here are requirements for the Visual Studio installation:
13-
1. Minimum required version: Visual Studio 2026 version 18.3.
14-
2. Installed components:
15-
- The "Desktop development with C++" workload.
1618

17-
The commands in this guide should be executed in "Developer PowerShell for VS" or "Developer Command Prompt for VS".
19+
Minimum required version: Visual Studio 2026 version 18.3 with the "Desktop development with C++" workload.
20+
21+
To install Visual Studio Community Edition with the necessary components, run:
22+
23+
```powershell
24+
winget install --id Microsoft.VisualStudio.Community --override "--wait --quiet --add Microsoft.VisualStudio.Workload.NativeDesktop --add Microsoft.VisualStudio.Component.Git --includeRecommended"
25+
```
26+
27+
This installs:
28+
- Visual Studio
29+
- The "Desktop development with C++" workload (NativeDesktop)
30+
- Git component
31+
32+
After installation, the commands in this guide should be executed in "Developer PowerShell for VS" or "Developer Command Prompt for VS".
1833
The former is assumed hereinafter.
1934

20-
### 2. Git
35+
#### Python
2136

22-
Download and install [Git for Windows](https://git-scm.com/downloads/win). Once installed, Git is available from PowerShell or the Command Prompt.
37+
Python is required for running the test suite.
2338

24-
### 3. Clone Bitcoin Repository
39+
To install Python, run:
2540

26-
Clone the Bitcoin Core repository to a directory. All build scripts and commands will run from this directory.
41+
```powershell
42+
winget install python3
2743
```
44+
45+
### 2. Clone Bitcoin Repository
46+
47+
`git` should already be installed as a component of Visual Studio. If not, download and install [Git for Windows](https://git-scm.com/downloads/win).
48+
49+
Clone the Bitcoin Core repository to a directory. All build scripts and commands will run from this directory.
50+
51+
```powershell
2852
git clone https://github.com/bitcoin/bitcoin.git
2953
```
3054

@@ -38,7 +62,7 @@ The Bitcoin Core project supports the following vcpkg triplets:
3862
To facilitate build process, the Bitcoin Core project provides presets, which are used in this guide.
3963

4064
Available presets can be listed as follows:
41-
```
65+
```powershell
4266
cmake --list-presets
4367
```
4468

@@ -52,7 +76,7 @@ In the following instructions, the "Debug" configuration can be specified instea
5276

5377
Run `cmake -B build -LH` to see the full list of available options.
5478

55-
### 4. Building with Static Linking with GUI
79+
### Building with Static Linking with GUI
5680

5781
```powershell
5882
cmake -B build --preset vs2026-static # It might take a while if the vcpkg binary cache is unpopulated or invalidated.
@@ -61,15 +85,15 @@ ctest --test-dir build --build-config Release # Append "-j N" for N parallel te
6185
cmake --install build --config Release # Optional.
6286
```
6387

64-
### 5. Building with Dynamic Linking without GUI
88+
### Building with Dynamic Linking without GUI
6589

6690
```powershell
6791
cmake -B build --preset vs2026 -DBUILD_GUI=OFF # It might take a while if the vcpkg binary cache is unpopulated or invalidated.
6892
cmake --build build --config Release # Append "-j N" for N parallel jobs.
6993
ctest --test-dir build --build-config Release # Append "-j N" for N parallel tests.
7094
```
7195

72-
### 6. vcpkg-specific Issues and Workarounds
96+
### vcpkg-specific Issues and Workarounds
7397

7498
vcpkg installation during the configuration step might fail for various reasons unrelated to Bitcoin Core.
7599

@@ -92,16 +116,16 @@ cmake -B build --preset vs2026-static -DVCPKG_INSTALLED_DIR="C:\path_without_spa
92116

93117
## Performance Notes
94118

95-
### 7. vcpkg Manifest Default Features
119+
### vcpkg Manifest Default Features
96120

97121
One can skip vcpkg manifest default features to speed up the configuration step.
98122
For example, the following invocation will skip all features except for "wallet" and "tests" and their dependencies:
99-
```
123+
```powershell
100124
cmake -B build --preset vs2026 -DVCPKG_MANIFEST_NO_DEFAULT_FEATURES=ON -DVCPKG_MANIFEST_FEATURES="wallet;tests" -DBUILD_GUI=OFF -DWITH_ZMQ=OFF
101125
```
102126

103127
Available features are listed in the [`vcpkg.json`](/vcpkg.json) file.
104128

105-
### 8. Antivirus Software
129+
### Antivirus Software
106130

107131
To improve the build process performance, one might add the Bitcoin repository directory to the Microsoft Defender Antivirus exclusions.

0 commit comments

Comments
 (0)