Skip to content

Commit ce4dbfc

Browse files
committed
Merge bitcoin/bitcoin#31851: doc: build: Fix instructions for msvc gui builds
c3fa043 doc: build: Fix instructions for msvc gui builds (David Gumberg) Pull request description: If the instructions in `doc/build-windows-msvc.md` are followed as-is, and "Developer (PowerShell|Command Prompt) for VS 2022" is used to execute the suggested build commands, the root directory of vcpkg (e.g. in VS 2022 Community edition: `C:\Program Files\Microsoft Visual Studio\2022\Community\VC\vcpkg`), is too long, and when vcpkg attempts to build any of the QT packages, it will fail because of build steps that require path lengths greater than Windows' `MAX_PATH` 260 character limit. This can be avoided without needing to move the vcpkg root dir by setting [`--x-buildtrees-root`](https://learn.microsoft.com/en-us/vcpkg/commands/common-options#buildtrees-root) to a short path, like `C:\vcpkg`. See e.g. microsoft/vcpkg#28451, microsoft/vcpkg#28083, microsoft/vcpkg#24751. ACKs for top commit: achow101: ACK c3fa043 hebasto: ACK c3fa043. TheCharlatan: ACK c3fa043 Tree-SHA512: 7de11d38b9125de63e72415f79d82f18818123a1b37f679f2229c4c82f5628dd7d1039dbc5dcdf1bc1c8c382e3e29de74a31d256e73872cbf1fa2687c52185ca
2 parents 504d0c2 + c3fa043 commit ce4dbfc

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

doc/build-windows-msvc.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,17 @@ ctest --test-dir build --build-config Release # Use "-j N" for N parallel tests
5959
cmake --install build --config Release # Optional.
6060
```
6161

62+
If building with `BUILD_GUI=ON`, vcpkg installation during the build
63+
configuration step might fail because of extremely long paths required during
64+
vcpkg installation if your vcpkg instance is installed in the default Visual
65+
Studio directory. This can be avoided without modifying your vcpkg root
66+
directory by changing vcpkg's intermediate build directory with the
67+
`--x-buildtrees-root` argument to something shorter, for example:
68+
69+
```powershell
70+
cmake -B build --preset vs2022-static -DVCPKG_INSTALL_OPTIONS="--x-buildtrees-root=C:\vcpkg"
71+
```
72+
6273
### 5. Building with Dynamic Linking without GUI
6374

6475
```

0 commit comments

Comments
 (0)